Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MenuDlg.cpp
Go to the documentation of this file.
1 /* Project Starshatter 4.5
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: MenuDlg.cpp
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Main Menu Dialog Active Window class
13 */
14 
15 #include "MemDebug.h"
16 #include "MenuDlg.h"
17 #include "MenuScreen.h"
18 #include "Starshatter.h"
19 #include "Campaign.h"
20 
21 #include "Game.h"
22 #include "DataLoader.h"
23 #include "Button.h"
24 #include "ListBox.h"
25 #include "Slider.h"
26 #include "Video.h"
27 #include "Keyboard.h"
28 #include "Mouse.h"
29 #include "ParseUtil.h"
30 
31 // +--------------------------------------------------------------------+
32 // DECLARE MAPPING FUNCTIONS:
33 
34 DEF_MAP_CLIENT(MenuDlg, OnStart);
35 DEF_MAP_CLIENT(MenuDlg, OnCampaign);
36 DEF_MAP_CLIENT(MenuDlg, OnMission);
37 DEF_MAP_CLIENT(MenuDlg, OnPlayer);
38 DEF_MAP_CLIENT(MenuDlg, OnMultiplayer);
39 DEF_MAP_CLIENT(MenuDlg, OnMod);
40 DEF_MAP_CLIENT(MenuDlg, OnTacReference);
41 DEF_MAP_CLIENT(MenuDlg, OnVideo);
42 DEF_MAP_CLIENT(MenuDlg, OnOptions);
43 DEF_MAP_CLIENT(MenuDlg, OnControls);
44 DEF_MAP_CLIENT(MenuDlg, OnQuit);
45 DEF_MAP_CLIENT(MenuDlg, OnButtonEnter);
46 DEF_MAP_CLIENT(MenuDlg, OnButtonExit);
47 
48 extern const char* versionInfo;
49 
50 // +--------------------------------------------------------------------+
51 
53 : FormWindow(s, 0, 0, s->Width(), s->Height()),
54 manager(mgr), btn_start(0),
55 btn_campaign(0), btn_mission(0), btn_player(0), btn_multi(0),
56 btn_mod(0), btn_tac(0),
57 btn_options(0), btn_controls(0), btn_quit(0),
58 version(0), description(0), stars(0), campaign(0)
59 {
62 
63  Init(def);
64 }
65 
67 {
68 }
69 
70 // +--------------------------------------------------------------------+
71 
72 void
74 {
75  if (btn_start)
76  return;
77 
78  btn_start = (Button*) FindControl(120);
80  btn_mission = (Button*) FindControl(102);
81  btn_player = (Button*) FindControl(103);
82  btn_multi = (Button*) FindControl(104);
83  btn_video = (Button*) FindControl(111);
84  btn_options = (Button*) FindControl(112);
86  btn_quit = (Button*) FindControl(114);
87  btn_mod = (Button*) FindControl(115);
88  btn_tac = (Button*) FindControl(116);
89 
90  if (btn_start) {
94  }
95 
96  if (btn_campaign) {
100  }
101 
102  if (btn_mission) {
106  }
107 
108  if (btn_player) {
112  }
113 
114  if (btn_multi) {
118  }
119 
120  if (btn_video) {
124  }
125 
126  if (btn_options) {
130  }
131 
132  if (btn_controls) {
136  }
137 
138  if (btn_mod) {
142  }
143 
144  if (btn_tac) {
148  }
149 
150  if (btn_quit) {
154  }
155 
156  version = FindControl(100);
157 
158  if (version) {
160  }
161 
162  description = FindControl(202);
163 }
164 
165 // +--------------------------------------------------------------------+
166 
167 void
169 {
171 
173  btn_multi->SetEnabled(false);
174 }
175 
176 void
178 {
179 }
180 
181 // +--------------------------------------------------------------------+
182 
183 void
185 {
186  if (description) description->SetText("");
188 }
189 
190 void
192 {
193  if (description) description->SetText("");
195 }
196 
197 void
199 {
200  if (description) description->SetText("");
202 }
203 
204 void
206 {
207  if (description) description->SetText("");
209 }
210 
211 void
213 {
214  if (description) description->SetText("");
216 }
217 
218 void
220 {
221  if (description) description->SetText("");
222  manager->ShowVidDlg();
223 }
224 
225 void
227 {
228  if (description) description->SetText("");
229  manager->ShowOptDlg();
230 }
231 
232 void
234 {
235  if (description) description->SetText("");
236  manager->ShowCtlDlg();
237 }
238 
239 void
241 {
242  if (description) description->SetText("");
243  manager->ShowModDlg();
244 }
245 
246 void
248 {
249  if (description) description->SetText("");
251 }
252 
253 void
255 {
256  if (description) description->SetText("");
257  manager->ShowExitDlg();
258 }
259 
260 // +--------------------------------------------------------------------+
261 
262 void
264 {
265  ActiveWindow* src = event->window;
266 
267  if (src && description)
268  description->SetText(src->GetAltText());
269 }
270 
271 void
273 {
274  if (description)
275  description->SetText("");
276 }