Planeshift

widgetconfigwindow.h

Go to the documentation of this file.
00001 /*
00002 * widgetconfigwindow.h - Author: Ian Donderwinkel
00003 *
00004 * Copyright (C) 2003 Atomic Blue ([email protected], http://www.atomicblue.org)
00005 *
00006 *
00007 * This program is free software; you can redistribute it and/or
00008 * modify it under the terms of the GNU General Public License
00009 * as published by the Free Software Foundation (version 2 of the License)
00010 * This program is distributed in the hope that it will be useful,
00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 * GNU General Public License for more details.
00014 * You should have received a copy of the GNU General Public License
00015 * along with this program; if not, write to the Free Software
00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 *
00018 */
00019 
00020 #ifndef __WIDGET_CONFIG_WINDOW_
00021 #define __WIDGET_CONFIG_WINDOW_
00022 
00023 #include "pawswidget.h"
00024 #include "pawsmanager.h"
00025 #include "pawsmainwidget.h"
00026 
00027 class pawsProgressBar;
00028 class pawsButton;
00029 class pawsCheckBox;
00030 class pawsTextBox;
00031 class pawsScrollBar;
00032 
00037 //-----------------------------------------------------------------------------
00038 //                            class WidgetConfigWindow
00039 //-----------------------------------------------------------------------------
00040 class WidgetConfigWindow : public pawsWidget
00041 {
00042 public:
00043 
00044     WidgetConfigWindow();
00045     virtual ~WidgetConfigWindow() {};
00046 
00047     bool PostSetup();
00048     bool OnScroll(int direction, pawsScrollBar* widget);
00049     bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget* widget);
00052     void restoreSettings();
00056     void Close()
00057     {
00058         restoreSettings();
00059         configWidget = NULL;
00060         Hide();
00061     }
00062 
00063     void SetConfigurableWidget(pawsWidget* w);
00064 
00065 private:
00066 
00068     float    oldMinAlpha;
00069     float    oldMaxAlpha;
00070     float    oldFadeSpeed;
00071     bool     oldFadeStatus;
00072     bool     oldFontStatus;
00073 
00075     float   currentMinAlpha;
00076     float   currentMaxAlpha;
00077     float   currentFadeSpeed;
00078     bool    currentFadeStatus;
00079     bool    currentFontStatus;
00080 
00082     pawsScrollBar*        scrollBarMinAlpha;
00083     pawsProgressBar*    progressBarMinAlpha;
00084 
00086     pawsScrollBar*        scrollBarMaxAlpha;
00087     pawsProgressBar*    progressBarMaxAlpha;
00088 
00090     pawsScrollBar*        scrollBarFadeSpeed;
00091     pawsProgressBar*    progressBarFadeSpeed;
00092 
00094     pawsButton*            buttonOK;
00095     pawsButton*            buttonCancel;
00096     pawsButton*            buttonApply;
00097 
00099     pawsCheckBox*            checkboxFade;
00100     pawsCheckBox*            checkboxFont;
00101 
00103     pawsTextBox*        textFadeStatus;
00104     pawsTextBox*        textFontStatus;
00105     pawsTextBox*        textMinAlphaPct;    // min Alpha in %
00106     pawsTextBox*        textMaxAlphaPct;    // max Alpha in %
00107     pawsTextBox*        textFadeSpeedPct;   // current fade value in %
00108 
00110     pawsWidget*    configWidget;
00111 };
00112 
00113 CREATE_PAWS_FACTORY(WidgetConfigWindow);
00114 
00115 
00118 #endif