Advanced Strategic Command
weatherdialog.h
Go to the documentation of this file.
1 //
2 // C++ Interface: weatherdialog
3 //
4 // Description:
5 //
6 //
7 // Author: Martin Bickel <bickel@asc-hq.org>, (C) 2004
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef WEATHERDIALOG_H
13 #define WEATHERDIALOG_H
14 
15 #include <sstream>
16 #include "global.h"
17 #include "paradialog.h"
18 #include "weatherdialog.h"
19 #include "weatherarea.h"
20 #include "events.h"
21 #include "gameoptions.h"
22 #include "sdl/sound.h"
23 
28 public:
29  ChanceSettingsDialog(std::string title);
30 
31  virtual ~ChanceSettingsDialog();
32 
33  virtual bool closeWindow() {
34  quitModalLoop(2);
35  return true;
36  };
37 
38 protected:
39  virtual void buildUpForm(const vector<string>& labelVec);
40 private:
41  virtual bool buttonEvent( PG_Button* button ) = 0;
42  virtual int getNthChanceValue(int n) = 0;
43  virtual void setChanceValues(const vector<PG_LineEdit*>& p)= 0;
44 
45  protected:
46  vector<PG_LineEdit*> chances;
47  vector<PG_Label*> labels;
48  PG_Label* note;
49  static const int xsize;
50  static const int ysize;
51 };
52 
54 virtual int getNthChanceValue(int n);
55 virtual void setChanceValues(const vector<PG_LineEdit*>& p);
56 virtual bool buttonEvent( PG_Button* button );
57 
58 
59 public:
62 };
63 
65 virtual int getNthChanceValue(int n);
66 virtual void setChanceValues(const vector<PG_LineEdit*>& p);
67 virtual bool buttonEvent( PG_Button* button );
68 
69 
70 public:
73 };
74 
76 virtual int getNthChanceValue(int n);
77 virtual void setChanceValues(const vector<PG_LineEdit*>& p);
78 virtual bool buttonEvent( PG_Button* button );
79 
80 
81 public:
84 };
85 
87 private:
88  WeatherArea* weatherArea;
89  GameTime time;
90  int duration;
91  FalloutType fallOut;
92 public:
93  WeatherAreaInformation(WeatherArea* wa, GameTime time, int duration, FalloutType fallOut);
96 
97  GameTime getTriggerTime() const;
98  int getDuration() const;
101  return weatherArea;
102  }
103  std::string getInformation() const;
104 
105 };
107 
108 public:
112 
113 bool closeWindow();
114 
115 private:
116  static const int xSize;
117  static const int ySize;
118  static const string SEPARATOR;
119  list<WeatherAreaInformation*> currentList;
120  list<WeatherAreaInformation*> removeList;
121  list<WeatherAreaInformation*> addList;
122 
123  PG_ListBox* eventList;
124  PG_Button* addButton;
125  PG_Button* removeButton;
126  bool buttonEvent( PG_Button* button );
127 
128  bool buttonAdd( PG_Button* button );
129  bool buttonRemove( PG_Button* button );
130 
131  void updateAreaList();
132 };
133 
135 private:
136  WindData data;
137  int turn;
138 public:
139  WindInformation(WindData data, int turn);
141 
142  int getTurn() const;
143  WindData getWindData() const;
144  std::string getInformation() const;
145 
146 
147 };
148 
149 
151 
152 public:
156 
157 bool closeWindow();
158 
159 private:
160  static const int xSize;
161  static const int ySize;
162  static const string SEPARATOR;
163  list<WindInformation*> currentList;
164  list<WindInformation*> addList;
165 
166  PG_ListBox* eventList;
167  PG_Button* addButton;
168  PG_Button* removeButton;
169  bool buttonEvent( PG_Button* button );
170 
171  bool buttonAdd( PG_Button* button );
172  bool buttonRemove( PG_Button* button );
173 
174  void updateWindChangeList();
175 };
176 
178 public:
181 
182 
183 private:
184  static const int xSize;
185  static const int ySize;
186 
187  PG_Label* turnLabel;
188  PG_LineEdit* turnValue;
189 
190  PG_Label* directionLabel;
191  PG_DropDown* directionBox;
192 
193  PG_Label* speedLabel;
194  PG_LineEdit* speedValue;
195 
196  bool buttonEvent( PG_Button* button );
197  bool closeWindow();
198 };
199 
201 public:
204 
205 
206 private:
207  static const int xSize;
208  static const int ySize;
209 
210  PG_Label* turnLabel;
211  PG_LineEdit* turnValue;
212 
213  PG_Label* durationLabel;
214  PG_LineEdit* durationValue;
215 
216  PG_Label* xCoordLabel;
217  PG_LineEdit* xCoordValue;
218 
219  PG_Label* yCoordLabel;
220  PG_LineEdit* yCoordValue;
221 
222  PG_Label* widthLabel;
223  PG_LineEdit* widthValue;
224 
225  PG_Label* heightLabel;
226  PG_LineEdit* heightValue;
227 
228  PG_CheckButton* clusteredMode;
229 
230  PG_Label* wTypesLabel;
231  PG_DropDown* weatherTypes;
232 
233  bool closeWindow();
234  bool buttonEvent( PG_Button* button );
235 };
236 
237 
238 
239 
243 class WeatherDialog : public ASC_PG_Dialog {
244 public:
245  WeatherDialog();
246 
247  virtual ~WeatherDialog();
248 
249 
250 private:
251  static const int xsize;
252  static const int ysize;
253 
254  PG_CheckButton* randomMode;
255  PG_CheckButton* seedMode;
256 
257  PG_Label* defaultWeatherLabel;
258  PG_DropDown* weatherTypes;
259 
260  PG_Label* areaSpawnsLabel;
261  PG_LineEdit* areaSpawnsValue;
262 
263  PG_Label* nthTurnLabel;
264  PG_LineEdit* nthTurnValue;
265 
266  PG_Label* windSpeedFieldRatioLabel;
267  PG_LineEdit* windSpeedFieldRatioValue;
268 
269  PG_Label* upperSizeLimitsLabel;
270  PG_LineEdit* upperSizeLimitsValue;
271 
272  PG_Label* lowerSizeLimitsLabel;
273  PG_LineEdit* lowerSizeLimitsValue;
274 
275  PG_Label* lowerDurationLimitLabel;
276  PG_LineEdit* lowerDurationLimitValue;
277 
278  PG_Label* upperDurationLimitLabel;
279  PG_LineEdit* upperDurationLimitValue;
280 
281  PG_Label* fallOutLabel;
282  PG_Button* fallOutButton;
283 
284  PG_Label* windSpeedLabel;
285  PG_Button* windSpeedButton;
286 
287  PG_Label* windDirectionLabel;
288  PG_Button* windDirectionButton;
289 
290  PG_Label* eventAreasLabel;
291  PG_Button* eventAreasButton;
292 
293  PG_Label* eventWindChangesLabel;
294  PG_Button* eventWindChangesButton;
295 
296  bool editEventAreas(PG_Button* button );
297  bool editEventWindChanges(PG_Button* button );
298  bool editFallOut( PG_Button* button );
299  bool editWindSpeed( PG_Button* button );
300  bool editWindDirection( PG_Button* button );
301 
302  bool buttonEvent( PG_Button* button );
303 
304  bool closeWindow() {
305  quitModalLoop(2);
306  return true;
307  };
308 };
309 
310 extern void weatherConfigurationDialog();
311 
312 #endif
313 
314 
315 
the time in ASC, measured in turns and moves
Definition: typen.h:178
vector< PG_Label * > labels
Definition: weatherdialog.h:47
WeatherArea * getWeatherArea()
virtual ~ChanceSettingsDialog()
AddWindChangeDialog(EventWindChangesDialog *ead)
FalloutType getFalloutType() const
WeatherAreaInformation(WeatherArea *wa, GameTime time, int duration, FalloutType fallOut)
Global platform dependant definitions. This file just branches to the platform specific files in thei...
void weatherConfigurationDialog()
virtual bool closeWindow()
Definition: weatherdialog.h:33
virtual ~WeatherDialog()
WindData getWindData() const
FalloutType
Definition: weatherarea.h:94
ChanceSettingsDialog(std::string title)
bool quitModalLoop(int value)
Definition: paradialog.cpp:545
Adapter class for using Paragui Dialogs in ASC. This class transfers the event control from ASC to Pa...
Definition: paradialog.h:127
void addNewWindInformation(WindInformation *wi)
Dialog classes based on the Paragui library.
void addNewWeatherAreaInformation(WeatherAreaInformation *wai)
int getTurn() const
vector< PG_LineEdit * > chances
Definition: weatherdialog.h:46
static const int xsize
Definition: weatherdialog.h:49
WindInformation(WindData data, int turn)
GameTime getTriggerTime() const
AddWeatherAreaDialog(EventAreasDialog *ead)
virtual void buildUpForm(const vector< string > &labelVec)
std::string getInformation() const
std::string getInformation() const
static const int ysize
Definition: weatherdialog.h:50