Planeshift
widgetconfigwindow.h
Go to the documentation of this file.
1 /*
2 * widgetconfigwindow.h - Author: Ian Donderwinkel
3 *
4 * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5 *
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation (version 2 of the License)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 */
19 
20 #ifndef __WIDGET_CONFIG_WINDOW_
21 #define __WIDGET_CONFIG_WINDOW_
22 
23 #include "pawswidget.h"
24 #include "pawsmanager.h"
25 #include "pawsmainwidget.h"
26 
27 class pawsProgressBar;
28 class pawsButton;
29 class pawsCheckBox;
30 class pawsTextBox;
31 class pawsScrollBar;
32 
41 {
42 public:
43 
45  virtual ~WidgetConfigWindow() {};
46 
47  bool PostSetup();
48  bool OnScroll(int direction, pawsScrollBar* widget);
49  bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget* widget);
52  void restoreSettings();
56  void Close()
57  {
59  configWidget = NULL;
60  Hide();
61  }
62 
64 
65 private:
66 
68  float oldMinAlpha;
69  float oldMaxAlpha;
70  float oldFadeSpeed;
71  bool oldFadeStatus;
72  bool oldFontStatus;
73 
75  float currentMinAlpha;
76  float currentMaxAlpha;
77  float currentFadeSpeed;
78  bool currentFadeStatus;
79  bool currentFontStatus;
80 
82  pawsScrollBar* scrollBarMinAlpha;
83  pawsProgressBar* progressBarMinAlpha;
84 
86  pawsScrollBar* scrollBarMaxAlpha;
87  pawsProgressBar* progressBarMaxAlpha;
88 
90  pawsScrollBar* scrollBarFadeSpeed;
91  pawsProgressBar* progressBarFadeSpeed;
92 
94  pawsButton* buttonOK;
95  pawsButton* buttonCancel;
96  pawsButton* buttonApply;
97 
99  pawsCheckBox* checkboxFade;
100  pawsCheckBox* checkboxFont;
101 
103  pawsTextBox* textFadeStatus;
104  pawsTextBox* textFontStatus;
105  pawsTextBox* textMinAlphaPct; // min Alpha in %
106  pawsTextBox* textMaxAlphaPct; // max Alpha in %
107  pawsTextBox* textFadeSpeedPct; // current fade value in %
108 
110  pawsWidget* configWidget;
111 };
112 
114 
115 
118 #endif
void Close()
Overrides the pawsWidget Close() in order to restore settings and null out the widget being configure...
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
Shown when you right click on a window.
A combination widget that has a check box and a text label.
Definition: pawscheckbox.h:48
void restoreSettings()
Restores the settings of the widget being configured to their previous values.
bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
void SetConfigurableWidget(pawsWidget *w)
bool OnScroll(int direction, pawsScrollBar *widget)
Called whenever a window is scrolled.
bool PostSetup()
This is called after the widget and all of it's children have been created.
A simple scroll bar widget.
Definition: pawscrollbar.h:64
A simple button widget.
Definition: pawsbutton.h:43
virtual void Hide()
Makes widget invisible and removes focus if widget has current focus.
A basic text box widget.
Definition: pawstextbox.h:42
CREATE_PAWS_FACTORY(WidgetConfigWindow)