Advanced Strategic Command
gamedialog.h
Go to the documentation of this file.
1 //
2 // C++ Interface: gamedialog
3 //
4 // Description:
5 //
6 //
7 // Author: Kevin Hirschmann <hirsch@dhcppc0>, (C) 2005
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef GAMEDIALOG_H
13 #define GAMEDIALOG_H
14 
15 #include "gameoptions.h"
16 #include "paradialog.h"
17 #include "pgmultilineedit.h"
18 #include "gamemap.h"
22 class GameDialog: public ASC_PG_Dialog{
23 public:
24 
25  ~GameDialog();
26 
27  static bool gameDialog();
28 protected:
29  bool eventKeyDown (const SDL_KeyboardEvent *key);
30 private:
31  static const int xSize;
32  static const int ySize;
33  static const int buttonIndent;
34  static GameDialog* instance;
35  PG_Button* singlePlayerButton;
36  PG_Button* multiPlayerButton;
37  PG_Button* loadGameButton;
38  PG_Button* saveGameButton;
39  PG_Button* optionsButton;
40  PG_Button* exitButton;
41  PG_Button* continueButton;
42 
43  GameDialog();
44 
45  bool closeWindow();
46  bool newGame(PG_Button* button);
47  bool singleGame(PG_Button* button);
48  bool multiGame(PG_Button* button);
49  bool saveGame(PG_Button* button);
50  bool loadGame(PG_Button* button);
51  bool showOptions(PG_Button* button);
52  bool exitGame(PG_Button* button);
53  bool supervise(PG_Button* button);
54 
55 
56 };
57 
58 
59 
61 public:
62  static void singlePlayerDialog(PG_MessageObject* caller);
63 
65 private:
66  static const int xSize;
67  static const int ySize;
68  static const int buttonIndent;
69  static SinglePlayerDialog* instance;
70 
71  PG_Button* campaignButton;
72  PG_Button* singleLevelButton;
73  PG_Button* cancelButton;
74 
75  SinglePlayerDialog(PG_MessageObject* parent);
76 
77  bool campaign(PG_Button* button);
78  bool singleLevel(PG_Button* button);
79  bool closeWindow();
80 };
81 
82 
83 
85 public:
86  static void multiPlayerDialog(PG_MessageObject* c);
88 private:
89  static const int xSize;
90  static const int ySize;
91  static const int buttonIndent;
92 
93  PG_Button* continueGameButton;
94  PG_Button* superViseButton;
95  PG_Button* setupNWButton;
96  PG_Button* changeMapPasswordButton;
97  PG_Button* cancelButton;
98 
99  MultiPlayerDialog(PG_MessageObject* c);
100 
101  bool continueGame(PG_Button* button);
102  bool superVise(PG_Button* button);
103  bool setupNWGame(PG_Button* button);
104  bool changeMapPassword(PG_Button* button);
105  bool closeWindow();
106 };
107 
108 
109 
111 public:
112  static void confirmExitDialog(PG_MessageObject* c);
113 
114 
116 private:
117  static const int xSize;
118  static const int ySize;
119 
120  PG_Button* okButton;
121  PG_Button* cancelButton;
122 
123  ConfirmExitDialog(PG_MessageObject* c);
124 
125  bool exitGame(PG_Button* button);
126  bool closeWindow();
127 };
128 
129 
130 
132 public:
133 
134  static void optionsDialog(PG_MessageObject* c);
135 
136  ~OptionsDialog();
137 private:
138  static const int xSize;
139  static const int ySize;
140  static const int buttonIndent;
141 
142  PG_Button* okButton;
143  PG_Button* soundButton;
144  PG_Button* mouseButton;
145  PG_Button* otherButton;
146  PG_Button* displayButton;
147 
148  OptionsDialog(PG_MessageObject* c);
149 
150  bool showSoundOptions(PG_Button* button);
151  bool showOtherOptions(PG_Button* button);
152  bool closeWindow();
153 };
154 
155 
156 
157 
159 public:
160  static void gameOptionsDialog(PG_MessageObject* c);
162 private:
163  static const int xSize;
164  static const int ySize;
165  static const int buttonIndent;
166 
167  PG_Label* autoAmmunitionLabel;
168  PG_CheckButton* autoAmmunitionCButton;
169 
170  PG_Label* autoUnitTrainingLabel;
171  PG_CheckButton* autoUnitTrainingCButton;
172 
173  PG_Label* promptEndOfTurnLabel;
174  PG_CheckButton* promptEndOfTurnCButton;
175 
176  PG_Button* okButton;
177  PG_Button* cancelButton;
178 
179  PG_Button* changePasswordButton;
180 
181  GameOptionsDialog(PG_MessageObject* c);
182 
183  bool changePassword(PG_Button* button);
184 
185  bool ok(PG_Button* button);
186  bool closeWindow();
187 };
188 
190  public:
191  virtual ~ChangePasswordDialog();
192 
193  protected:
194  PG_LineEdit* passwordValue;
195 
196  ChangePasswordDialog(PG_MessageObject* c);
197  private:
198  static const int xSize;
199  static const int ySize;
200  static const int buttonIndent;
201 
202  PG_Button* okButton;
203  PG_Button* cancelButton;
204  PG_Label* passwordLabel;
205 
206  virtual bool ok(PG_Button* button) = 0;
207 
208 
209 };
210 /*
211 class MousePreferencesDialog: public ASC_PG_Dialog{
212  public:
213  static void mousePreferencesDialog(PG_MessageObject* c);
214  virtual ~MousePreferencesDialog();
215 private:
216  static const int xSize;
217  static const int ySize;
218 
219  MousePreferencesDialog(PG_MessageObject* c);
220  bool ok(PG_Button* button);
221 };
222 */
223 
225 public:
226  static void changeDefaultPasswordDialog(PG_MessageObject* c);
228 private:
229  ChangeDefaultPasswordDialog(PG_MessageObject* c);
230  bool ok(PG_Button* button);
231 };
232 
234 public:
235  static void changeMapPasswordDialog(PG_MessageObject* c);
236  virtual ~ChangeMapPasswordDialog();
237 private:
238  ChangeMapPasswordDialog(PG_MessageObject* c);
239  bool ok(PG_Button* button);
240 };
241 
242 
244 public:
245 
246  virtual ~SaveGameBaseDialog();
247 
248 protected:
249 PG_LineEdit* fileNameValue;
250 PG_ScrollBar* slider;
251 PG_ListBox* fileList;
252 
253 SaveGameBaseDialog(const ASCString& title, PG_MessageObject* c);
254 
255 private:
256  static const int xSize;
257  static const int ySize;
258  static const int buttonIndent;
259 
260  PG_RadioButton* sortNameButton;
261  PG_RadioButton* sortDateButton;
262 
263  PG_Label* fileNameLabel;
264 
265  PG_Button* okButton;
266  PG_Button* cancelButton;
267 
268  virtual bool ok(PG_Button* button) = 0;
269  virtual bool handleSlider(long data);
270  virtual bool closeWindow();
271 };
272 
274 public:
275  static void saveGameDialog(PG_MessageObject* caller);
276 
277  virtual ~SaveGameDialog();
278 private:
279  SaveGameDialog(PG_MessageObject* caller);
280 
281  bool ok(PG_Button* button);
282 };
283 
284 #if 0
285 
286 class LoadGameDialog: public SaveGameBaseDialog{
287 public:
288 
289  static void loadGameDialog(PG_MessageObject* caller);
290 
291  virtual ~LoadGameDialog();
292 private:
293  LoadGameDialog(PG_MessageObject* caller);
294 
295  bool ok(PG_Button* button);
296 };
297 #endif
298 
299 
300 #endif
301 
static void changeDefaultPasswordDialog(PG_MessageObject *c)
Definition: gamedialog.cpp:603
PG_ScrollBar * slider
Definition: gamedialog.h:250
static void gameOptionsDialog(PG_MessageObject *c)
Definition: gamedialog.cpp:535
static void saveGameDialog(PG_MessageObject *caller)
Definition: gamedialog.cpp:778
PG_LineEdit * passwordValue
Definition: gamedialog.h:194
PG_MessageObject * caller
Definition: paradialog.h:131
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
static void multiPlayerDialog(PG_MessageObject *c)
Definition: gamedialog.cpp:406
static void confirmExitDialog(PG_MessageObject *c)
Definition: gamedialog.cpp:273
PG_ListBox * fileList
Definition: gamedialog.h:251
virtual ~ChangePasswordDialog()
Definition: gamedialog.cpp:571
static bool gameDialog()
Definition: gamedialog.cpp:224
static void singlePlayerDialog(PG_MessageObject *caller)
Definition: gamedialog.cpp:329
Adapter class for using Paragui Dialogs in ASC. This class transfers the event control from ASC to Pa...
Definition: paradialog.h:127
Definition of THE central asc class: GameMap.
virtual ~SaveGameBaseDialog()
Definition: gamedialog.cpp:751
Dialog classes based on the Paragui library.
ChangePasswordDialog(PG_MessageObject *c)
Definition: gamedialog.cpp:547
virtual ~ChangeMapPasswordDialog()
Definition: gamedialog.cpp:649
bool eventKeyDown(const SDL_KeyboardEvent *key)
Definition: gamedialog.cpp:86
virtual ~SaveGameDialog()
Definition: gamedialog.cpp:770
PG_LineEdit * fileNameValue
Definition: gamedialog.h:249
static void changeMapPasswordDialog(PG_MessageObject *c)
Definition: gamedialog.cpp:662
static void optionsDialog(PG_MessageObject *c)
Definition: gamedialog.cpp:469
virtual ~ChangeDefaultPasswordDialog()
Definition: gamedialog.cpp:590
SaveGameBaseDialog(const ASCString &title, PG_MessageObject *c)
Definition: gamedialog.cpp:675