Debian Codegraph @

Descent3/newui_core.cpp

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
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 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/newui_core.cpp $
21 * $Revision: 64 $
22 * $Date: 10/21/99 5:05p $
23 * $Author: Matt $
24 *
25 * <insert description of file here>
26 *
27 * $Log: /DescentIII/Main/newui_core.cpp $
28 *
29 * 64 10/21/99 5:05p Matt
30 * Mac merge
31 *
32 * 63 5/20/99 11:08p Samir
33 * better error checking when freeing resources, may do nothing, may fix a
34 * bug.
35 *
36 * 62 5/10/99 12:31a Samir
37 * listboxes don't quit when double clicked outside selected item.
38 *
39 * 61 5/08/99 11:20p Samir
40 * hotspots have different highlight effect.
41 *
42 * 60 5/08/99 1:06a Samir
43 * scrunch messagebox buttons closer together
44 *
45 * 59 5/06/99 1:24a Samir
46 * upped editbox maxlength to 512
47 *
48 * 58 5/05/99 10:53a Samir
49 * allow loading of 'error texture' bitmaps to determine missing data (and
50 * not to error out.)
51 *
52 * 57 5/02/99 7:28p Samir
53 * fixed a bunch of option button bugs and allow music in
54 * UIFrameWithoutInput for the menu mode.
55 *
56 * 56 5/02/99 2:14a Samir
57 * fixed a few issues with option buttons.
58 *
59 * 55 5/01/99 7:46p Samir
60 * oops. really bad if statement fixed, could fix crash bug.
61 *
62 * 54 5/01/99 1:14a Samir
63 * fixed mouse sequencing probs with selections being canceled out by
64 * UISystem.
65 *
66 * 53 4/30/99 10:53p Samir
67 * only accept double clicks inside of listbox
68 *
69 * 52 4/29/99 10:02p Samir
70 * fixed percent display for slider.
71 *
72 * 51 4/29/99 3:21a Samir
73 * reorganized main menu music to work in config, multiplayer, whereever.
74 *
75 * 50 4/29/99 2:18a Samir
76 * updated art for options style menu.
77 *
78 * 49 4/28/99 1:54a Samir
79 * visual tweaks to text
80 *
81 * 48 4/27/99 9:24a Matt
82 * Added system for drawing title bars on dialogs.
83 *
84 * 47 4/26/99 7:46p Samir
85 * newuiTiledWindow flags passed to create is an int now.
86 *
87 * 46 4/21/99 2:15p Samir
88 * table file filter fixes.
89 *
90 * 45 4/21/99 12:42p Samir
91 * change some communication betwen UIEdit and child classes.
92 *
93 * 44 4/21/99 10:58a Samir
94 * added changable text.
95 *
96 * 43 4/20/99 11:46a Samir
97 * numerous ui 'feel' fixes.
98 *
99 * 42 4/18/99 7:55p Samir
100 * fixed listbox double click and added functions to load and release
101 * pertinent newui graphic data.
102 *
103 * 41 4/15/99 5:28p Samir
104 * added advanced messagebox
105 *
106 * 40 4/05/99 5:40p Samir
107 * double clicking on an empty listbox wont return anything.
108 *
109 * 39 4/05/99 5:13p Samir
110 * fixed combo box asthetics.
111 *
112 * 38 4/05/99 10:40a Samir
113 * upped count of gadgets in titled window.
114 *
115 * 37 3/23/99 9:05p Samir
116 * took out redundant ddio_KeyFlush
117 *
118 * 36 3/22/99 1:55p Jeff
119 * fixed more crashes
120 *
121 * 35 3/22/99 12:47p Jeff
122 * oops...fixed some listbox crashes
123 *
124 * 34 3/19/99 9:21p Jeff
125 * fixed some listbox sorting issues
126 *
127 * 33 3/19/99 9:15p Jeff
128 * fixed some combo box things (Samir). Fixed sorting issues with
129 * listboxes/comboboxes if an item is added/removed before the selected
130 * index (Jeff)
131 *
132 * 32 3/17/99 11:46a Jeff
133 * added callback to set focus when a sheet is realized (Samir)
134 *
135 * 31 3/10/99 3:49p Samir
136 * indent hotspots after newline.
137 *
138 * 30 3/09/99 11:58a Samir
139 * converted buddy menu to new ui.
140 *
141 * 29 3/03/99 4:16a Samir
142 * added fix for DoEditDialog, setting focus on edit gadget by default for
143 * all sheets with editboxes (1st one.)
144 *
145 * 28 3/03/99 3:38a Samir
146 * made listbox highlight a little more tolerable.
147 *
148 * 27 3/01/99 8:51p Samir
149 * upped count of ui bitmaps.
150 *
151 * 26 3/01/99 7:29p Samir
152 * fixed an issue with slaves getting freed after their master was
153 * destroyed for sliders.
154 *
155 * 25 3/01/99 6:55p Samir
156 * fixed saturation problems with old ui text.
157 *
158 * 24 3/01/99 5:52p Samir
159 * fixed slider bars and added render distance.
160 *
161 * 23 3/01/99 4:39p Samir
162 * added mono_state and dual_state menu option buttons.
163 *
164 * 22 3/01/99 4:59a Samir
165 * added hotspots, combo boxes.
166 *
167 * 21 2/28/99 3:26a Samir
168 * editbox enhancements.
169 *
170 * 20 2/28/99 2:23a Jeff
171 * fixed sorting problem when calling GetCurrentItem
172 *
173 * 19 2/28/99 1:21a Jeff
174 * fixed cut & paste bug using slider-> instead of edit->
175 *
176 * 18 2/26/99 2:10a Samir
177 * fixed newuiTiledWindow so it realizes gadgets only when first started.
178 *
179 * 17 2/24/99 9:39p Jeff
180 * fixed listbox sorting
181 *
182 * $NoKeywords: $
183 */
184
185 #include <cstdarg>
186 #include <cstdio>
187
188 #include "newui_core.h"cxx . . $ `<file>/Descent3/newui_core.h`/
189 #include "bitmap.h"cxx . . $ `<file>/lib/bitmap.h`/
190 #include "mem.h"cxx . . $ `<file>/mem/mem.h`/
191 #include "pserror.h"cxx . . $ `<file>/misc/pserror.h`/
192 #include "game.h"cxx . . $ `<file>/Descent3/game.h`/
193 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
194 #include "renderer.h"cxx . . $ `<file>/lib/renderer.h`/
195 #include "descent.h"cxx . . $ `<file>/Descent3/descent.h`/
196 #include "application.h"cxx . . $ `<file>/lib/application.h`/
197 #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/
198 #include "gamefont.h"cxx . . $ `<file>/Descent3/gamefont.h`/
199 #include "textaux.h"cxx . . $ `<file>/lib/textaux.h`/
200 #include "d3music.h"cxx . . $ `<file>/Descent3/d3music.h`/
201 #include "hlsoundlib.h"cxx . . $ `<file>/sndlib/hlsoundlib.h`/
202
203 #include <string.h>
204
205 extern void ui_DoCursorcxx . . $ ui_DoCursor(49f6e7a06ebc5aa8).();
206
207 // filenames of ui bitmaps
208 /*
209 $$TABLE_GAMEFILE "LRGButton.ogf"
210 $$TABLE_GAMEFILE "LRGButtonLit.ogf"
211 $$TABLE_GAMEFILE "LongButton.ogf"
212 $$TABLE_GAMEFILE "LongButtonLit.ogf"
213 $$TABLE_GAMEFILE "SmallButton.ogf"
214 $$TABLE_GAMEFILE "SmallButtonLit.ogf"
215 $$TABLE_GAMEFILE "SmallButtonFramed.ogf"
216 $$TABLE_GAMEFILE "SmallButtonFramedLit.ogf"
217 $$TABLE_GAMEFILE "LongButtonRed.ogf"
218 $$TABLE_GAMEFILE "LongButtonLitRed.ogf"
219 $$TABLE_GAMEFILE "SmallButton.ogf"
220 $$TABLE_GAMEFILE "SmallButtonLitRed.ogf"
221 $$TABLE_GAMEFILE "Bar.ogf"
222 $$TABLE_GAMEFILE "MinusButton.ogf"
223 $$TABLE_GAMEFILE "MinusButtonLit.ogf"
224 $$TABLE_GAMEFILE "PluseButton.ogf"
225 $$TABLE_GAMEFILE "PluseButtonLit.ogf"
226 $$TABLE_GAMEFILE "UpArrow.ogf"
227 $$TABLE_GAMEFILE "UpArrowLit.ogf"
228 $$TABLE_GAMEFILE "DownArrow.ogf"
229 $$TABLE_GAMEFILE "DownArrowLit.ogf"
230 $$TABLE_GAMEFILE "TinyButton.ogf"
231 $$TABLE_GAMEFILE "TinyButtonLit.ogf"
232 $$TABLE_GAMEFILE "SmallScreen.ogf"
233 $$TABLE_GAMEFILE "MediumScreen.ogf"
234 $$TABLE_GAMEFILE "FullScreen.ogf"
235 $$TABLE_GAMEFILE "lbTop32.ogf"
236 $$TABLE_GAMEFILE "lbTopRight32.ogf"
237 $$TABLE_GAMEFILE "lbRight32.ogf"
238 $$TABLE_GAMEFILE "lbBottomRight32.ogf"
239 $$TABLE_GAMEFILE "lbBottom32.ogf"
240 $$TABLE_GAMEFILE "lbBottomLeft32.ogf"
241 $$TABLE_GAMEFILE "lbLeft32.ogf"
242 $$TABLE_GAMEFILE "lbTopLeft32.ogf"
243 $$TABLE_GAMEFILE "winTop32.ogf"
244 $$TABLE_GAMEFILE "winTopRight64.ogf"
245 $$TABLE_GAMEFILE "winRight32.ogf"
246 $$TABLE_GAMEFILE "winBottomRight64.ogf"
247 $$TABLE_GAMEFILE "winBottom32.ogf"
248 $$TABLE_GAMEFILE "winBottomLeft64.ogf"
249 $$TABLE_GAMEFILE "winLeft32.ogf"
250 $$TABLE_GAMEFILE "winTopLeft64.ogf"
251 $$TABLE_GAMEFILE "winCenter32.ogf"
252 $$TABLE_GAMEFILE "winTitleLeft32.ogf"
253 $$TABLE_GAMEFILE "winTitleCenter32.ogf"
254 $$TABLE_GAMEFILE "winTitleRight32.ogf"
255 $$TABLE_GAMEFILE "ComboBox.ogf"
256 $$TABLE_GAMEFILE "AltArrowUp.ogf"
257 $$TABLE_GAMEFILE "AltArrowUpLit.ogf"
258 $$TABLE_GAMEFILE "AltArrowDown.ogf"
259 $$TABLE_GAMEFILE "AltArrowDownLit.ogf"
260 */
261
262 #define N_NEWUI_BMPS_TOTALcxx . . $ `Descent3/newui_core.cpp:262:9`! 64
263
264 #define NEWUI_LRGBTN_FILEcxx . . $ `Descent3/newui_core.cpp:264:9`! "LRGButton.ogf"
265 #define NEWUI_LRGBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:265:9`! "LRGButtonLit.ogf"
266 #define NEWUI_LBTN_FILEcxx . . $ `Descent3/newui_core.cpp:266:9`! "LongButton.ogf"
267 #define NEWUI_LBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:267:9`! "LongButtonLit.ogf"
268 #define NEWUI_BTN_FILEcxx . . $ `Descent3/newui_core.cpp:268:9`! "SmallButton.ogf"
269 #define NEWUI_BTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:269:9`! "SmallButtonLit.ogf"
270 #define NEWUI_LBTNFRAMED_FILEcxx . . $ `Descent3/newui_core.cpp:270:9`! "LongButton.ogf"
271 #define NEWUI_LBTNLITFRAMED_FILEcxx . . $ `Descent3/newui_core.cpp:271:9`! "LongButtonLit.ogf"
272 #define NEWUI_BTNFRAMED_FILEcxx . . $ `Descent3/newui_core.cpp:272:9`! "SmallButtonFramed.ogf"
273 #define NEWUI_BTNLITFRAMED_FILEcxx . . $ `Descent3/newui_core.cpp:273:9`! "SmallButtonFramedLit.ogf"
274 #define NEWUI_LCHKBTN_FILEcxx . . $ `Descent3/newui_core.cpp:274:9`! "LongButtonRed.ogf"
275 #define NEWUI_LCHKBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:275:9`! "LongButtonLitRed.ogf"
276 #define NEWUI_CHKBTN_FILEcxx . . $ `Descent3/newui_core.cpp:276:9`! "SmallButton.ogf"
277 #define NEWUI_CHKBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:277:9`! "SmallButtonLitRed.ogf"
278 #define NEWUI_SLIDER_FILEcxx . . $ `Descent3/newui_core.cpp:278:9`! "Bar.ogf"
279 #define NEWUI_LARR_FILEcxx . . $ `Descent3/newui_core.cpp:279:9`! "MinusButton.ogf"
280 #define NEWUI_LARRLIT_FILEcxx . . $ `Descent3/newui_core.cpp:280:9`! "MinusButtonLit.ogf"
281 #define NEWUI_RARR_FILEcxx . . $ `Descent3/newui_core.cpp:281:9`! "PluseButton.ogf"
282 #define NEWUI_RARRLIT_FILEcxx . . $ `Descent3/newui_core.cpp:282:9`! "PluseButtonLit.ogf"
283 #define NEWUI_UARR_FILEcxx . . $ `Descent3/newui_core.cpp:283:9`! "UPArrow.ogf"
284 #define NEWUI_UARRLIT_FILEcxx . . $ `Descent3/newui_core.cpp:284:9`! "UPArrowLit.ogf"
285 #define NEWUI_DARR_FILEcxx . . $ `Descent3/newui_core.cpp:285:9`! "DownArrow.ogf"
286 #define NEWUI_DARRLIT_FILEcxx . . $ `Descent3/newui_core.cpp:286:9`! "DownArrowLit.ogf"
287 #define NEWUI_UARRCB_FILEcxx . . $ `Descent3/newui_core.cpp:287:9`! "AltArrowUp.ogf"
288 #define NEWUI_UARRLITCB_FILEcxx . . $ `Descent3/newui_core.cpp:288:9`! "AltArrowUpLit.ogf"
289 #define NEWUI_DARRCB_FILEcxx . . $ `Descent3/newui_core.cpp:289:9`! "AltArrowDown.ogf"
290 #define NEWUI_DARRLITCB_FILEcxx . . $ `Descent3/newui_core.cpp:290:9`! "AltArrowDownLit.ogf"
291 #define NEWUI_TINYBTN_FILEcxx . . $ `Descent3/newui_core.cpp:291:9`! "TinyButton.ogf"
292 #define NEWUI_TINYBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:292:9`! "TinyButtonLit.ogf"
293
294 #define NEWUI_MSGBOX_FILEcxx . . $ `Descent3/newui_core.cpp:294:9`! "SmallScreen.ogf"
295 #define NEWUI_MEDWIN_FILEcxx . . $ `Descent3/newui_core.cpp:295:9`! "MediumScreen.ogf"
296 #define NEWUI_LRGWIN_FILEcxx . . $ `Descent3/newui_core.cpp:296:9`! "FullScreen.ogf"
297
298 #define NEWUI_LB_N_FILEcxx . . $ `Descent3/newui_core.cpp:298:9`! "lbTop32.ogf"
299 #define NEWUI_LB_NE_FILEcxx . . $ `Descent3/newui_core.cpp:299:9`! "lbTopRight32.ogf"
300 #define NEWUI_LB_E_FILEcxx . . $ `Descent3/newui_core.cpp:300:9`! "lbRight32.ogf"
301 #define NEWUI_LB_SE_FILEcxx . . $ `Descent3/newui_core.cpp:301:9`! "lbBottomRight32.ogf"
302 #define NEWUI_LB_S_FILEcxx . . $ `Descent3/newui_core.cpp:302:9`! "lbBottom32.ogf"
303 #define NEWUI_LB_SW_FILEcxx . . $ `Descent3/newui_core.cpp:303:9`! "lbBottomLeft32.ogf"
304 #define NEWUI_LB_W_FILEcxx . . $ `Descent3/newui_core.cpp:304:9`! "lbLeft32.ogf"
305 #define NEWUI_LB_NW_FILEcxx . . $ `Descent3/newui_core.cpp:305:9`! "lbTopLeft32.ogf"
306
307 #define NEWUI_CB_FILEcxx . . $ `Descent3/newui_core.cpp:307:9`! "ComboBox.ogf"
308
309 #define NEWUI_WIN_N_FILEcxx . . $ `Descent3/newui_core.cpp:309:9`! "winTop32.ogf"
310 #define NEWUI_WIN_NE_FILEcxx . . $ `Descent3/newui_core.cpp:310:9`! "winTopRight64.ogf"
311 #define NEWUI_WIN_E_FILEcxx . . $ `Descent3/newui_core.cpp:311:9`! "winRight32.ogf"
312 #define NEWUI_WIN_SE_FILEcxx . . $ `Descent3/newui_core.cpp:312:9`! "winBottomRight64.ogf"
313 #define NEWUI_WIN_S_FILEcxx . . $ `Descent3/newui_core.cpp:313:9`! "winBottom32.ogf"
314 #define NEWUI_WIN_SW_FILEcxx . . $ `Descent3/newui_core.cpp:314:9`! "winBottomLeft64.ogf"
315 #define NEWUI_WIN_W_FILEcxx . . $ `Descent3/newui_core.cpp:315:9`! "winLeft32.ogf"
316 #define NEWUI_WIN_NW_FILEcxx . . $ `Descent3/newui_core.cpp:316:9`! "winTopLeft64.ogf"
317 #define NEWUI_WIN_C_FILEcxx . . $ `Descent3/newui_core.cpp:317:9`! "winCenter32.ogf"
318
319 #define NEWUI_WIN_TITLE_L_FILEcxx . . $ `Descent3/newui_core.cpp:319:9`! "winTitleLeft32.ogf"
320 #define NEWUI_WIN_TITLE_C_FILEcxx . . $ `Descent3/newui_core.cpp:320:9`! "winTitleCenter32.ogf"
321 #define NEWUI_WIN_TITLE_R_FILEcxx . . $ `Descent3/newui_core.cpp:321:9`! "winTitleRight32.ogf"
322
323 // used to position gadgets in a small screen
324 #define NEWUI_MSGBOX_BUTTONS_Xcxx . . $ `Descent3/newui_core.cpp:324:9`! 242
325 #define NEWUI_MSGBOX_BUTTONS_Ycxx . . $ `Descent3/newui_core.cpp:325:9`! 24
326 #define NEWUI_MSGBOX_BUTTONS_Hcxx . . $ `Descent3/newui_core.cpp:326:9`! 22
327 #define NEWUI_MSGBOX_BUTTONS_Y2cxx . . $ `Descent3/newui_core.cpp:327:9`! 16
328 #define NEWUI_MSGBOX_BUTTONS_H2cxx . . $ `Descent3/newui_core.cpp:328:9`! 20
329 #define NEWUI_MSGBOX_SHEET_Xcxx . . $ `Descent3/newui_core.cpp:329:9`! 22
330 #define NEWUI_MSGBOX_SHEET_Ycxx . . $ `Descent3/newui_core.cpp:330:9`! 30
331
332 // used to position gadgets in a medium screen
333 #define NEWUI_MEDWIN_OPTIONS_Xcxx . . $ `Descent3/newui_core.cpp:333:9`! 314
334 #define NEWUI_MEDWIN_OPTIONS_Ycxx . . $ `Descent3/newui_core.cpp:334:9`! 60
335 #define NEWUI_MEDWIN_OPTIONS_Wcxx . . $ `Descent3/newui_core.cpp:335:9`! 140
336 #define NEWUI_MEDWIN_OPTIONS_Hcxx . . $ `Descent3/newui_core.cpp:336:9`! 27
337 #define NEWUI_MEDWIN_SHEET_Xcxx . . $ `Descent3/newui_core.cpp:337:9`! 28
338 #define NEWUI_MEDWIN_SHEET_Ycxx . . $ `Descent3/newui_core.cpp:338:9`! 40
339 #define NEWUI_MEDWIN_TITLE_Xcxx . . $ `Descent3/newui_core.cpp:339:9`! 90
340 #define NEWUI_MEDWIN_TITLE_Ycxx . . $ `Descent3/newui_core.cpp:340:9`! 13
341 #define NEWUI_MEDWIN_TITLE_Wcxx . . $ `Descent3/newui_core.cpp:341:9`! 125
342
343 // used to position gadgets in a large screen
344 #define NEWUI_LRGWIN_OPTIONS_Xcxx . . $ `Descent3/newui_core.cpp:344:9`! 35
345 #define NEWUI_LRGWIN_OPTIONS_Ycxx . . $ `Descent3/newui_core.cpp:345:9`! 415
346 #define NEWUI_LRGWIN_OPTIONS_Wcxx . . $ `Descent3/newui_core.cpp:346:9`! 132
347 #define NEWUI_LRGWIN_OPTIONS_Hcxx . . $ `Descent3/newui_core.cpp:347:9`! 27
348 #define NEWUI_LRGWIN_SHEET_Xcxx . . $ `Descent3/newui_core.cpp:348:9`! 40
349 #define NEWUI_LRGWIN_SHEET_Ycxx . . $ `Descent3/newui_core.cpp:349:9`! 50
350 #define NEWUI_LRGWIN_TITLE_Xcxx . . $ `Descent3/newui_core.cpp:350:9`! 40
351 #define NEWUI_LRGWIN_TITLE_Ycxx . . $ `Descent3/newui_core.cpp:351:9`! 30
352
353 // used to define tiled window dims
354 #define NEWUI_TILED_SHEET_Xcxx . . $ `Descent3/newui_core.cpp:354:9`! 40
355 #define NEWUI_TILED_SHEET_Ycxx . . $ `Descent3/newui_core.cpp:355:9`! 50
356 #define NEWUI_TILED_TITLE_Xcxx . . $ `Descent3/newui_core.cpp:356:9`! 40
357 #define NEWUI_TILED_TITLE_Ycxx . . $ `Descent3/newui_core.cpp:357:9`! 30
358
359 // newuiListbox constants.
360 #define LB_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:360:9`! 32
361 #define LB_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:361:9`! 32
362
363 // newuiTiledWindow constants.
364 #define TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`! 32
365 #define TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`! 32
366 #define TW_CORNER_WIDTHcxx . . $ `Descent3/newui_core.cpp:366:9`! 64
367 #define TW_CORNER_HEIGHTcxx . . $ `Descent3/newui_core.cpp:367:9`! 64
368
369 // newuiEdit constants
370 #define EDIT_GADGET_WIDTHcxx . . $ `Descent3/newui_core.cpp:370:9`! 192
371 #define EDIT_GADGET_HEIGHTcxx . . $ `Descent3/newui_core.cpp:371:9`! 12
372 #define EDIT_BUFLEN_MAXcxx . . $ `Descent3/newui_core.cpp:372:9`! 1025 // DAJ utb 512
373
374 // CLASS newui resource manager
375
376 class newuiResourcescxx . . $ newuiResources# {
377 struct t_bmp_listcxx . . $ newuiResources#t_bmp_list# {
378 unioncxx . . $ newuiResources#t_bmp_list#$anonymous_type_0# {
379 int bm_handlecxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#bm_handle.;
380 chunked_bitmapcxx . . $ chunked_bitmap# chunkcxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#chunk.;
381 };
382 int16_tcxx . . $ int16_t# chunkedcxx . . $ newuiResources#t_bmp_list#chunked.; // is it a bitmap handle or chunk
383 int16_tcxx . . $ int16_t# n_countcxx . . $ newuiResources#t_bmp_list#n_count.;
384 char *filenamecxx . . $ newuiResources#t_bmp_list#filename.; // filename of bitmap.
385 } m_listcxx . . $ newuiResources#m_list.[N_NEWUI_BMPS_TOTALcxx . . $ `Descent3/newui_core.cpp:262:9`!]; // list of bitmaps.
386
387 public:
388 newuiResourcescxx . . $ newuiResources#newuiResources(49f6e7a06ebc5aa8).();
389
390 bool Initcxx . . $ newuiResources#Init(c9857a73d68e59ba).(); // initializes list
391 void Shutdowncxx . . $ newuiResources#Shutdown(49f6e7a06ebc5aa8).(); // frees memory
392
393 // loads bitmap and returns the object
394 UIBitmapItemcxx . . $ UIBitmapItem# *Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(const char *filename);
395
396 // frees memory for bitmap object.
397 void Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(UIBitmapItemcxx . . $ UIBitmapItem# *bmitem);
398 };
399
400 // CLASS creates an arrow button that is sensitive to touch (when down, always select)
401
402 // CLASS a new check box: note that newuiButton and UICheckBox will share the same UIButton base
403 // since bott newuiButton and UICheckBox inherit UIButton virtually.
404
405 class newuiCheckBoxcxx . . $ newuiCheckBox# : public newuiButtoncxx . . $ newuiButton#, public UICheckBoxcxx . . $ UICheckBox# {
406 public:
407 newuiCheckBoxcxx . . $ newuiCheckBox#newuiCheckBox(49f6e7a06ebc5aa8).();
408
409 void Createcxx . . $ newuiCheckBox#Create(88ee86519b70f83b).(UIWindowcxx . . $ UIWindow# *wnd, int16_tcxx . . $ int16_t# id, const char *name, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, bool is_long = false);
410
411 protected:
412 virtual void OnDrawcxx . . $ newuiCheckBox#OnDraw(49f6e7a06ebc5aa8).(); // this will use the newuiButton drawing scheme
413 virtual void OnDestroycxx . . $ newuiCheckBox#OnDestroy(49f6e7a06ebc5aa8).() { newuiButtoncxx . . $ newuiButton#::OnDestroycxx . . $ newuiButton#OnDestroy(49f6e7a06ebc5aa8).(); };
414 virtual void OnFormatcxx . . $ newuiCheckBox#OnFormat(49f6e7a06ebc5aa8).() { newuiButtoncxx . . $ newuiButton#::OnFormatcxx . . $ newuiButton#OnFormat(49f6e7a06ebc5aa8).(); };
415 virtual void OnKeyDowncxx . . $ newuiCheckBox#OnKeyDown(d4f767463ce0a6b3).(int key) { UICheckBoxcxx . . $ UICheckBox#::OnKeyDowncxx . . $ UICheckBox#OnKeyDown(d4f767463ce0a6b3).(key); };
416 virtual void OnKeyUpcxx . . $ newuiCheckBox#OnKeyUp(d4f767463ce0a6b3).(int key) { UICheckBoxcxx . . $ UICheckBox#::OnKeyUpcxx . . $ UICheckBox#OnKeyUp(d4f767463ce0a6b3).(key); };
417 virtual void OnMouseBtnDowncxx . . $ newuiCheckBox#OnMouseBtnDown(d4f767463ce0a6b3).(int btn) { UICheckBoxcxx . . $ UICheckBox#::OnMouseBtnDowncxx . . $ UICheckBox#OnMouseBtnDown(d4f767463ce0a6b3).(btn); };
418 virtual void OnMouseBtnUpcxx . . $ newuiCheckBox#OnMouseBtnUp(d4f767463ce0a6b3).(int btn) { UICheckBoxcxx . . $ UICheckBox#::OnMouseBtnUpcxx . . $ UICheckBox#OnMouseBtnUp(d4f767463ce0a6b3).(btn); };
419 virtual void OnLostFocuscxx . . $ newuiCheckBox#OnLostFocus(49f6e7a06ebc5aa8).() { newuiButtoncxx . . $ newuiButton#::OnLostFocuscxx . . $ newuiButton#OnLostFocus(49f6e7a06ebc5aa8).(); };
420 virtual void OnGainFocuscxx . . $ newuiCheckBox#OnGainFocus(49f6e7a06ebc5aa8).() { newuiButtoncxx . . $ newuiButton#::OnGainFocuscxx . . $ newuiButton#OnGainFocus(49f6e7a06ebc5aa8).(); };
421 };
422
423 class newuiRadioButtoncxx . . $ newuiRadioButton# : public newuiButtoncxx . . $ newuiButton#, public UIRadioButtoncxx . . $ UIRadioButton# {
424 public:
425 newuiRadioButtoncxx . . $ newuiRadioButton#newuiRadioButton(49f6e7a06ebc5aa8).();
426
427 void Createcxx . . $ newuiRadioButton#Create(7778cd589e48544c).(UIWindowcxx . . $ UIWindow# *wnd, UIRadioButtoncxx . . $ UIRadioButton# *prev_rb, int16_tcxx . . $ int16_t# id, const char *name, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y,
428 bool is_long = false);
429
430 protected:
431 virtual void OnDrawcxx . . $ newuiRadioButton#OnDraw(49f6e7a06ebc5aa8).(); // this will use the newuiButton drawing scheme
432 virtual void OnDestroycxx . . $ newuiRadioButton#OnDestroy(49f6e7a06ebc5aa8).() { newuiButtoncxx . . $ newuiButton#::OnDestroycxx . . $ newuiButton#OnDestroy(49f6e7a06ebc5aa8).(); };
433 virtual void OnFormatcxx . . $ newuiRadioButton#OnFormat(49f6e7a06ebc5aa8).() { newuiButtoncxx . . $ newuiButton#::OnFormatcxx . . $ newuiButton#OnFormat(49f6e7a06ebc5aa8).(); };
434 virtual void OnKeyDowncxx . . $ newuiRadioButton#OnKeyDown(d4f767463ce0a6b3).(int key) { UIRadioButtoncxx . . $ UIRadioButton#::OnKeyDowncxx . . $ UIRadioButton#OnKeyDown(d4f767463ce0a6b3).(key); };
435 virtual void OnKeyUpcxx . . $ newuiRadioButton#OnKeyUp(d4f767463ce0a6b3).(int key) { UIRadioButtoncxx . . $ UIRadioButton#::OnKeyUpcxx . . $ UIRadioButton#OnKeyUp(d4f767463ce0a6b3).(key); };
436 virtual void OnMouseBtnDowncxx . . $ newuiRadioButton#OnMouseBtnDown(d4f767463ce0a6b3).(int btn) { UIRadioButtoncxx . . $ UIRadioButton#::OnMouseBtnDowncxx . . $ UIRadioButton#OnMouseBtnDown(d4f767463ce0a6b3).(btn); };
437 virtual void OnMouseBtnUpcxx . . $ newuiRadioButton#OnMouseBtnUp(d4f767463ce0a6b3).(int btn) { UIRadioButtoncxx . . $ UIRadioButton#::OnMouseBtnUpcxx . . $ UIRadioButton#OnMouseBtnUp(d4f767463ce0a6b3).(btn); };
438 virtual void OnLostFocuscxx . . $ newuiRadioButton#OnLostFocus(49f6e7a06ebc5aa8).() { newuiButtoncxx . . $ newuiButton#::OnLostFocuscxx . . $ newuiButton#OnLostFocus(49f6e7a06ebc5aa8).(); };
439 virtual void OnGainFocuscxx . . $ newuiRadioButton#OnGainFocus(49f6e7a06ebc5aa8).() { newuiButtoncxx . . $ newuiButton#::OnGainFocuscxx . . $ newuiButton#OnGainFocus(49f6e7a06ebc5aa8).(); };
440 };
441
442 // CLASS a new slider.
443
444 #define SUBGADGET_LEFTcxx . . $ `Descent3/newui_core.cpp:444:9`! 0x1
445 #define SUBGADGET_RIGHTcxx . . $ `Descent3/newui_core.cpp:445:9`! 0x2
446
447 class newuiSlidercxx . . $ newuiSlider# : public UIGadgetcxx . . $ UIGadget# {
448 int16_tcxx . . $ int16_t# m_poscxx . . $ newuiSlider#m_pos.;
449 int16_tcxx . . $ int16_t# m_unitrangecxx . . $ newuiSlider#m_unitrange.;
450 UIBitmapItemcxx . . $ UIBitmapItem# *m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp.;
451 UISnazzyTextItemcxx . . $ UISnazzyTextItem# *m_titlecxx . . $ newuiSlider#m_title.;
452 newuiArrowButtoncxx . . $ newuiArrowButton# m_minus_btncxx . . $ newuiSlider#m_minus_btn.;
453 newuiArrowButtoncxx . . $ newuiArrowButton# m_plus_btncxx . . $ newuiSlider#m_plus_btn.;
454 tSliderSettingscxx . . $ tSliderSettings# m_unit_settingscxx . . $ newuiSlider#m_unit_settings.;
455
456 public:
457 newuiSlidercxx . . $ newuiSlider#newuiSlider(49f6e7a06ebc5aa8).();
458
459 void Createcxx . . $ newuiSlider#Create(6c82988af4899650).(UIWindowcxx . . $ UIWindow# *wnd, int16_tcxx . . $ int16_t# id, const char *name, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, int16_tcxx . . $ int16_t# range);
460 void Offsetcxx . . $ newuiSlider#Offset(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# offs);
461 void SetPoscxx . . $ newuiSlider#SetPos(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# pos);
462 void SetRangecxx . . $ newuiSlider#SetRange(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# range);
463 int16_tcxx . . $ int16_t# GetPoscxx . . $ newuiSlider#GetPos(524863554b4a534e).() const { return m_poscxx . . $ newuiSlider#m_pos.; };
464 int16_tcxx . . $ int16_t# GetRangecxx . . $ newuiSlider#GetRange(524863554b4a534e).() const { return m_unitrangecxx . . $ newuiSlider#m_unitrange.; };
465 void SetUnitscxx . . $ newuiSlider#SetUnits(4353f1a13209e2eb).(tSliderSettingscxx . . $ tSliderSettings# *settings);
466
467 protected:
468 virtual void OnFormatcxx . . $ newuiSlider#OnFormat(49f6e7a06ebc5aa8).(); // override: called when resized or before drawing.
469 virtual void OnLostFocuscxx . . $ newuiSlider#OnLostFocus(49f6e7a06ebc5aa8).(); // override: behavior when gadget loses input focus.
470 virtual void OnGainFocuscxx . . $ newuiSlider#OnGainFocus(49f6e7a06ebc5aa8).(); // override: behavior when gadget gains input focus.
471 virtual void OnDrawcxx . . $ newuiSlider#OnDraw(49f6e7a06ebc5aa8).(); // behavior when gadget is being drawn.
472 virtual void OnDestroycxx . . $ newuiSlider#OnDestroy(49f6e7a06ebc5aa8).(); // behavior when gadget is being destroyed.
473 virtual void OnNotifySelectcxx . . $ newuiSlider#OnNotifySelect(627f6e6cf27f18b7).(UIGadgetcxx . . $ UIGadget# *g); // this function will handle when an arrow button was pressed
474 virtual void OnKeyDowncxx . . $ newuiSlider#OnKeyDown(d4f767463ce0a6b3).(int btn); // override: behavior when key pressed.
475 virtual void OnKeyUpcxx . . $ newuiSlider#OnKeyUp(d4f767463ce0a6b3).(int btn); // override: behavior when key released.
476 virtual void OnAttachToWindowcxx . . $ newuiSlider#OnAttachToWindow(49f6e7a06ebc5aa8).(); // when gadget is added to a window (AddGadget is called)
477 virtual void OnDetachFromWindowcxx . . $ newuiSlider#OnDetachFromWindow(49f6e7a06ebc5aa8).(); // when gadget is detached from window
478 };
479
480 // CLASS newuiEditBox
481
482 class newuiEditBoxcxx . . $ newuiEditBox# : public UIEditcxx . . $ UIEdit# {
483 public:
484 newuiEditBoxcxx . . $ newuiEditBox#newuiEditBox(49f6e7a06ebc5aa8).();
485
486 void Createcxx . . $ newuiEditBox#Create(3c6611c2642a6f36).(UIWindowcxx . . $ UIWindow# *wnd, int16_tcxx . . $ int16_t# id, const char *name, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, int16_tcxx . . $ int16_t# w, int16_tcxx . . $ int16_t# flags);
487 void EnableOnQuickEscapeBehaviorcxx . . $ newuiEditBox#EnableOnQuickEscapeBehavior(b45ddcbc8423892c).(bool do_it);
488
489 protected:
490 virtual void OnDrawcxx . . $ newuiEditBox#OnDraw(49f6e7a06ebc5aa8).();
491 virtual void OnDestroycxx . . $ newuiEditBox#OnDestroy(49f6e7a06ebc5aa8).();
492 virtual void OnKeyDowncxx . . $ newuiEditBox#OnKeyDown(d4f767463ce0a6b3).(int key);
493
494 private:
495 UISnazzyTextItemcxx . . $ UISnazzyTextItem# *m_titlecxx . . $ newuiEditBox#m_title.;
496 bool m_quick_escape_enablecxx . . $ newuiEditBox#m_quick_escape_enable.;
497 };
498
499 static inline UISnazzyTextItemcxx . . $ UISnazzyTextItem# *MonitorSmallTextcxx . . $ MonitorSmallText(a7872db8a769bd23).(const char *text) {
500 return new UISnazzyTextItemcxx . . $ UISnazzyTextItem#(0, MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, text, NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!);
501 }
502
503 static inline UISnazzyTextItemcxx . . $ UISnazzyTextItem# *MonitorLargeTextcxx . . $ MonitorLargeText(a7872db8a769bd23).(const char *text) {
504 return new UISnazzyTextItemcxx . . $ UISnazzyTextItem#(0, MONITOR15_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:116:9`!, text, NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!);
505 }
506
507 static inline UISnazzyTextItemcxx . . $ UISnazzyTextItem# *GadgetSmallTextcxx . . $ GadgetSmallText(a7872db8a769bd23).(const char *text) {
508 return new UISnazzyTextItemcxx . . $ UISnazzyTextItem#(0, GADGET9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:117:9`!, text, NEWUI_GADGETFONT_COLORcxx . . $ `Descent3/newui_core.h:71:9`!);
509 }
510
511 static inline UISnazzyTextItemcxx . . $ UISnazzyTextItem# *GadgetLargeTextcxx . . $ GadgetLargeText(a7872db8a769bd23).(const char *text) {
512 return new UISnazzyTextItemcxx . . $ UISnazzyTextItem#(0, GADGET15_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:118:9`!, text, NEWUI_GADGETFONT_COLORcxx . . $ `Descent3/newui_core.h:71:9`!);
513 }
514
515 //////////////////////////////////////////////////////////////////////////////
516 // DATA
517 static const char *Preloaded_bitmap_listcxx . . $ Preloaded_bitmap_list.[] = {
518 NEWUI_LRGBTN_FILEcxx . . $ `Descent3/newui_core.cpp:264:9`!, // common buttons
519 NEWUI_LRGBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:265:9`!, NEWUI_LBTN_FILEcxx . . $ `Descent3/newui_core.cpp:266:9`!, NEWUI_LBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:267:9`!, NEWUI_BTN_FILEcxx . . $ `Descent3/newui_core.cpp:268:9`!,
520 NEWUI_BTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:269:9`!, NEWUI_LCHKBTN_FILEcxx . . $ `Descent3/newui_core.cpp:274:9`!, NEWUI_LCHKBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:275:9`!, NEWUI_CHKBTN_FILEcxx . . $ `Descent3/newui_core.cpp:276:9`!,
521 NEWUI_CHKBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:277:9`!, NEWUI_TINYBTN_FILEcxx . . $ `Descent3/newui_core.cpp:291:9`!, NEWUI_TINYBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:292:9`!,
522 NEWUI_MSGBOX_FILEcxx . . $ `Descent3/newui_core.cpp:294:9`!, // window frames
523 NEWUI_MEDWIN_FILEcxx . . $ `Descent3/newui_core.cpp:295:9`!, NEWUI_LRGWIN_FILEcxx . . $ `Descent3/newui_core.cpp:296:9`!,
524 NEWUI_LB_N_FILEcxx . . $ `Descent3/newui_core.cpp:298:9`!, // listbox frame
525 NEWUI_LB_NE_FILEcxx . . $ `Descent3/newui_core.cpp:299:9`!, NEWUI_LB_E_FILEcxx . . $ `Descent3/newui_core.cpp:300:9`!, NEWUI_LB_SE_FILEcxx . . $ `Descent3/newui_core.cpp:301:9`!, NEWUI_LB_S_FILEcxx . . $ `Descent3/newui_core.cpp:302:9`!,
526 NEWUI_LB_SW_FILEcxx . . $ `Descent3/newui_core.cpp:303:9`!, NEWUI_LB_W_FILEcxx . . $ `Descent3/newui_core.cpp:304:9`!, NEWUI_LB_NW_FILEcxx . . $ `Descent3/newui_core.cpp:305:9`!,
527 NEWUI_WIN_N_FILEcxx . . $ `Descent3/newui_core.cpp:309:9`!, // tiled window frames
528 NEWUI_WIN_NE_FILEcxx . . $ `Descent3/newui_core.cpp:310:9`!, NEWUI_WIN_E_FILEcxx . . $ `Descent3/newui_core.cpp:311:9`!, NEWUI_WIN_SE_FILEcxx . . $ `Descent3/newui_core.cpp:312:9`!, NEWUI_WIN_S_FILEcxx . . $ `Descent3/newui_core.cpp:313:9`!,
529 NEWUI_WIN_SW_FILEcxx . . $ `Descent3/newui_core.cpp:314:9`!, NEWUI_WIN_W_FILEcxx . . $ `Descent3/newui_core.cpp:315:9`!, NEWUI_WIN_NW_FILEcxx . . $ `Descent3/newui_core.cpp:316:9`!, NEWUI_WIN_C_FILEcxx . . $ `Descent3/newui_core.cpp:317:9`!,
530 NEWUI_WIN_TITLE_L_FILEcxx . . $ `Descent3/newui_core.cpp:319:9`!, NEWUI_WIN_TITLE_C_FILEcxx . . $ `Descent3/newui_core.cpp:320:9`!, NEWUI_WIN_TITLE_R_FILEcxx . . $ `Descent3/newui_core.cpp:321:9`!,
531 };
532
533 #define N_UI_PRELOADED_BITMAPScxx . . $ `Descent3/newui_core.cpp:533:9`! (sizeof(Preloaded_bitmap_list) / sizeof(const char *))
534
535 int UI_frame_resultcxx . . $ UI_frame_result. = -1;
536 static newuiResourcescxx . . $ newuiResources# Newui_resourcescxx . . $ Newui_resources.;
537 static void (*UI_callbackcxx . . $ UI_callback.)() = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
538 static UIBitmapItemcxx . . $ UIBitmapItem# *Preloaded_bitmapscxx . . $ Preloaded_bitmaps.[N_UI_PRELOADED_BITMAPScxx . . $ `Descent3/newui_core.cpp:533:9`!] = {
539 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!,
540 };
541
542 #ifndef MULTI_H
543 extern bool Multi_bail_ui_menucxx . . $ Multi_bail_ui_menu.;
544 #endif
545
546 void SimpleUICallbackcxx . . $ SimpleUICallback(49f6e7a06ebc5aa8).();
547
548 //////////////////////////////////////////////////////////////////////////////
549 // initializes the core system for the newui
550
551 void newuiCore_Initcxx . . $ newuiCore_Init(49f6e7a06ebc5aa8).() { Newui_resourcescxx . . $ Newui_resources..Initcxx . . $ newuiResources#Init(c9857a73d68e59ba).(); }
552
553 // initializes the core system for the newui
554 void newuiCore_Closecxx . . $ newuiCore_Close(49f6e7a06ebc5aa8).() { Newui_resourcescxx . . $ Newui_resources..Shutdowncxx . . $ newuiResources#Shutdown(49f6e7a06ebc5aa8).(); }
555
556 // C interface to load and free bitmap resources
557 UIBitmapItemcxx . . $ UIBitmapItem# *newui_LoadBitmapcxx . . $ newui_LoadBitmap(9af3ea6534c90d0f).(const char *filename) { return Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(filename); }
558
559 // C interface to load and free bitmap resources
560 void newui_FreeBitmapcxx . . $ newui_FreeBitmap(4dc4c37c6aa93e7c).(UIBitmapItemcxx . . $ UIBitmapItem# *bmitem) { Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(bmitem); }
561
562 // touches all newui bitmaps, do before any newui menus open
563 void newuiCore_PageInBitmapscxx . . $ newuiCore_PageInBitmaps(49f6e7a06ebc5aa8).() {
564 int i;
565
566 if (Preloaded_bitmapscxx . . $ Preloaded_bitmaps.[0]) {
567 Int3cxx . . $ `misc/pserror.h:247:9`!(); // we've already paged in stuff!
568 return;
569 }
570
571 for (i = 0; i < N_UI_PRELOADED_BITMAPScxx . . $ `Descent3/newui_core.cpp:533:9`!; i++) {
572 Preloaded_bitmapscxx . . $ Preloaded_bitmaps.[i] = newui_LoadBitmapcxx . . $ newui_LoadBitmap(9af3ea6534c90d0f).(Preloaded_bitmap_listcxx . . $ Preloaded_bitmap_list.[i]);
573 }
574 }
575
576 // call when NO newui menus open
577 void newuiCore_ReleaseBitmapscxx . . $ newuiCore_ReleaseBitmaps(49f6e7a06ebc5aa8).() {
578 int i;
579
580 if (!Preloaded_bitmapscxx . . $ Preloaded_bitmaps.[0]) {
581 Int3cxx . . $ `misc/pserror.h:247:9`!(); // we've already freed paged in stuff!
582 return;
583 }
584
585 for (i = 0; i < N_UI_PRELOADED_BITMAPScxx . . $ `Descent3/newui_core.cpp:533:9`!; i++) {
586 newui_FreeBitmapcxx . . $ newui_FreeBitmap(4dc4c37c6aa93e7c).(Preloaded_bitmapscxx . . $ Preloaded_bitmaps.[i]);
587 Preloaded_bitmapscxx . . $ Preloaded_bitmaps.[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
588 }
589 }
590
591 // does a UI loop
592 //
593
594 int DoUIcxx . . $ DoUI(b126dc7c1de90089).() {
595 // this should poll UI_frame_result.
596 UI_frame_resultcxx . . $ UI_frame_result. = -1;
597 ui_ShowCursorcxx . . $ ui_ShowCursor(c9857a73d68e59ba).();
598 ui_Flushcxx . . $ ui_Flush(49f6e7a06ebc5aa8).();
599
600 while (UI_frame_resultcxx . . $ UI_frame_result. == -1) {
601 Descentcxx . . $ Descent.->defercxx . . $ oeApplication#defer(db52760e79bf9054).();
602 DoUIFramecxx . . $ DoUIFrame(49f6e7a06ebc5aa8).();
603 rend_Flipcxx . . $ rend_Flip(49f6e7a06ebc5aa8).();
604 }
605
606 ui_HideCursorcxx . . $ ui_HideCursor(c9857a73d68e59ba).();
607 ui_Flushcxx . . $ ui_Flush(49f6e7a06ebc5aa8).();
608
609 return UI_frame_resultcxx . . $ UI_frame_result.;
610 }
611
612 // does one frame of ui.
613 void DoUIFramecxx . . $ DoUIFrame(49f6e7a06ebc5aa8).() {
614 if (Multi_bail_ui_menucxx . . $ Multi_bail_ui_menu.) {
615 UI_frame_resultcxx . . $ UI_frame_result. = NEWUIRES_FORCEQUITcxx . . $ `Descent3/newui_core.h:131:9`!;
616 } else {
617 if (UI_callbackcxx . . $ UI_callback.)
618 (*UI_callbackcxx . . $ UI_callback.)();
619
620 if (GetFunctionModecxx . . $ GetFunctionMode(4270339a2fa9f0f5).() == MENU_MODEcxx . . $ MENU_MODE.) {
621 tMusicSeqInfocxx . . $ tMusicSeqInfo# music_info;
622
623 Sound_systemcxx . . $ Sound_system..BeginSoundFramecxx . . $ hlsSystem#BeginSoundFrame(b45ddcbc8423892c).(false);
624
625 music_info.frametimecxx . . $ tMusicSeqInfo#frametime. = UIFrameTimecxx . . $ UIFrameTime.;
626 music_info.player_deadcxx . . $ tMusicSeqInfo#player_dead. = false;
627 music_info.started_levelcxx . . $ tMusicSeqInfo#started_level. = false;
628 D3MusicDoFramecxx . . $ D3MusicDoFrame(54ecf43cdccad508).(&music_info);
629
630 Sound_systemcxx . . $ Sound_system..EndSoundFramecxx . . $ hlsSystem#EndSoundFrame(49f6e7a06ebc5aa8).();
631 }
632
633 UI_frame_resultcxx . . $ UI_frame_result. = ui_DoFramecxx . . $ ui_DoFrame(73da94e76e6bd037).();
634 }
635
636 if (UI_inputcxx . . $ UI_input..printscreencxx . . $ tUIInput#printscreen.) {
637 UI_inputcxx . . $ UI_input..printscreencxx . . $ tUIInput#printscreen. = false;
638 DoScreenshotcxx . . $ DoScreenshot(49f6e7a06ebc5aa8).();
639 }
640 }
641
642 // does one frame of ui.
643 void DoUIFrameWithoutInputcxx . . $ DoUIFrameWithoutInput(49f6e7a06ebc5aa8).() {
644 if (Multi_bail_ui_menucxx . . $ Multi_bail_ui_menu.) {
645 UI_frame_resultcxx . . $ UI_frame_result. = NEWUIRES_FORCEQUITcxx . . $ `Descent3/newui_core.h:131:9`!;
646 } else {
647 if (UI_callbackcxx . . $ UI_callback.)
648 (*UI_callbackcxx . . $ UI_callback.)();
649
650 if (GetFunctionModecxx . . $ GetFunctionMode(4270339a2fa9f0f5).() == MENU_MODEcxx . . $ MENU_MODE.) {
651 tMusicSeqInfocxx . . $ tMusicSeqInfo# music_info;
652
653 Sound_systemcxx . . $ Sound_system..BeginSoundFramecxx . . $ hlsSystem#BeginSoundFrame(b45ddcbc8423892c).(false);
654
655 music_info.frametimecxx . . $ tMusicSeqInfo#frametime. = UIFrameTimecxx . . $ UIFrameTime.;
656 music_info.player_deadcxx . . $ tMusicSeqInfo#player_dead. = false;
657 music_info.started_levelcxx . . $ tMusicSeqInfo#started_level. = false;
658 D3MusicDoFramecxx . . $ D3MusicDoFrame(54ecf43cdccad508).(&music_info);
659
660 Sound_systemcxx . . $ Sound_system..EndSoundFramecxx . . $ hlsSystem#EndSoundFrame(49f6e7a06ebc5aa8).();
661 }
662
663 UI_frame_resultcxx . . $ UI_frame_result. = ui_DoFramecxx . . $ ui_DoFrame(73da94e76e6bd037).(false);
664 }
665 }
666
667 int GetUIFrameResultcxx . . $ GetUIFrameResult(b126dc7c1de90089).() { return UI_frame_resultcxx . . $ UI_frame_result.; }
668
669 // sets the callback for background rendering of desktop for UI
670 void SetUICallbackcxx . . $ SetUICallback(964b12a25712bdc3).(void (*fn)()) {
671 if (fn == DEFAULT_UICALLBACKcxx . . $ `Descent3/newui_core.h:125:9`!)
672 fn = SimpleUICallbackcxx . . $ SimpleUICallback(49f6e7a06ebc5aa8).;
673 UI_callbackcxx . . $ UI_callback. = fn;
674 }
675
676 void (*GetUICallbackcxx . . $ GetUICallback(9f019fced98557ce).())() { return UI_callbackcxx . . $ UI_callback.; }
677
678 void SimpleUICallbackcxx . . $ SimpleUICallback(49f6e7a06ebc5aa8).() {
679 StartFramecxx . . $ StartFrame(3285c9bef785d51c).(0, 0, Max_window_wcxx . . $ Max_window_w., Max_window_hcxx . . $ Max_window_h.);
680 rend_ClearScreencxx . . $ rend_ClearScreen(cb2f890c2fdad230).(GR_BLACKcxx . . $ GR_BLACK.);
681 EndFramecxx . . $ EndFrame(49f6e7a06ebc5aa8).();
682 }
683
684 //////////////////////////////////////////////////////////////////////////////
685 // CLASS newui resource manager
686
687 newuiResourcescxx . . $ newuiResources#::newuiResourcescxx . . $ newuiResources#newuiResources(49f6e7a06ebc5aa8).() {}
688
689 bool newuiResourcescxx . . $ newuiResources#::Initcxx . . $ newuiResources#Init(c9857a73d68e59ba).() {
690 int i;
691 for (i = 0; i < N_NEWUI_BMPS_TOTALcxx . . $ `Descent3/newui_core.cpp:262:9`!; i++) {
692 m_listcxx . . $ newuiResources#m_list.[i].n_countcxx . . $ newuiResources#t_bmp_list#n_count. = 0;
693 }
694
695 return true;
696 }
697
698 void newuiResourcescxx . . $ newuiResources#::Shutdowncxx . . $ newuiResources#Shutdown(49f6e7a06ebc5aa8).() {
699 int i;
700
701 for (i = 0; i < N_NEWUI_BMPS_TOTALcxx . . $ `Descent3/newui_core.cpp:262:9`!; i++) {
702 if (m_listcxx . . $ newuiResources#m_list.[i].n_countcxx . . $ newuiResources#t_bmp_list#n_count. > 0) {
703 if (m_listcxx . . $ newuiResources#m_list.[i].chunkedcxx . . $ newuiResources#t_bmp_list#chunked.) {
704 bm_DestroyChunkedBitmapcxx . . $ bm_DestroyChunkedBitmap(1635f60f4d3c1317).(&m_listcxx . . $ newuiResources#m_list.[i].chunkcxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#chunk.);
705 } else {
706 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(m_listcxx . . $ newuiResources#m_list.[i].bm_handlecxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#bm_handle.);
707 }
708 }
709 m_listcxx . . $ newuiResources#m_list.[i].n_countcxx . . $ newuiResources#t_bmp_list#n_count. = 0;
710 }
711 }
712
713 // loads bitmap and returns the object
714 UIBitmapItemcxx . . $ UIBitmapItem# *newuiResourcescxx . . $ newuiResources#::Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(const char *filename) {
715 UIBitmapItemcxx . . $ UIBitmapItem# *bmitem;
716 int i, free_slot = -1;
717
718 // do search for bitmap.
719 for (i = 0; i < N_NEWUI_BMPS_TOTALcxx . . $ `Descent3/newui_core.cpp:262:9`!; i++) {
720 if (m_listcxx . . $ newuiResources#m_list.[i].n_countcxx . . $ newuiResources#t_bmp_list#n_count. == 0) {
721 if (free_slot == -1) {
722 free_slot = i;
723 }
724 } else {
725 if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(filename, m_list[i].filename) == 0) {
726 break;
727 }
728 }
729 }
730 if (i == N_NEWUI_BMPS_TOTALcxx . . $ `Descent3/newui_core.cpp:262:9`!) {
731 // perform load.
732 int bm, chw, chh;
733
734 if (free_slot == -1) {
735 // reached limit.
736 Int3cxx . . $ `misc/pserror.h:247:9`!();
737 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
738 }
739 i = free_slot;
740
741 bm = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).(IGNORE_TABLEcxx . . $ `lib/manage_external.h:54:9`!(filename), 0);
742 if (bm < 0) {
743 Errorcxx . . $ Error(326aeb464d16410c).("NewUI: Failed to load bitmap %s", filename);
744 }
745
746 chw = bm_wcxx . . $ bm_w(9b79fb6aee4c0440).(bm, 0);
747 chh = bm_hcxx . . $ bm_h(9b79fb6aee4c0440).(bm, 0);
748
749 if ((chw == 32 && chh == 32) || (chw == 64 && chh == 64) || (chw == 128 && chh == 128)) {
750 m_listcxx . . $ newuiResources#m_list.[i].bm_handlecxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#bm_handle. = bm;
751 m_listcxx . . $ newuiResources#m_list.[i].chunkedcxx . . $ newuiResources#t_bmp_list#chunked. = 0;
752 } else {
753 // chunk it.
754 bm_CreateChunkedBitmapcxx . . $ bm_CreateChunkedBitmap(b9fa1b176cbdfaf1).(bm, &m_listcxx . . $ newuiResources#m_list.[i].chunkcxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#chunk.);
755 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm);
756 m_listcxx . . $ newuiResources#m_list.[i].chunkedcxx . . $ newuiResources#t_bmp_list#chunked. = 1;
757 }
758
759 m_listcxx . . $ newuiResources#m_list.[i].n_countcxx . . $ newuiResources#t_bmp_list#n_count. = 0;
760 m_listcxx . . $ newuiResources#m_list.[i].filenamecxx . . $ newuiResources#t_bmp_list#filename. = mem_strdupcxx . . $ `mem/mem.h:81:9`!(filename);
761 }
762
763 m_listcxx . . $ newuiResources#m_list.[i].n_countcxx . . $ newuiResources#t_bmp_list#n_count.++;
764
765 if (m_listcxx . . $ newuiResources#m_list.[i].chunkedcxx . . $ newuiResources#t_bmp_list#chunked.) {
766 bmitem = new UIBitmapItemcxx . . $ UIBitmapItem#(&m_listcxx . . $ newuiResources#m_list.[i].chunkcxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#chunk.);
767 } else {
768 bmitem = new UIBitmapItemcxx . . $ UIBitmapItem#(m_listcxx . . $ newuiResources#m_list.[i].bm_handlecxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#bm_handle.);
769 }
770
771 return bmitem;
772 }
773
774 // frees memory for bitmap object.
775 void newuiResourcescxx . . $ newuiResources#::Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(UIBitmapItemcxx . . $ UIBitmapItem# *bmitem) {
776 int i;
777
778 if (!bmitem) {
779 Int3cxx . . $ `misc/pserror.h:247:9`!(); // Get samir.
780 return;
781 }
782
783 for (i = 0; i < N_NEWUI_BMPS_TOTALcxx . . $ `Descent3/newui_core.cpp:262:9`!; i++) {
784 if (m_listcxx . . $ newuiResources#m_list.[i].n_countcxx . . $ newuiResources#t_bmp_list#n_count. > 0) {
785 if (m_listcxx . . $ newuiResources#m_list.[i].chunkedcxx . . $ newuiResources#t_bmp_list#chunked. && bmitem->is_chunkedcxx . . $ UIBitmapItem#is_chunked(50ce9a9e25b4a850).()) {
786 if (bmitem->get_chunked_bitmapcxx . . $ UIBitmapItem#get_chunked_bitmap(c897c69353849a).()->bm_arraycxx . . $ chunked_bitmap#bm_array. == m_listcxx . . $ newuiResources#m_list.[i].chunkcxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#chunk..bm_arraycxx . . $ chunked_bitmap#bm_array.) {
787 break;
788 }
789 } else if (!m_listcxx . . $ newuiResources#m_list.[i].chunkedcxx . . $ newuiResources#t_bmp_list#chunked. && !bmitem->is_chunkedcxx . . $ UIBitmapItem#is_chunked(50ce9a9e25b4a850).()) {
790 if (bmitem->get_bitmapcxx . . $ UIBitmapItem#get_bitmap(455f465bc33b4cdf).() == m_listcxx . . $ newuiResources#m_list.[i].bm_handlecxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#bm_handle.) {
791 break;
792 }
793 }
794 }
795 }
796
797 if (i >= N_NEWUI_BMPS_TOTALcxx . . $ `Descent3/newui_core.cpp:262:9`!) {
798 Int3cxx . . $ `misc/pserror.h:247:9`!(); // maybe we should free this, well this really should never happen but if it does
799 return; // I can't be completely sure this is a valid pointer, so rather than risking a crash I'll have a leak.
800 }
801
802 // ASSERT(i < N_NEWUI_BMPS_TOTAL);
803
804 // decrement and free.
805 delete bmitem;
806
807 m_listcxx . . $ newuiResources#m_list.[i].n_countcxx . . $ newuiResources#t_bmp_list#n_count.--;
808 if (m_listcxx . . $ newuiResources#m_list.[i].n_countcxx . . $ newuiResources#t_bmp_list#n_count. == 0) {
809 if (m_listcxx . . $ newuiResources#m_list.[i].chunkedcxx . . $ newuiResources#t_bmp_list#chunked.) {
810 bm_DestroyChunkedBitmapcxx . . $ bm_DestroyChunkedBitmap(1635f60f4d3c1317).(&m_listcxx . . $ newuiResources#m_list.[i].chunkcxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#chunk.);
811 } else {
812 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(m_listcxx . . $ newuiResources#m_list.[i].bm_handlecxx . . $ newuiResources#t_bmp_list#$anonymous_type_0#bm_handle.);
813 }
814 mem_freecxx . . $ `mem/mem.h:80:9`!(m_list[i].filename);
815 }
816 }
817
818 //////////////////////////////////////////////////////////////////////////////
819 // CLASS a menu with options and sheets
820
821 newuiMenucxx . . $ newuiMenu#::newuiMenucxx . . $ newuiMenu#newuiMenu(49f6e7a06ebc5aa8).() {
822 m_nsheetscxx . . $ newuiMenu#m_nsheets. = 0;
823 m_bkgcxx . . $ newuiMenu#m_bkg. = 0;
824 m_cursheetcxx . . $ newuiMenu#m_cursheet. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
825 m_newoptionidcxx . . $ newuiMenu#m_newoptionid. = -1;
826 m_aligncxx . . $ newuiMenu#m_align. = NEWUI_ALIGN_VERTcxx . . $ NEWUI_ALIGN_VERT.;
827 }
828
829 // creates a menu
830 void newuiMenucxx . . $ newuiMenu#::Createcxx . . $ newuiMenu#Create(49f6e7a06ebc5aa8).() {
831 m_nsheetscxx . . $ newuiMenu#m_nsheets. = 0;
832
833 if (!m_bkgcxx . . $ newuiMenu#m_bkg.) {
834 m_bkgcxx . . $ newuiMenu#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_MEDWIN_FILEcxx . . $ `Descent3/newui_core.cpp:295:9`!);
835 }
836
837 m_sheetxcxx . . $ newuiMenu#m_sheetx. = NEWUI_MEDWIN_SHEET_Xcxx . . $ `Descent3/newui_core.cpp:337:9`!;
838 m_sheetycxx . . $ newuiMenu#m_sheety. = NEWUI_MEDWIN_SHEET_Ycxx . . $ `Descent3/newui_core.cpp:338:9`!;
839 m_optionsxcxx . . $ newuiMenu#m_optionsx. = NEWUI_MEDWIN_OPTIONS_Xcxx . . $ `Descent3/newui_core.cpp:333:9`!;
840 m_optionsycxx . . $ newuiMenu#m_optionsy. = NEWUI_MEDWIN_OPTIONS_Ycxx . . $ `Descent3/newui_core.cpp:334:9`!;
841 m_optionswcxx . . $ newuiMenu#m_optionsw. = NEWUI_MEDWIN_OPTIONS_Wcxx . . $ `Descent3/newui_core.cpp:335:9`!;
842 m_optionshcxx . . $ newuiMenu#m_optionsh. = NEWUI_MEDWIN_OPTIONS_Hcxx . . $ `Descent3/newui_core.cpp:336:9`!;
843 m_titlexcxx . . $ newuiMenu#m_titlex. = NEWUI_MEDWIN_TITLE_Xcxx . . $ `Descent3/newui_core.cpp:339:9`!;
844 m_titleycxx . . $ newuiMenu#m_titley. = NEWUI_MEDWIN_TITLE_Ycxx . . $ `Descent3/newui_core.cpp:340:9`!;
845 m_aligncxx . . $ newuiMenu#m_align. = NEWUI_ALIGN_VERTcxx . . $ NEWUI_ALIGN_VERT.;
846
847 m_uiframe_cbcxx . . $ newuiMenu#m_uiframe_cb. = GetUICallbackcxx . . $ GetUICallback(9f019fced98557ce).();
848 m_activate_sheet_cbcxx . . $ newuiMenu#m_activate_sheet_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
849 m_option_focus_cbcxx . . $ newuiMenu#m_option_focus_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
850
851 UIWindowcxx . . $ UIWindow#::Createcxx . . $ UIWindow#Create(1559a299834bcdd5).((Max_window_wcxx . . $ Max_window_w. - m_bkgcxx . . $ newuiMenu#m_bkg.->widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) / 2, (Max_window_hcxx . . $ Max_window_h. - m_bkgcxx . . $ newuiMenu#m_bkg.->heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).()) / 2, m_bkgcxx . . $ newuiMenu#m_bkg.->widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(),
852 m_bkgcxx . . $ newuiMenu#m_bkg.->heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).());
853 m_newoptionidcxx . . $ newuiMenu#m_newoptionid. = -1;
854 m_cursheetidxcxx . . $ newuiMenu#m_cursheetidx. = -1;
855 }
856
857 // sets current option to display.
858 void newuiMenucxx . . $ newuiMenu#::SetCurrentOptioncxx . . $ newuiMenu#SetCurrentOption(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# id) { m_newoptionidcxx . . $ newuiMenu#m_newoptionid. = id; }
859
860 // returns current option
861 int16_tcxx . . $ int16_t# newuiMenucxx . . $ newuiMenu#::GetCurrentOptioncxx . . $ newuiMenu#GetCurrentOption(524863554b4a534e).() const {
862 if (m_cursheetidxcxx . . $ newuiMenu#m_cursheetidx. != -1) {
863 return m_sheetbtncxx . . $ newuiMenu#m_sheetbtn.[m_cursheetidxcxx . . $ newuiMenu#m_cursheetidx.].GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).();
864 }
865
866 return -1;
867 }
868
869 newuiSheetcxx . . $ newuiSheet# *newuiMenucxx . . $ newuiMenu#::GetCurrentSheetcxx . . $ newuiMenu#GetCurrentSheet(30d547b14d44a52d).() const { return m_cursheetcxx . . $ newuiMenu#m_cursheet.; }
870
871 // when a new option is ready. at this point the system sets the focus on this option
872 void newuiMenucxx . . $ newuiMenu#::SetOnOptionFocusCBcxx . . $ newuiMenu#SetOnOptionFocusCB(d86502bad44a4a2).(void (*fn)(newuiMenucxx . . $ newuiMenu# *, int16_tcxx . . $ int16_t#, void *), void *data) {
873 m_option_focus_cbcxx . . $ newuiMenu#m_option_focus_cb. = fn;
874 m_option_focus_cb_datacxx . . $ newuiMenu#m_option_focus_cb_data. = data;
875 }
876
877 // processes a menu
878 int newuiMenucxx . . $ newuiMenu#::DoUIcxx . . $ newuiMenu#DoUI(b126dc7c1de90089).() {
879 int res, i;
880
881 if (m_newoptionidcxx . . $ newuiMenu#m_newoptionid. != -1) {
882 m_cursheetidxcxx . . $ newuiMenu#m_cursheetidx. = -1;
883 for (i = 0; i < m_nsheetscxx . . $ newuiMenu#m_nsheets.; i++) {
884 if (m_sheetbtncxx . . $ newuiMenu#m_sheetbtn.[i].GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).() == (int)m_newoptionidcxx . . $ newuiMenu#m_newoptionid.) {
885 if (m_cursheetcxx . . $ newuiMenu#m_cursheet.) {
886 m_cursheetcxx . . $ newuiMenu#m_cursheet.->Unrealizecxx . . $ newuiSheet#Unrealize(49f6e7a06ebc5aa8).();
887 m_cursheetcxx . . $ newuiMenu#m_cursheet. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
888 }
889
890 if (m_hassheetcxx . . $ newuiMenu#m_hassheet.[i]) {
891 if (m_activate_sheet_cbcxx . . $ newuiMenu#m_activate_sheet_cb.) {
892 (*m_activate_sheet_cbcxx . . $ newuiMenu#m_activate_sheet_cb.)(this, m_sheetbtncxx . . $ newuiMenu#m_sheetbtn.[i].GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).(), m_newoptionidcxx . . $ newuiMenu#m_newoptionid., m_activate_sheet_cb_datacxx . . $ newuiMenu#m_activate_sheet_cb_data.);
893 }
894
895 m_cursheetcxx . . $ newuiMenu#m_cursheet. = &m_sheetscxx . . $ newuiMenu#m_sheets.[i];
896 m_cursheetcxx . . $ newuiMenu#m_cursheet.->Realizecxx . . $ newuiSheet#Realize(49f6e7a06ebc5aa8).();
897 }
898
899 m_cursheetidxcxx . . $ newuiMenu#m_cursheetidx. = i;
900
901 SetFocusOnGadgetcxx . . $ UIWindow#SetFocusOnGadget(75ffd377f9406104).(&m_sheetbtncxx . . $ newuiMenu#m_sheetbtn.[i]);
902
903 if (m_option_focus_cbcxx . . $ newuiMenu#m_option_focus_cb.) {
904 (*m_option_focus_cbcxx . . $ newuiMenu#m_option_focus_cb.)(this, m_sheetbtncxx . . $ newuiMenu#m_sheetbtn.[i].GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).(), m_option_focus_cb_datacxx . . $ newuiMenu#m_option_focus_cb_data.);
905 }
906
907 break;
908 }
909 }
910 if (i == m_nsheetscxx . . $ newuiMenu#m_nsheets.) { // error!
911 Int3cxx . . $ `misc/pserror.h:247:9`!();
912 if (m_cursheetcxx . . $ newuiMenu#m_cursheet.) {
913 m_cursheetcxx . . $ newuiMenu#m_cursheet.->Unrealizecxx . . $ newuiSheet#Unrealize(49f6e7a06ebc5aa8).();
914 m_cursheetcxx . . $ newuiMenu#m_cursheet. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
915 }
916 }
917 m_newoptionidcxx . . $ newuiMenu#m_newoptionid. = -1;
918 }
919
920 // refreshes gadgets on current sheet.
921 if (m_cursheetcxx . . $ newuiMenu#m_cursheet.) {
922 m_cursheetcxx . . $ newuiMenu#m_cursheet.->UpdateChangescxx . . $ newuiSheet#UpdateChanges(49f6e7a06ebc5aa8).();
923 }
924
925 // do ui and check if a new option was selected
926 res = ::DoUIcxx . . $ DoUI(b126dc7c1de90089).();
927
928 for (i = 0; i < m_nsheetscxx . . $ newuiMenu#m_nsheets.; i++) {
929 if (i != m_cursheetidxcxx . . $ newuiMenu#m_cursheetidx.) {
930 if (res == m_sheetbtncxx . . $ newuiMenu#m_sheetbtn.[i].GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).() && m_hassheetcxx . . $ newuiMenu#m_hassheet.[i]) {
931 m_newoptionidcxx . . $ newuiMenu#m_newoptionid. = (int16_tcxx . . $ int16_t#)res;
932 break;
933 }
934 }
935 }
936
937 // updates return values
938 if (m_cursheetcxx . . $ newuiMenu#m_cursheet.) {
939 m_cursheetcxx . . $ newuiMenu#m_cursheet.->UpdateReturnValuescxx . . $ newuiSheet#UpdateReturnValues(49f6e7a06ebc5aa8).();
940 }
941
942 return res;
943 }
944
945 // when a new sheet is realized, this function will be called.
946 // passed in: the menu object, the old option and the new option respectively
947 void newuiMenucxx . . $ newuiMenu#::SetOnOptionSwitchCBcxx . . $ newuiMenu#SetOnOptionSwitchCB(a57b737311599b0a).(void (*fn)(newuiMenucxx . . $ newuiMenu# *, int16_tcxx . . $ int16_t#, int16_tcxx . . $ int16_t#, void *), void *data) {
948 m_activate_sheet_cbcxx . . $ newuiMenu#m_activate_sheet_cb. = fn;
949 m_activate_sheet_cb_datacxx . . $ newuiMenu#m_activate_sheet_cb_data. = data;
950 }
951
952 // equivalent of SetUICallback, called before gadgets are drawn
953 void newuiMenucxx . . $ newuiMenu#::SetOnUIFrameCBcxx . . $ newuiMenu#SetOnUIFrameCB(964b12a25712bdc3).(void (*fn)()) {
954 // m_uiframe_cb = GetUICallback();
955 // SetUICallback(fn);
956 }
957
958 // adds an option to a menu, returns a newuiSheet object to add user interface to.
959 void newuiMenucxx . . $ newuiMenu#::AddSimpleOptioncxx . . $ newuiMenu#AddSimpleOption(6ed0a7151bf51ed1).(int16_tcxx . . $ int16_t# id, const char *title, int yoff) {
960 newuiMenucxx . . $ newuiMenu#::AddOptioncxx . . $ newuiMenu#AddOption(f02bcd29588925e6).(id, title, 0, false, yoff);
961 }
962
963 newuiSheetcxx . . $ newuiSheet# *newuiMenucxx . . $ newuiMenu#::AddOptioncxx . . $ newuiMenu#AddOption(f02bcd29588925e6).(int16_tcxx . . $ int16_t# id, const char *title, int size, bool has_sheet, int yoff) {
964 newuiMenuOptionButtoncxx . . $ newuiMenuOptionButton# *last_btn = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
965
966 if (m_nsheetscxx . . $ newuiMenu#m_nsheets. == N_NEWUI_SHEETScxx . . $ `Descent3/newui_core.h:68:9`!) {
967 Int3cxx . . $ `misc/pserror.h:247:9`!();
968 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
969 }
970
971 if (has_sheet) {
972 m_sheetscxx . . $ newuiMenu#m_sheets.[m_nsheetscxx . . $ newuiMenu#m_nsheets.].Createcxx . . $ newuiSheet#Create(d9d4491c5dd23a91).(this, title, size, m_sheetxcxx . . $ newuiMenu#m_sheetx., m_sheetycxx . . $ newuiMenu#m_sheety.);
973 }
974
975 if (m_nsheetscxx . . $ newuiMenu#m_nsheets. > 0) {
976 last_btn = &m_sheetbtncxx . . $ newuiMenu#m_sheetbtn.[m_nsheetscxx . . $ newuiMenu#m_nsheets. - 1];
977 }
978
979 switch (m_aligncxx . . $ newuiMenu#m_align.) {
980 case NEWUI_ALIGN_VERTcxx . . $ NEWUI_ALIGN_VERT.:
981 m_sheetbtncxx . . $ newuiMenu#m_sheetbtn.[m_nsheetscxx . . $ newuiMenu#m_nsheets.].Createcxx . . $ newuiMenuOptionButton#Create(1deaf4d7e2763ddc).(this, last_btn, id, title, m_optionsxcxx . . $ newuiMenu#m_optionsx., m_optionsycxx . . $ newuiMenu#m_optionsy. + m_nsheetscxx . . $ newuiMenu#m_nsheets. * m_optionshcxx . . $ newuiMenu#m_optionsh. + yoff,
982 has_sheet);
983 break;
984 case NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.:
985 m_sheetbtncxx . . $ newuiMenu#m_sheetbtn.[m_nsheetscxx . . $ newuiMenu#m_nsheets.].Createcxx . . $ newuiMenuOptionButton#Create(1deaf4d7e2763ddc).(this, last_btn, id, title, m_optionsxcxx . . $ newuiMenu#m_optionsx. + m_nsheetscxx . . $ newuiMenu#m_nsheets. * m_optionswcxx . . $ newuiMenu#m_optionsw. + yoff, m_optionsycxx . . $ newuiMenu#m_optionsy.,
986 has_sheet);
987 break;
988 default:
989 Int3cxx . . $ `misc/pserror.h:247:9`!();
990 }
991
992 m_hassheetcxx . . $ newuiMenu#m_hassheet.[m_nsheetscxx . . $ newuiMenu#m_nsheets.] = has_sheet;
993 m_newoptionidcxx . . $ newuiMenu#m_newoptionid. = id;
994 m_nsheetscxx . . $ newuiMenu#m_nsheets.++;
995
996 if (!has_sheet) {
997 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
998 }
999
1000 return &m_sheetscxx . . $ newuiMenu#m_sheets.[m_nsheetscxx . . $ newuiMenu#m_nsheets. - 1];
1001 }
1002
1003 // set master sheet,button locations
1004 void newuiMenucxx . . $ newuiMenu#::SetPlacementscxx . . $ newuiMenu#SetPlacements(548fbf2da99c1809).(int x, int y, int options_x, int options_y, int options_w, int options_h, int title_x,
1005 int title_y, tAlignmentcxx . . $ tAlignment# align) {
1006 m_sheetxcxx . . $ newuiMenu#m_sheetx. = x;
1007 m_sheetycxx . . $ newuiMenu#m_sheety. = y;
1008 m_optionsxcxx . . $ newuiMenu#m_optionsx. = options_x;
1009 m_optionsycxx . . $ newuiMenu#m_optionsy. = options_y;
1010 m_optionswcxx . . $ newuiMenu#m_optionsw. = options_w;
1011 m_optionshcxx . . $ newuiMenu#m_optionsh. = options_h;
1012 m_titlexcxx . . $ newuiMenu#m_titlex. = title_x;
1013 m_titleycxx . . $ newuiMenu#m_titley. = title_y;
1014 m_aligncxx . . $ newuiMenu#m_align. = align;
1015 }
1016
1017 // overridable draws the window background before gadgets
1018 void newuiMenucxx . . $ newuiMenu#::OnDrawcxx . . $ newuiMenu#OnDraw(49f6e7a06ebc5aa8).() {
1019 // draw background
1020 m_bkgcxx . . $ newuiMenu#m_bkg.->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(0, 0);
1021
1022 // draw title
1023 if (m_cursheetidxcxx . . $ newuiMenu#m_cursheetidx. != -1 && m_hassheetcxx . . $ newuiMenu#m_hassheet.[m_cursheetidxcxx . . $ newuiMenu#m_cursheetidx.]) {
1024 UITextItemcxx . . $ UITextItem# *title = m_sheetbtncxx . . $ newuiMenu#m_sheetbtn.[m_cursheetidxcxx . . $ newuiMenu#m_cursheetidx.].GetTitlecxx . . $ newuiButton#GetTitle(f7c48f119a8bdae9).();
1025 UITextItemcxx . . $ UITextItem# m_texttitlecxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).(MONITOR15_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:116:9`!, title->GetBuffercxx . . $ UITextItem#GetBuffer(a9f41ea0e82d88cf).(), NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!);
1026
1027 m_texttitle.drawcxx . . $ UITextItem#draw(84329bcd07240ccf).(m_titlexcxx . . $ newuiMenu#m_titlex. - 8 + (NEWUI_MEDWIN_TITLE_Wcxx . . $ `Descent3/newui_core.cpp:341:9`! - m_texttitle.widthcxx . . $ UITextItem#width(b126dc7c1de90089).()) / 2, m_titleycxx . . $ newuiMenu#m_titley.);
1028 }
1029
1030 // draws gadgets.
1031 UIWindowcxx . . $ UIWindow#::OnDrawcxx . . $ UIWindow#OnDraw(49f6e7a06ebc5aa8).();
1032 }
1033
1034 // overridable: called in Destroy
1035 void newuiMenucxx . . $ newuiMenu#::OnDestroycxx . . $ newuiMenu#OnDestroy(49f6e7a06ebc5aa8).() {
1036 int i;
1037
1038 if (m_bkgcxx . . $ newuiMenu#m_bkg.) {
1039 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_bkgcxx . . $ newuiMenu#m_bkg.);
1040 m_bkgcxx . . $ newuiMenu#m_bkg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1041 }
1042
1043 for (i = 0; i < m_nsheetscxx . . $ newuiMenu#m_nsheets.; i++) {
1044 if (m_hassheetcxx . . $ newuiMenu#m_hassheet.[i]) {
1045 m_sheetscxx . . $ newuiMenu#m_sheets.[i].Destroycxx . . $ newuiSheet#Destroy(49f6e7a06ebc5aa8).();
1046 m_sheetbtncxx . . $ newuiMenu#m_sheetbtn.[i].Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1047 m_hassheetcxx . . $ newuiMenu#m_hassheet.[i] = false;
1048 }
1049 }
1050
1051 m_nsheetscxx . . $ newuiMenu#m_nsheets. = 0;
1052
1053 SetUICallbackcxx . . $ SetUICallback(964b12a25712bdc3).(m_uiframe_cbcxx . . $ newuiMenu#m_uiframe_cb.);
1054
1055 UIWindowcxx . . $ UIWindow#::OnDestroycxx . . $ UIWindow#OnDestroy(49f6e7a06ebc5aa8).();
1056 }
1057
1058 //////////////////////////////////////////////////////////////////////////////
1059 // CLASS, large (fullscreen) menu
1060
1061 // creates a menu
1062 void newuiLargeMenucxx . . $ newuiLargeMenu#::Createcxx . . $ newuiLargeMenu#Create(49f6e7a06ebc5aa8).() {
1063 m_bkgcxx . . $ newuiMenu#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LRGWIN_FILEcxx . . $ `Descent3/newui_core.cpp:296:9`!);
1064 newuiMenucxx . . $ newuiMenu#::Createcxx . . $ newuiMenu#Create(49f6e7a06ebc5aa8).();
1065 newuiMenucxx . . $ newuiMenu#::SetPlacementscxx . . $ newuiMenu#SetPlacements(548fbf2da99c1809).(NEWUI_LRGWIN_SHEET_Xcxx . . $ `Descent3/newui_core.cpp:348:9`!, NEWUI_LRGWIN_SHEET_Ycxx . . $ `Descent3/newui_core.cpp:349:9`!, NEWUI_LRGWIN_OPTIONS_Xcxx . . $ `Descent3/newui_core.cpp:344:9`!, NEWUI_LRGWIN_OPTIONS_Ycxx . . $ `Descent3/newui_core.cpp:345:9`!,
1066 NEWUI_LRGWIN_OPTIONS_Wcxx . . $ `Descent3/newui_core.cpp:346:9`!, NEWUI_LRGWIN_OPTIONS_Hcxx . . $ `Descent3/newui_core.cpp:347:9`!, NEWUI_LRGWIN_TITLE_Xcxx . . $ `Descent3/newui_core.cpp:350:9`!, NEWUI_LRGWIN_TITLE_Ycxx . . $ `Descent3/newui_core.cpp:351:9`!,
1067 NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.);
1068 }
1069
1070 // adds an option to a menu, returns a newuiSheet object to add user interface to.
1071 newuiSheetcxx . . $ newuiSheet# *newuiLargeMenucxx . . $ newuiLargeMenu#::AddOptioncxx . . $ newuiLargeMenu#AddOption(2e05a335277a5351).(int16_tcxx . . $ int16_t# id, const char *title, int size) {
1072 return newuiMenucxx . . $ newuiMenu#::AddOptioncxx . . $ newuiMenu#AddOption(f02bcd29588925e6).(id, title, size);
1073 }
1074
1075 //////////////////////////////////////////////////////////////////////////////
1076 // CLASS, small message box
1077 #define MBTN_OKcxx . . $ `Descent3/newui_core.cpp:1077:9`! 0
1078 #define MBTN_CANCELcxx . . $ `Descent3/newui_core.cpp:1078:9`! 1
1079
1080 newuiMessageBoxcxx . . $ newuiMessageBox#::newuiMessageBoxcxx . . $ newuiMessageBox#newuiMessageBox(49f6e7a06ebc5aa8).() { m_bkgcxx . . $ newuiMessageBox#m_bkg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; }
1081
1082 void newuiMessageBoxcxx . . $ newuiMessageBox#::Createcxx . . $ newuiMessageBox#Create(34d26762b42c433a).(const char *title, int type) {
1083 ASSERTcxx . . $ `misc/pserror.h:246:9`!(title);
1084 m_bkgcxx . . $ newuiMessageBox#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_MSGBOX_FILEcxx . . $ `Descent3/newui_core.cpp:294:9`!);
1085
1086 UIWindowcxx . . $ UIWindow#::Createcxx . . $ UIWindow#Create(1559a299834bcdd5).((Max_window_wcxx . . $ Max_window_w. - m_bkgcxx . . $ newuiMessageBox#m_bkg.->widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) / 2, (Max_window_hcxx . . $ Max_window_h. - m_bkgcxx . . $ newuiMessageBox#m_bkg.->heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).()) / 2, m_bkgcxx . . $ newuiMessageBox#m_bkg.->widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(),
1087 m_bkgcxx . . $ newuiMessageBox#m_bkg.->heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).());
1088
1089 m_sheetcxx . . $ newuiMessageBox#m_sheet..Createcxx . . $ newuiSheet#Create(d9d4491c5dd23a91).(this, title, NEWUIMENU_SMALLcxx . . $ `Descent3/newui_core.h:554:9`!, NEWUI_MSGBOX_SHEET_Xcxx . . $ `Descent3/newui_core.cpp:329:9`!, NEWUI_MSGBOX_SHEET_Ycxx . . $ `Descent3/newui_core.cpp:330:9`!);
1090
1091 if (type == MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!) {
1092 m_btncxx . . $ newuiMessageBox#m_btn.[MBTN_OKcxx . . $ `Descent3/newui_core.cpp:1077:9`!].Createcxx . . $ newuiButton#Create(6c82988af4899650).(this, UID_OKcxx . . $ `ui/ui.h:368:9`!, TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!, NEWUI_MSGBOX_BUTTONS_Xcxx . . $ `Descent3/newui_core.cpp:324:9`!, NEWUI_MSGBOX_BUTTONS_Ycxx . . $ `Descent3/newui_core.cpp:325:9`!, NEWUI_BTNF_FRAMEDcxx . . $ `Descent3/newui_core.h:184:9`!);
1093 AddAcceleratorKeycxx . . $ UIWindow#AddAcceleratorKey(3e454b8ccf442868).(KEY_ESCcxx . . $ `ddio/ddio_common.h:267:9`!, UID_OKcxx . . $ `ui/ui.h:368:9`!);
1094 } else if (type == MSGBOX_OKCANCELcxx . . $ `Descent3/newui_core.h:79:9`!) {
1095 m_btncxx . . $ newuiMessageBox#m_btn.[MBTN_OKcxx . . $ `Descent3/newui_core.cpp:1077:9`!].Createcxx . . $ newuiButton#Create(6c82988af4899650).(this, UID_OKcxx . . $ `ui/ui.h:368:9`!, TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!, NEWUI_MSGBOX_BUTTONS_Xcxx . . $ `Descent3/newui_core.cpp:324:9`!, NEWUI_MSGBOX_BUTTONS_Ycxx . . $ `Descent3/newui_core.cpp:325:9`!, NEWUI_BTNF_FRAMEDcxx . . $ `Descent3/newui_core.h:184:9`!);
1096 m_btncxx . . $ newuiMessageBox#m_btn.[MBTN_CANCELcxx . . $ `Descent3/newui_core.cpp:1078:9`!].Createcxx . . $ newuiButton#Create(6c82988af4899650).(this, UID_CANCELcxx . . $ `ui/ui.h:369:9`!, TXT_CANCELcxx . . $ `Descent3/stringtable.h:35:9`!, NEWUI_MSGBOX_BUTTONS_Xcxx . . $ `Descent3/newui_core.cpp:324:9`!,
1097 NEWUI_MSGBOX_BUTTONS_Ycxx . . $ `Descent3/newui_core.cpp:325:9`! + NEWUI_MSGBOX_BUTTONS_Hcxx . . $ `Descent3/newui_core.cpp:326:9`!, NEWUI_BTNF_FRAMEDcxx . . $ `Descent3/newui_core.h:184:9`!);
1098 } else if (type == MSGBOX_YESNOcxx . . $ `Descent3/newui_core.h:80:9`!) {
1099 m_btncxx . . $ newuiMessageBox#m_btn.[MBTN_OKcxx . . $ `Descent3/newui_core.cpp:1077:9`!].Createcxx . . $ newuiButton#Create(6c82988af4899650).(this, UID_OKcxx . . $ `ui/ui.h:368:9`!, TXT_YEScxx . . $ `Descent3/stringtable.h:113:9`!, NEWUI_MSGBOX_BUTTONS_Xcxx . . $ `Descent3/newui_core.cpp:324:9`!, NEWUI_MSGBOX_BUTTONS_Ycxx . . $ `Descent3/newui_core.cpp:325:9`!, NEWUI_BTNF_FRAMEDcxx . . $ `Descent3/newui_core.h:184:9`!);
1100 m_btncxx . . $ newuiMessageBox#m_btn.[MBTN_CANCELcxx . . $ `Descent3/newui_core.cpp:1078:9`!].Createcxx . . $ newuiButton#Create(6c82988af4899650).(this, UID_CANCELcxx . . $ `ui/ui.h:369:9`!, TXT_NOcxx . . $ `Descent3/stringtable.h:112:9`!, NEWUI_MSGBOX_BUTTONS_Xcxx . . $ `Descent3/newui_core.cpp:324:9`!,
1101 NEWUI_MSGBOX_BUTTONS_Ycxx . . $ `Descent3/newui_core.cpp:325:9`! + NEWUI_MSGBOX_BUTTONS_Hcxx . . $ `Descent3/newui_core.cpp:326:9`!, NEWUI_BTNF_FRAMEDcxx . . $ `Descent3/newui_core.h:184:9`!);
1102 m_btncxx . . $ newuiMessageBox#m_btn.[MBTN_OKcxx . . $ `Descent3/newui_core.cpp:1077:9`!].SetHotkeycxx . . $ UIGadget#SetHotkey(d4f767463ce0a6b3).(KEY_Ycxx . . $ `ddio/ddio_common.h:253:9`!);
1103 m_btncxx . . $ newuiMessageBox#m_btn.[MBTN_CANCELcxx . . $ `Descent3/newui_core.cpp:1078:9`!].SetHotkeycxx . . $ UIGadget#SetHotkey(d4f767463ce0a6b3).(KEY_Ncxx . . $ `ddio/ddio_common.h:242:9`!);
1104 }
1105 }
1106
1107 void newuiMessageBoxcxx . . $ newuiMessageBox#::AddButtoncxx . . $ newuiMessageBox#AddButton(7b85637613228108).(const char *title, int slot, int key) {
1108 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < NEWUI_MSGBOX_MAXBTNScxx . . $ `Descent3/newui_core.h:638:9`!);
1109
1110 if (m_btncxx . . $ newuiMessageBox#m_btn.[slot].IsCreatedcxx . . $ UIObject#IsCreated(50ce9a9e25b4a850).()) {
1111 m_btncxx . . $ newuiMessageBox#m_btn.[slot].Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1112 }
1113
1114 m_btncxx . . $ newuiMessageBox#m_btn.[slot].Createcxx . . $ newuiButton#Create(6c82988af4899650).(this, slot, title, NEWUI_MSGBOX_BUTTONS_Xcxx . . $ `Descent3/newui_core.cpp:324:9`!,
1115 NEWUI_MSGBOX_BUTTONS_Y2cxx . . $ `Descent3/newui_core.cpp:327:9`! + NEWUI_MSGBOX_BUTTONS_H2cxx . . $ `Descent3/newui_core.cpp:328:9`! * slot, NEWUI_BTNF_FRAMEDcxx . . $ `Descent3/newui_core.h:184:9`!);
1116 if (key) {
1117 m_btncxx . . $ newuiMessageBox#m_btn.[slot].SetHotkeycxx . . $ UIGadget#SetHotkey(d4f767463ce0a6b3).(key);
1118 }
1119 }
1120
1121 // grab the message box's sheet.
1122 newuiSheetcxx . . $ newuiSheet# *newuiMessageBoxcxx . . $ newuiMessageBox#::GetSheetcxx . . $ newuiMessageBox#GetSheet(661381a276e5b628).() { return &m_sheetcxx . . $ newuiMessageBox#m_sheet.; }
1123
1124 // do user interface, return UID_OK or UID_CANCEL or UID_??? (UID_OK and UID_CANCEL are predefined)
1125 int newuiMessageBoxcxx . . $ newuiMessageBox#::DoUIcxx . . $ newuiMessageBox#DoUI(b126dc7c1de90089).() {
1126 int res;
1127 m_sheetcxx . . $ newuiMessageBox#m_sheet..Realizecxx . . $ newuiSheet#Realize(49f6e7a06ebc5aa8).();
1128 res = ::DoUIcxx . . $ DoUI(b126dc7c1de90089).();
1129 m_sheetcxx . . $ newuiMessageBox#m_sheet..Unrealizecxx . . $ newuiSheet#Unrealize(49f6e7a06ebc5aa8).();
1130
1131 return res;
1132 }
1133
1134 void newuiMessageBoxcxx . . $ newuiMessageBox#::OnDestroycxx . . $ newuiMessageBox#OnDestroy(49f6e7a06ebc5aa8).() {
1135 int i;
1136
1137 if (m_bkgcxx . . $ newuiMessageBox#m_bkg.) {
1138 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_bkgcxx . . $ newuiMessageBox#m_bkg.);
1139 m_bkgcxx . . $ newuiMessageBox#m_bkg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1140 }
1141
1142 m_sheetcxx . . $ newuiMessageBox#m_sheet..Destroycxx . . $ newuiSheet#Destroy(49f6e7a06ebc5aa8).();
1143
1144 for (i = 0; i < NEWUI_MSGBOX_MAXBTNScxx . . $ `Descent3/newui_core.h:638:9`!; i++) {
1145 if (m_btncxx . . $ newuiMessageBox#m_btn.[i].IsCreatedcxx . . $ UIObject#IsCreated(50ce9a9e25b4a850).()) {
1146 m_btncxx . . $ newuiMessageBox#m_btn.[i].Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1147 }
1148 }
1149
1150 UIWindowcxx . . $ UIWindow#::OnDestroycxx . . $ UIWindow#OnDestroy(49f6e7a06ebc5aa8).();
1151 }
1152
1153 // overridable draws the window background before gadgets
1154 void newuiMessageBoxcxx . . $ newuiMessageBox#::OnDrawcxx . . $ newuiMessageBox#OnDraw(49f6e7a06ebc5aa8).() {
1155 // draw background
1156 m_bkgcxx . . $ newuiMessageBox#m_bkg.->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(0, 0);
1157
1158 UITextItemcxx . . $ UITextItem# titlecxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, m_sheetcxx . . $ newuiMessageBox#m_sheet..GetTitlecxx . . $ newuiSheet#GetTitle(33a1f659e94feb42).(), NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!);
1159 title.drawcxx . . $ UITextItem#draw(84329bcd07240ccf).(NEWUI_MSGBOX_SHEET_Xcxx . . $ `Descent3/newui_core.cpp:329:9`!, NEWUI_MSGBOX_SHEET_Ycxx . . $ `Descent3/newui_core.cpp:330:9`! - 16);
1160
1161 // draws gadgets.
1162 UIWindowcxx . . $ UIWindow#::OnDrawcxx . . $ UIWindow#OnDraw(49f6e7a06ebc5aa8).();
1163 }
1164
1165 //////////////////////////////////////////////////////////////////////////////
1166 // CLASS contains gadgets
1167
1168 // constants used in newuiSheet for gadget types. hidden from user.
1169
1170 #define GADGET_GROUPcxx . . $ `Descent3/newui_core.cpp:1170:9`! 0 // repositions column, row alignment
1171 #define GADGET_HGROUPcxx . . $ `Descent3/newui_core.cpp:1171:9`! 1
1172 #define GADGET_STATIC_TXTcxx . . $ `Descent3/newui_core.cpp:1172:9`! 2 // static text
1173 #define GADGET_BUTTONcxx . . $ `Descent3/newui_core.cpp:1173:9`! 3 // small mono state button
1174 #define GADGET_CHECKBOXcxx . . $ `Descent3/newui_core.cpp:1174:9`! 4 // small two state button
1175 #define GADGET_RADIOcxx . . $ `Descent3/newui_core.cpp:1175:9`! 5 // small two state radio
1176 #define GADGET_LBUTTONcxx . . $ `Descent3/newui_core.cpp:1176:9`! 6 // large equivalents
1177 #define GADGET_LCHECKBOXcxx . . $ `Descent3/newui_core.cpp:1177:9`! 7
1178 #define GADGET_LRADIOcxx . . $ `Descent3/newui_core.cpp:1178:9`! 8
1179 #define GADGET_SLIDERcxx . . $ `Descent3/newui_core.cpp:1179:9`! 9 // slider
1180 #define GADGET_EDITBOXcxx . . $ `Descent3/newui_core.cpp:1180:9`! 10 // edit control
1181 #define GADGET_EDITBOXPASScxx . . $ `Descent3/newui_core.cpp:1181:9`! 11 // edit control
1182 #define GADGET_EDITBOXNUMcxx . . $ `Descent3/newui_core.cpp:1182:9`! 12 // edit control
1183 #define GADGET_LISTBOXcxx . . $ `Descent3/newui_core.cpp:1183:9`! 13 // listbox
1184 #define GADGET_STATIC_BMPcxx . . $ `Descent3/newui_core.cpp:1184:9`! 14 // static bitmap
1185 #define GADGET_COMBOBOXcxx . . $ `Descent3/newui_core.cpp:1185:9`! 15 // combo box
1186 #define GADGET_HOTSPOTcxx . . $ `Descent3/newui_core.cpp:1186:9`! 16 // hotspot
1187 #define GADGET_CHANGEABLE_TXTcxx . . $ `Descent3/newui_core.cpp:1187:9`! 17 // changeable text
1188
1189 newuiSheetcxx . . $ newuiSheet#::newuiSheetcxx . . $ newuiSheet#newuiSheet(49f6e7a06ebc5aa8).() {
1190 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1191 m_gadgetlimitcxx . . $ newuiSheet#m_gadgetlimit. = 0;
1192 m_ngadgetscxx . . $ newuiSheet#m_ngadgets. = 0;
1193 m_realizedcxx . . $ newuiSheet#m_realized. = false;
1194 }
1195
1196 void newuiSheetcxx . . $ newuiSheet#::Createcxx . . $ newuiSheet#Create(d9d4491c5dd23a91).(UIWindowcxx . . $ UIWindow# *menu, const char *title, int n_items, int sx, int sy) {
1197 int i;
1198
1199 if (title) {
1200 m_titlecxx . . $ newuiSheet#m_title. = mem_strdupcxx . . $ `mem/mem.h:81:9`!(title);
1201 } else {
1202 m_titlecxx . . $ newuiSheet#m_title. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1203 }
1204 m_gadgetlimitcxx . . $ newuiSheet#m_gadgetlimit. = n_items;
1205 m_ngadgetscxx . . $ newuiSheet#m_ngadgets. = 0;
1206 if (n_items) {
1207 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist. = (newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(n_items * sizeof(newuiSheet::t_gadget_desc));
1208 } else {
1209 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1210 }
1211
1212 m_parentcxx . . $ newuiSheet#m_parent. = menu;
1213 m_sxcxx . . $ newuiSheet#m_sx. = sx;
1214 m_sycxx . . $ newuiSheet#m_sy. = sy;
1215 m_realizedcxx . . $ newuiSheet#m_realized. = false;
1216 m_initial_focus_idcxx . . $ newuiSheet#m_initial_focus_id. = -1;
1217
1218 for (i = 0; i < m_gadgetlimitcxx . . $ newuiSheet#m_gadgetlimit.; i++) {
1219 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1220 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].titlecxx . . $ newuiSheet#t_gadget_desc#title. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1221 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].idcxx . . $ newuiSheet#t_gadget_desc#id. = -1;
1222 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].internalcxx . . $ newuiSheet#t_gadget_desc#internal. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1223 }
1224 }
1225
1226 // deallocates memory
1227 void newuiSheetcxx . . $ newuiSheet#::Destroycxx . . $ newuiSheet#Destroy(49f6e7a06ebc5aa8).() {
1228 Unrealizecxx . . $ newuiSheet#Unrealize(49f6e7a06ebc5aa8).();
1229
1230 newuiSheetcxx . . $ newuiSheet#::Resetcxx . . $ newuiSheet#Reset(49f6e7a06ebc5aa8).();
1231
1232 if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.)
1233 mem_freecxx . . $ `mem/mem.h:80:9`!(m_gadgetlist);
1234 if (m_titlecxx . . $ newuiSheet#m_title.)
1235 mem_freecxx . . $ `mem/mem.h:80:9`!(m_title);
1236 m_titlecxx . . $ newuiSheet#m_title. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1237 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1238 m_ngadgetscxx . . $ newuiSheet#m_ngadgets. = 0;
1239 }
1240
1241 void newuiSheetcxx . . $ newuiSheet#::Resetcxx . . $ newuiSheet#Reset(49f6e7a06ebc5aa8).() {
1242 int i;
1243
1244 ASSERTcxx . . $ `misc/pserror.h:246:9`!(!m_realized);
1245
1246 for (i = 0; i < m_ngadgetscxx . . $ newuiSheet#m_ngadgets.; i++) {
1247 if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].titlecxx . . $ newuiSheet#t_gadget_desc#title.) {
1248 mem_freecxx . . $ `mem/mem.h:80:9`!(m_gadgetlist[i].title);
1249 }
1250 if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].internalcxx . . $ newuiSheet#t_gadget_desc#internal.) {
1251 if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].typecxx . . $ newuiSheet#t_gadget_desc#type. == GADGET_LISTBOXcxx . . $ `Descent3/newui_core.cpp:1183:9`!) {
1252 newuiListBoxcxx . . $ newuiListBox# *lb = (newuiListBoxcxx . . $ newuiListBox# *)m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].internalcxx . . $ newuiSheet#t_gadget_desc#internal.;
1253 lb->Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1254 delete lb;
1255 } else if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].typecxx . . $ newuiSheet#t_gadget_desc#type. == GADGET_SLIDERcxx . . $ `Descent3/newui_core.cpp:1179:9`!) {
1256 mem_freecxx . . $ `mem/mem.h:80:9`!(m_gadgetlist[i].internal);
1257 } else if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].typecxx . . $ newuiSheet#t_gadget_desc#type. == GADGET_EDITBOXcxx . . $ `Descent3/newui_core.cpp:1180:9`! || m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].typecxx . . $ newuiSheet#t_gadget_desc#type. == GADGET_EDITBOXNUMcxx . . $ `Descent3/newui_core.cpp:1182:9`! ||
1258 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].typecxx . . $ newuiSheet#t_gadget_desc#type. == GADGET_EDITBOXPASScxx . . $ `Descent3/newui_core.cpp:1181:9`!) {
1259 mem_freecxx . . $ `mem/mem.h:80:9`!(m_gadgetlist[i].internal);
1260 } else if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].typecxx . . $ newuiSheet#t_gadget_desc#type. == GADGET_COMBOBOXcxx . . $ `Descent3/newui_core.cpp:1185:9`!) {
1261 newuiComboBoxcxx . . $ newuiComboBox# *cb = (newuiComboBoxcxx . . $ newuiComboBox# *)m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].internalcxx . . $ newuiSheet#t_gadget_desc#internal.;
1262 cb->Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1263 delete cb;
1264 } else if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].typecxx . . $ newuiSheet#t_gadget_desc#type. == GADGET_CHANGEABLE_TXTcxx . . $ `Descent3/newui_core.cpp:1187:9`!) {
1265 mem_freecxx . . $ `mem/mem.h:80:9`!(m_gadgetlist[i].parm.p);
1266 } else if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].typecxx . . $ newuiSheet#t_gadget_desc#type. != GADGET_HOTSPOTcxx . . $ `Descent3/newui_core.cpp:1186:9`!) {
1267 Int3cxx . . $ `misc/pserror.h:247:9`!(); // get samir.
1268 }
1269 }
1270 }
1271
1272 m_ngadgetscxx . . $ newuiSheet#m_ngadgets. = 0;
1273 m_initial_focus_idcxx . . $ newuiSheet#m_initial_focus_id. = -1;
1274 }
1275
1276 // set focus on this gadget specified by id upon realization.
1277 void newuiSheetcxx . . $ newuiSheet#::SetInitialFocusedGadgetcxx . . $ newuiSheet#SetInitialFocusedGadget(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# id) { m_initial_focus_idcxx . . $ newuiSheet#m_initial_focus_id. = id; }
1278
1279 // call this to initialize gadgets specified above in parent window
1280 void newuiSheetcxx . . $ newuiSheet#::Realizecxx . . $ newuiSheet#Realize(49f6e7a06ebc5aa8).() {
1281 int i, first_radio_index = -1, last_toggle_index = -1, gx = m_sxcxx . . $ newuiSheet#m_sx., gy = m_sycxx . . $ newuiSheet#m_sy.;
1282 newuiRadioButtoncxx . . $ newuiRadioButton# *prev_radio = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1283 bool horizontal_align = false, hotspot_group = false, toggles_group = false;
1284 newuiEditBoxcxx . . $ newuiEditBox# *focus_edit = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1285 UIGadgetcxx . . $ UIGadget# *focus_gadget = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1286
1287 if (m_realizedcxx . . $ newuiSheet#m_realized.)
1288 return;
1289
1290 for (i = 0; i < m_ngadgetscxx . . $ newuiSheet#m_ngadgets.; i++) {
1291 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *desc = &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i];
1292 newuiButtoncxx . . $ newuiButton# *btn;
1293 newuiCheckBoxcxx . . $ newuiCheckBox# *cbox;
1294 newuiRadioButtoncxx . . $ newuiRadioButton# *radio;
1295 newuiSlidercxx . . $ newuiSlider# *slider;
1296 newuiListBoxcxx . . $ newuiListBox# *lb;
1297 newuiEditBoxcxx . . $ newuiEditBox# *edit;
1298 newuiComboBoxcxx . . $ newuiComboBox# *cb;
1299 newuiHotspotcxx . . $ newuiHotspot# *hot;
1300 UITextcxx . . $ UIText# *text;
1301 UIStaticcxx . . $ UIStatic# *bmp;
1302 int16_tcxx . . $ int16_t# flags;
1303 bool bval;
1304
1305 switch (desc->typecxx . . $ newuiSheet#t_gadget_desc#type.) {
1306 case GADGET_HGROUPcxx . . $ `Descent3/newui_core.cpp:1171:9`!:
1307 case GADGET_GROUPcxx . . $ `Descent3/newui_core.cpp:1170:9`!:
1308 horizontal_align = (desc->typecxx . . $ newuiSheet#t_gadget_desc#type. == GADGET_GROUPcxx . . $ `Descent3/newui_core.cpp:1170:9`!) ? false : true;
1309 gx = desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] + m_sxcxx . . $ newuiSheet#m_sx.;
1310 gy = desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[1] + m_sycxx . . $ newuiSheet#m_sy.;
1311 if (desc->titlecxx . . $ newuiSheet#t_gadget_desc#title.) {
1312 text = new UITextcxx . . $ UIText#;
1313 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, desc->titlecxx . . $ newuiSheet#t_gadget_desc#title., NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!};
1314 text->Createcxx . . $ UIText#Create(c90f152919fa414d).(m_parentcxx . . $ newuiSheet#m_parent., &item, gx, gy);
1315 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget. = text;
1316
1317 // determine pixel offset to first control if we stuffed the offset into desc->id (-1 = default)
1318 if (desc->idcxx . . $ newuiSheet#t_gadget_desc#id. != -1) {
1319 gy += text->Hcxx . . $ UIObject#H(455f465bc33b4cdf).() + desc->idcxx . . $ newuiSheet#t_gadget_desc#id.;
1320 } else {
1321 gy += text->Hcxx . . $ UIObject#H(455f465bc33b4cdf).();
1322 }
1323 } else {
1324 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1325 }
1326
1327 if (toggles_group && last_toggle_index != -1) {
1328 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *desc = &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[last_toggle_index];
1329 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox.->SetFlagcxx . . $ UIGadget#SetFlag(d4f767463ce0a6b3).(UIF_GROUP_ENDcxx . . $ `ui/ui.h:350:9`!);
1330 }
1331
1332 prev_radio = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1333 hotspot_group = false;
1334 toggles_group = false;
1335 first_radio_index = -1;
1336 last_toggle_index = -1;
1337 break;
1338
1339 case GADGET_STATIC_TXTcxx . . $ `Descent3/newui_core.cpp:1172:9`!: {
1340 text = new UITextcxx . . $ UIText#;
1341 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, desc->titlecxx . . $ newuiSheet#t_gadget_desc#title., NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!};
1342 text->Createcxx . . $ UIText#Create(c90f152919fa414d).(m_parentcxx . . $ newuiSheet#m_parent., &item, gx, gy);
1343 if (horizontal_align)
1344 gx += text->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 2;
1345 else
1346 gy += text->Hcxx . . $ UIObject#H(455f465bc33b4cdf).();
1347 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget. = text;
1348 break;
1349 }
1350 case GADGET_CHANGEABLE_TXTcxx . . $ `Descent3/newui_core.cpp:1187:9`!: {
1351 text = new UITextcxx . . $ UIText#;
1352 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, (const char *)desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..pcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#p., NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!};
1353 text->Createcxx . . $ UIText#Create(c90f152919fa414d).(m_parentcxx . . $ newuiSheet#m_parent., &item, gx, gy);
1354 if (horizontal_align)
1355 gx += text->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 2;
1356 else
1357 gy += text->Hcxx . . $ UIObject#H(455f465bc33b4cdf).();
1358 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..textcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#text. = text;
1359 break;
1360 }
1361
1362 case GADGET_STATIC_BMPcxx . . $ `Descent3/newui_core.cpp:1184:9`!: {
1363 bmp = new UIStaticcxx . . $ UIStatic#;
1364 UIBitmapItemcxx . . $ UIBitmapItem# itemcxx . . $ UIBitmapItem#UIBitmapItem(9633529ce3c4ff50).{desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i.};
1365 bmp->Createcxx . . $ UIStatic#Create(8745842b033f01b8).(m_parentcxx . . $ newuiSheet#m_parent., &item, gx, gy, 10, 10);
1366 if (horizontal_align)
1367 gx += bmp->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 2;
1368 else
1369 gy += bmp->Hcxx . . $ UIObject#H(455f465bc33b4cdf).();
1370 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget. = bmp;
1371 break;
1372 }
1373 case GADGET_BUTTONcxx . . $ `Descent3/newui_core.cpp:1173:9`!:
1374 btn = new newuiButtoncxx . . $ newuiButton#newuiButton(49f6e7a06ebc5aa8).;
1375 btn->Createcxx . . $ newuiButton#Create(6c82988af4899650).(m_parentcxx . . $ newuiSheet#m_parent., desc->idcxx . . $ newuiSheet#t_gadget_desc#id., desc->titlecxx . . $ newuiSheet#t_gadget_desc#title., gx, gy, desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i.);
1376 if (horizontal_align)
1377 gx += btn->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 2;
1378 else
1379 gy += btn->Hcxx . . $ UIObject#H(455f465bc33b4cdf).();
1380 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..buttoncxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#button. = btn;
1381 break;
1382
1383 case GADGET_CHECKBOXcxx . . $ `Descent3/newui_core.cpp:1174:9`!:
1384 cbox = new newuiCheckBoxcxx . . $ newuiCheckBox#newuiCheckBox(49f6e7a06ebc5aa8).;
1385 cbox->Createcxx . . $ newuiCheckBox#Create(88ee86519b70f83b).(m_parentcxx . . $ newuiSheet#m_parent., desc->idcxx . . $ newuiSheet#t_gadget_desc#id., desc->titlecxx . . $ newuiSheet#t_gadget_desc#title., gx, gy, false);
1386 if (!toggles_group) {
1387 toggles_group = true;
1388 cbox->SetFlagcxx . . $ UIGadget#SetFlag(d4f767463ce0a6b3).(UIF_GROUP_STARTcxx . . $ `ui/ui.h:349:9`!);
1389 }
1390 last_toggle_index = i;
1391 if (desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b.)
1392 cbox->SetCheckcxx . . $ UICheckBox#SetCheck(b45ddcbc8423892c).(true);
1393 if (horizontal_align)
1394 gx += cbox->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 2;
1395 else
1396 gy += cbox->Hcxx . . $ UIObject#H(455f465bc33b4cdf).();
1397 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox. = cbox;
1398 break;
1399
1400 case GADGET_RADIOcxx . . $ `Descent3/newui_core.cpp:1175:9`!:
1401 if (first_radio_index == -1)
1402 first_radio_index = i;
1403 radio = new newuiRadioButtoncxx . . $ newuiRadioButton#newuiRadioButton(49f6e7a06ebc5aa8).;
1404 radio->Createcxx . . $ newuiRadioButton#Create(7778cd589e48544c).(m_parentcxx . . $ newuiSheet#m_parent., prev_radio, desc->idcxx . . $ newuiSheet#t_gadget_desc#id., desc->titlecxx . . $ newuiSheet#t_gadget_desc#title., gx, gy, false);
1405 if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[first_radio_index].parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. == (i - first_radio_index)) {
1406 radio->Activatecxx . . $ UIRadioButton#Activate(49f6e7a06ebc5aa8).();
1407 }
1408 if (horizontal_align)
1409 gx += radio->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 2;
1410 else
1411 gy += radio->Hcxx . . $ UIObject#H(455f465bc33b4cdf).();
1412 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..radiocxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#radio. = radio;
1413 prev_radio = radio;
1414 break;
1415
1416 case GADGET_LBUTTONcxx . . $ `Descent3/newui_core.cpp:1176:9`!:
1417 btn = new newuiButtoncxx . . $ newuiButton#newuiButton(49f6e7a06ebc5aa8).;
1418 btn->Createcxx . . $ newuiButton#Create(6c82988af4899650).(m_parentcxx . . $ newuiSheet#m_parent., desc->idcxx . . $ newuiSheet#t_gadget_desc#id., desc->titlecxx . . $ newuiSheet#t_gadget_desc#title., gx, gy, desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. | NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!);
1419 if (horizontal_align)
1420 gx += btn->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 2;
1421 else
1422 gy += btn->Hcxx . . $ UIObject#H(455f465bc33b4cdf).();
1423 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..buttoncxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#button. = btn;
1424 break;
1425
1426 case GADGET_LCHECKBOXcxx . . $ `Descent3/newui_core.cpp:1177:9`!:
1427 cbox = new newuiCheckBoxcxx . . $ newuiCheckBox#newuiCheckBox(49f6e7a06ebc5aa8).;
1428 cbox->Createcxx . . $ newuiCheckBox#Create(88ee86519b70f83b).(m_parentcxx . . $ newuiSheet#m_parent., desc->idcxx . . $ newuiSheet#t_gadget_desc#id., desc->titlecxx . . $ newuiSheet#t_gadget_desc#title., gx, gy, true);
1429 if (!toggles_group) {
1430 toggles_group = true;
1431 cbox->SetFlagcxx . . $ UIGadget#SetFlag(d4f767463ce0a6b3).(UIF_GROUP_STARTcxx . . $ `ui/ui.h:349:9`!);
1432 }
1433 last_toggle_index = i;
1434 if (desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b.)
1435 cbox->SetCheckcxx . . $ UICheckBox#SetCheck(b45ddcbc8423892c).(true);
1436 if (horizontal_align)
1437 gx += cbox->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 2;
1438 else
1439 gy += cbox->Hcxx . . $ UIObject#H(455f465bc33b4cdf).();
1440 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox. = cbox;
1441 break;
1442
1443 case GADGET_LRADIOcxx . . $ `Descent3/newui_core.cpp:1178:9`!:
1444 if (first_radio_index == -1)
1445 first_radio_index = i;
1446 radio = new newuiRadioButtoncxx . . $ newuiRadioButton#newuiRadioButton(49f6e7a06ebc5aa8).;
1447 radio->Createcxx . . $ newuiRadioButton#Create(7778cd589e48544c).(m_parentcxx . . $ newuiSheet#m_parent., prev_radio, desc->idcxx . . $ newuiSheet#t_gadget_desc#id., desc->titlecxx . . $ newuiSheet#t_gadget_desc#title., gx, gy, true);
1448 if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[first_radio_index].parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. == (i - first_radio_index)) {
1449 radio->Activatecxx . . $ UIRadioButton#Activate(49f6e7a06ebc5aa8).();
1450 }
1451 if (horizontal_align)
1452 gx += radio->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 2;
1453 else
1454 gy += radio->Hcxx . . $ UIObject#H(455f465bc33b4cdf).();
1455 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..radiocxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#radio. = radio;
1456 prev_radio = radio;
1457 break;
1458
1459 case GADGET_HOTSPOTcxx . . $ `Descent3/newui_core.cpp:1186:9`!:
1460 hot = new newuiHotspotcxx . . $ newuiHotspot#newuiHotspot(49f6e7a06ebc5aa8).;
1461 bval = desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal. ? true : false;
1462 hot->Createcxx . . $ newuiHotspot#Create(c5b4ce760113345f).(m_parentcxx . . $ newuiSheet#m_parent., desc->idcxx . . $ newuiSheet#t_gadget_desc#id., desc->titlecxx . . $ newuiSheet#t_gadget_desc#title., gx, gy, desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0], desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[1],
1463 (bval && !hotspot_group) ? UIF_GROUP_STARTcxx . . $ `ui/ui.h:349:9`!
1464 : (bval && hotspot_group) ? UIF_GROUP_ENDcxx . . $ `ui/ui.h:350:9`!
1465 : 0);
1466
1467 if (bval && !hotspot_group) {
1468 hotspot_group = true;
1469 } else if (bval && hotspot_group) {
1470 hotspot_group = false;
1471 }
1472
1473 if (horizontal_align)
1474 gx += hot->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 2;
1475 else
1476 gy += hot->Hcxx . . $ UIObject#H(455f465bc33b4cdf).();
1477 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..hotcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#hot. = hot;
1478 break;
1479
1480 case GADGET_SLIDERcxx . . $ `Descent3/newui_core.cpp:1179:9`!:
1481 slider = new newuiSlidercxx . . $ newuiSlider#newuiSlider(49f6e7a06ebc5aa8).;
1482 slider->Createcxx . . $ newuiSlider#Create(6c82988af4899650).(m_parentcxx . . $ newuiSheet#m_parent., desc->idcxx . . $ newuiSheet#t_gadget_desc#id., desc->titlecxx . . $ newuiSheet#t_gadget_desc#title., gx, gy, desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[1]);
1483 slider->SetPoscxx . . $ newuiSlider#SetPos(68e3ae50fe6578a9).(desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0]);
1484 if (desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal.) {
1485 slider->SetUnitscxx . . $ newuiSlider#SetUnits(4353f1a13209e2eb).((tSliderSettingscxx . . $ tSliderSettings# *)desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal.);
1486 }
1487 if (horizontal_align)
1488 gx += slider->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 4;
1489 else
1490 gy += slider->Hcxx . . $ UIObject#H(455f465bc33b4cdf).() + 2;
1491 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..slidercxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#slider. = slider;
1492 break;
1493
1494 case GADGET_EDITBOXcxx . . $ `Descent3/newui_core.cpp:1180:9`!:
1495 case GADGET_EDITBOXPASScxx . . $ `Descent3/newui_core.cpp:1181:9`!:
1496 case GADGET_EDITBOXNUMcxx . . $ `Descent3/newui_core.cpp:1182:9`!:
1497 ASSERTcxx . . $ `misc/pserror.h:246:9`!(desc->internal);
1498 edit = new newuiEditBoxcxx . . $ newuiEditBox#newuiEditBox(49f6e7a06ebc5aa8).;
1499 flags = (desc->typecxx . . $ newuiSheet#t_gadget_desc#type. == GADGET_EDITBOXPASScxx . . $ `Descent3/newui_core.cpp:1181:9`!) ? UIED_PASSWORDcxx . . $ `ui/ui.h:361:9`! : (desc->typecxx . . $ newuiSheet#t_gadget_desc#type. == GADGET_EDITBOXNUMcxx . . $ `Descent3/newui_core.cpp:1182:9`!) ? UIED_NUMBERScxx . . $ `ui/ui.h:362:9`! : 0;
1500
1501 // awful hack, but no more room to store passed in parameters. note that we should never have an edit
1502 // box with a width greater than 4096 pixels in the lifetime of this system.
1503 edit->Createcxx . . $ newuiEditBox#Create(3c6611c2642a6f36).(m_parentcxx . . $ newuiSheet#m_parent., desc->idcxx . . $ newuiSheet#t_gadget_desc#id., desc->titlecxx . . $ newuiSheet#t_gadget_desc#title., gx, gy, (desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] & 0xfff), flags);
1504 edit->SetBufferLencxx . . $ UIEdit#SetBufferLen(d4f767463ce0a6b3).(desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[1]);
1505 edit->SetTextcxx . . $ UIEdit#SetText(85c52e162fed56f9).((char *)desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal.);
1506
1507 if (desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] & 0x1000) {
1508 edit->EnableOnQuickEscapeBehaviorcxx . . $ newuiEditBox#EnableOnQuickEscapeBehavior(b45ddcbc8423892c).(true);
1509 }
1510
1511 if (!focus_edit) {
1512 focus_edit = edit;
1513 }
1514
1515 if (horizontal_align)
1516 gx += edit->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 4;
1517 else
1518 gy += edit->Hcxx . . $ UIObject#H(455f465bc33b4cdf).() + 2;
1519 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..editcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#edit. = edit;
1520 break;
1521
1522 case GADGET_LISTBOXcxx . . $ `Descent3/newui_core.cpp:1183:9`!:
1523 lb = (newuiListBoxcxx . . $ newuiListBox# *)desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal.;
1524 ASSERTcxx . . $ `misc/pserror.h:246:9`!(lb);
1525 lb->Movecxx . . $ UIObject#Move(748afa4755bc9595).(gx, gy, lb->Wcxx . . $ UIObject#W(455f465bc33b4cdf).(), lb->Hcxx . . $ UIObject#H(455f465bc33b4cdf).());
1526 m_parentcxx . . $ newuiSheet#m_parent.->AddGadgetcxx . . $ UIWindow#AddGadget(627f6e6cf27f18b7).(lb);
1527 if (horizontal_align)
1528 gx += lb->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 4;
1529 else
1530 gy += lb->Hcxx . . $ UIObject#H(455f465bc33b4cdf).() + 2;
1531 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..lbcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#lb. = lb;
1532 break;
1533
1534 case GADGET_COMBOBOXcxx . . $ `Descent3/newui_core.cpp:1185:9`!:
1535 cb = (newuiComboBoxcxx . . $ newuiComboBox# *)desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal.;
1536 ASSERTcxx . . $ `misc/pserror.h:246:9`!(cb);
1537 cb->Movecxx . . $ UIObject#Move(748afa4755bc9595).(gx, gy, cb->Wcxx . . $ UIObject#W(455f465bc33b4cdf).(), cb->Hcxx . . $ UIObject#H(455f465bc33b4cdf).());
1538 m_parentcxx . . $ newuiSheet#m_parent.->AddGadgetcxx . . $ UIWindow#AddGadget(627f6e6cf27f18b7).(cb);
1539 if (horizontal_align)
1540 gx += cb->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + 4;
1541 else
1542 gy += cb->Hcxx . . $ UIObject#H(455f465bc33b4cdf).() + 2;
1543 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..cbcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#cb. = cb;
1544 break;
1545
1546 default:
1547 Int3cxx . . $ `misc/pserror.h:247:9`!();
1548 }
1549 desc->changedcxx . . $ newuiSheet#t_gadget_desc#changed. = false;
1550
1551 if (desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.) {
1552 if (desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.->GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).() > -1 && desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.->GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).() == m_initial_focus_idcxx . . $ newuiSheet#m_initial_focus_id.) {
1553 focus_gadget = desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.;
1554 }
1555 }
1556 }
1557
1558 if (toggles_group) {
1559 if (last_toggle_index != -1) {
1560 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *desc = &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[last_toggle_index];
1561 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox.->SetFlagcxx . . $ UIGadget#SetFlag(d4f767463ce0a6b3).(UIF_GROUP_ENDcxx . . $ `ui/ui.h:350:9`!);
1562 }
1563 toggles_group = false;
1564 }
1565
1566 if (focus_gadget) {
1567 m_parentcxx . . $ newuiSheet#m_parent.->SetFocusOnGadgetcxx . . $ UIWindow#SetFocusOnGadget(75ffd377f9406104).(focus_gadget);
1568 } else if (focus_edit) {
1569 m_parentcxx . . $ newuiSheet#m_parent.->SetFocusOnGadgetcxx . . $ UIWindow#SetFocusOnGadget(75ffd377f9406104).(focus_edit);
1570 focus_edit->Activatecxx . . $ UIEdit#Activate(49f6e7a06ebc5aa8).();
1571 }
1572
1573 m_realizedcxx . . $ newuiSheet#m_realized. = true;
1574 }
1575
1576 // call this to release gadgets specified above in parent window
1577 void newuiSheetcxx . . $ newuiSheet#::Unrealizecxx . . $ newuiSheet#Unrealize(49f6e7a06ebc5aa8).() {
1578 int i, first_radio_index = -1;
1579
1580 if (!m_realizedcxx . . $ newuiSheet#m_realized.)
1581 return;
1582
1583 for (i = 0; i < m_ngadgetscxx . . $ newuiSheet#m_ngadgets.; i++) {
1584 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *desc = &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i];
1585
1586 if (desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.) {
1587 switch (desc->typecxx . . $ newuiSheet#t_gadget_desc#type.) {
1588 case GADGET_HGROUPcxx . . $ `Descent3/newui_core.cpp:1171:9`!:
1589 case GADGET_GROUPcxx . . $ `Descent3/newui_core.cpp:1170:9`!:
1590 first_radio_index = -1;
1591 if (desc->titlecxx . . $ newuiSheet#t_gadget_desc#title. && desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.) {
1592 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.->Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1593 delete desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.;
1594 }
1595 break;
1596 case GADGET_LCHECKBOXcxx . . $ `Descent3/newui_core.cpp:1177:9`!:
1597 case GADGET_CHECKBOXcxx . . $ `Descent3/newui_core.cpp:1174:9`!:
1598 desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b. = desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox.->IsCheckedcxx . . $ UICheckBox#IsChecked(50ce9a9e25b4a850).();
1599 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox.->Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1600 delete desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox.;
1601 break;
1602 case GADGET_RADIOcxx . . $ `Descent3/newui_core.cpp:1175:9`!:
1603 case GADGET_LRADIOcxx . . $ `Descent3/newui_core.cpp:1178:9`!:
1604 if (first_radio_index == -1)
1605 first_radio_index = i;
1606 if (desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..radiocxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#radio.->IsActivatedcxx . . $ UIRadioButton#IsActivated(50ce9a9e25b4a850).()) {
1607 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[first_radio_index].parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. = i - first_radio_index;
1608 }
1609 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..radiocxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#radio.->Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1610 delete desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..radiocxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#radio.;
1611 break;
1612 case GADGET_SLIDERcxx . . $ `Descent3/newui_core.cpp:1179:9`!:
1613 desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] = desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..slidercxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#slider.->GetPoscxx . . $ newuiSlider#GetPos(524863554b4a534e).();
1614 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..slidercxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#slider.->Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1615 delete desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..slidercxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#slider.;
1616 break;
1617
1618 case GADGET_HOTSPOTcxx . . $ `Descent3/newui_core.cpp:1186:9`!:
1619 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..hotcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#hot.->Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1620 delete desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..hotcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#hot.;
1621 break;
1622
1623 case GADGET_BUTTONcxx . . $ `Descent3/newui_core.cpp:1173:9`!:
1624 case GADGET_LBUTTONcxx . . $ `Descent3/newui_core.cpp:1176:9`!:
1625 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..buttoncxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#button.->Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1626 delete desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..buttoncxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#button.;
1627 break;
1628
1629 case GADGET_LISTBOXcxx . . $ `Descent3/newui_core.cpp:1183:9`!:
1630 m_parentcxx . . $ newuiSheet#m_parent.->RemoveGadgetcxx . . $ UIWindow#RemoveGadget(627f6e6cf27f18b7).(desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..lbcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#lb.);
1631 break;
1632
1633 case GADGET_COMBOBOXcxx . . $ `Descent3/newui_core.cpp:1185:9`!:
1634 m_parentcxx . . $ newuiSheet#m_parent.->RemoveGadgetcxx . . $ UIWindow#RemoveGadget(627f6e6cf27f18b7).(desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..cbcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#cb.);
1635 break;
1636
1637 case GADGET_EDITBOXcxx . . $ `Descent3/newui_core.cpp:1180:9`!:
1638 case GADGET_EDITBOXPASScxx . . $ `Descent3/newui_core.cpp:1181:9`!:
1639 case GADGET_EDITBOXNUMcxx . . $ `Descent3/newui_core.cpp:1182:9`!:
1640 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..editcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#edit.->GetTextcxx . . $ UIEdit#GetText(a07d8cccb7673f5a).((char *)desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal., (desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[1]) + 1);
1641 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..editcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#edit.->Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1642 delete desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..editcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#edit.;
1643 break;
1644
1645 case GADGET_CHANGEABLE_TXTcxx . . $ `Descent3/newui_core.cpp:1187:9`!:
1646 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..textcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#text.->Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1647 delete desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.;
1648 break;
1649
1650 default:
1651 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.->Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
1652 delete desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.;
1653 }
1654
1655 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1656 }
1657 }
1658
1659 m_realizedcxx . . $ newuiSheet#m_realized. = false;
1660 }
1661
1662 // refreshes gadget states with values passed to the pointers returned by the below functions.
1663 void newuiSheetcxx . . $ newuiSheet#::UpdateChangescxx . . $ newuiSheet#UpdateChanges(49f6e7a06ebc5aa8).() {
1664 int i, first_radio_index = 0;
1665
1666 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_realized);
1667
1668 for (i = 0; i < m_ngadgetscxx . . $ newuiSheet#m_ngadgets.; i++) {
1669 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *desc = &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i];
1670 bool bval;
1671 int16_tcxx . . $ int16_t# sval;
1672 char sbuftest[EDIT_BUFLEN_MAXcxx . . $ `Descent3/newui_core.cpp:372:9`!];
1673
1674 switch (desc->typecxx . . $ newuiSheet#t_gadget_desc#type.) {
1675 case GADGET_HGROUPcxx . . $ `Descent3/newui_core.cpp:1171:9`!:
1676 case GADGET_GROUPcxx . . $ `Descent3/newui_core.cpp:1170:9`!:
1677 first_radio_index = -1;
1678 break;
1679
1680 case GADGET_LCHECKBOXcxx . . $ `Descent3/newui_core.cpp:1177:9`!:
1681 case GADGET_CHECKBOXcxx . . $ `Descent3/newui_core.cpp:1174:9`!:
1682 bval = desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox.->IsCheckedcxx . . $ UICheckBox#IsChecked(50ce9a9e25b4a850).();
1683 if (desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b. != bval) {
1684 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox.->SetCheckcxx . . $ UICheckBox#SetCheck(b45ddcbc8423892c).(desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b.);
1685 }
1686 break;
1687
1688 case GADGET_LRADIOcxx . . $ `Descent3/newui_core.cpp:1178:9`!:
1689 case GADGET_RADIOcxx . . $ `Descent3/newui_core.cpp:1175:9`!:
1690 // check if new index is same as current index.
1691 if (first_radio_index == -1)
1692 first_radio_index = i;
1693 if (m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[first_radio_index].parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. == (i - first_radio_index)) {
1694 // possible request for change of radio button state here.
1695 bval = desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..radiocxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#radio.->IsActivatedcxx . . $ UIRadioButton#IsActivated(50ce9a9e25b4a850).();
1696 if (!bval) {
1697 // wasn't active before so lets activate it now.
1698 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..radiocxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#radio.->Activatecxx . . $ UIRadioButton#Activate(49f6e7a06ebc5aa8).();
1699 }
1700 }
1701 break;
1702
1703 case GADGET_SLIDERcxx . . $ `Descent3/newui_core.cpp:1179:9`!:
1704 sval = desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..slidercxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#slider.->GetPoscxx . . $ newuiSlider#GetPos(524863554b4a534e).();
1705 if (desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] != sval) {
1706 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..slidercxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#slider.->SetPoscxx . . $ newuiSlider#SetPos(68e3ae50fe6578a9).(desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0]);
1707 desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] = desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..slidercxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#slider.->GetPoscxx . . $ newuiSlider#GetPos(524863554b4a534e).();
1708 }
1709 break;
1710
1711 case GADGET_EDITBOXcxx . . $ `Descent3/newui_core.cpp:1180:9`!:
1712 case GADGET_EDITBOXNUMcxx . . $ `Descent3/newui_core.cpp:1182:9`!:
1713 case GADGET_EDITBOXPASScxx . . $ `Descent3/newui_core.cpp:1181:9`!:
1714 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..editcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#edit.->GetTextcxx . . $ UIEdit#GetText(a07d8cccb7673f5a).(sbuftest, EDIT_BUFLEN_MAXcxx . . $ `Descent3/newui_core.cpp:372:9`!);
1715 if (strcmp(sbuftest, (char *)desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal.) != 0) {
1716 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..editcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#edit.->SetTextcxx . . $ UIEdit#SetText(85c52e162fed56f9).((const char *) desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal.);
1717 }
1718 break;
1719
1720 case GADGET_CHANGEABLE_TXTcxx . . $ `Descent3/newui_core.cpp:1187:9`!: {
1721 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, (const char *)desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..pcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#p., NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!};
1722 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..textcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#text.->SetTitlecxx . . $ UIStatic#SetTitle(52afca12b6cce14a).(&item);
1723 break;
1724 }
1725 }
1726 desc->changedcxx . . $ newuiSheet#t_gadget_desc#changed. = false;
1727 }
1728 }
1729
1730 // refreshes return values of gadgets, so they are accessible by the pointers returned by below functions
1731 void newuiSheetcxx . . $ newuiSheet#::UpdateReturnValuescxx . . $ newuiSheet#UpdateReturnValues(49f6e7a06ebc5aa8).() {
1732 int i, first_radio_index = -1;
1733
1734 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_realized);
1735
1736 for (i = 0; i < m_ngadgetscxx . . $ newuiSheet#m_ngadgets.; i++) {
1737 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *desc = &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i];
1738 bool bval;
1739 int16_tcxx . . $ int16_t# sval;
1740 char sbuftest[EDIT_BUFLEN_MAXcxx . . $ `Descent3/newui_core.cpp:372:9`!];
1741
1742 if (desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.) {
1743 switch (desc->typecxx . . $ newuiSheet#t_gadget_desc#type.) {
1744 case GADGET_HGROUPcxx . . $ `Descent3/newui_core.cpp:1171:9`!:
1745 case GADGET_GROUPcxx . . $ `Descent3/newui_core.cpp:1170:9`!:
1746 first_radio_index = -1;
1747 break;
1748 case GADGET_LCHECKBOXcxx . . $ `Descent3/newui_core.cpp:1177:9`!:
1749 case GADGET_CHECKBOXcxx . . $ `Descent3/newui_core.cpp:1174:9`!:
1750 bval = desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox.->IsCheckedcxx . . $ UICheckBox#IsChecked(50ce9a9e25b4a850).();
1751 if (desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b. != bval) {
1752 desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b. = bval;
1753 desc->changedcxx . . $ newuiSheet#t_gadget_desc#changed. = true;
1754 }
1755 break;
1756 case GADGET_RADIOcxx . . $ `Descent3/newui_core.cpp:1175:9`!:
1757 case GADGET_LRADIOcxx . . $ `Descent3/newui_core.cpp:1178:9`!:
1758 if (first_radio_index == -1)
1759 first_radio_index = i;
1760 bval = desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..radiocxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#radio.->IsActivatedcxx . . $ UIRadioButton#IsActivated(50ce9a9e25b4a850).();
1761 if (bval && m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[first_radio_index].parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. != (i - first_radio_index)) {
1762 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[first_radio_index].parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. = (i - first_radio_index);
1763 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[first_radio_index].changedcxx . . $ newuiSheet#t_gadget_desc#changed. = true;
1764 }
1765 break;
1766 case GADGET_SLIDERcxx . . $ `Descent3/newui_core.cpp:1179:9`!:
1767 sval = desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..slidercxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#slider.->GetPoscxx . . $ newuiSlider#GetPos(524863554b4a534e).();
1768 if (desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] != sval) {
1769 desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] = sval;
1770 desc->changedcxx . . $ newuiSheet#t_gadget_desc#changed. = true;
1771 }
1772 break;
1773
1774 case GADGET_EDITBOXcxx . . $ `Descent3/newui_core.cpp:1180:9`!:
1775 case GADGET_EDITBOXNUMcxx . . $ `Descent3/newui_core.cpp:1182:9`!:
1776 case GADGET_EDITBOXPASScxx . . $ `Descent3/newui_core.cpp:1181:9`!:
1777 desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..editcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#edit.->GetTextcxx . . $ UIEdit#GetText(a07d8cccb7673f5a).(sbuftest, EDIT_BUFLEN_MAXcxx . . $ `Descent3/newui_core.cpp:372:9`!);
1778 if (strcmp(sbuftest, (char *)desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal.) != 0) {
1779 strcpy((char *)desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal., sbuftest);
1780 desc->changedcxx . . $ newuiSheet#t_gadget_desc#changed. = true;
1781 }
1782 break;
1783
1784 default:
1785 desc->changedcxx . . $ newuiSheet#t_gadget_desc#changed. = false;
1786 }
1787 }
1788 }
1789 }
1790
1791 // call these functions to determine if a pointer's value has changed after call to UpdateReturnValues (internal)
1792 bool newuiSheetcxx . . $ newuiSheet#::HasChangedcxx . . $ newuiSheet#HasChanged(78ac5d2f3d401626).(bool *bptr) {
1793 int i;
1794
1795 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_realized);
1796
1797 for (i = 0; i < m_ngadgetscxx . . $ newuiSheet#m_ngadgets.; i++) {
1798 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *desc = &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i];
1799 if (desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.) {
1800 switch (desc->typecxx . . $ newuiSheet#t_gadget_desc#type.) {
1801 case GADGET_LCHECKBOXcxx . . $ `Descent3/newui_core.cpp:1177:9`!:
1802 case GADGET_CHECKBOXcxx . . $ `Descent3/newui_core.cpp:1174:9`!:
1803 if ((&desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b.) == bptr) {
1804 return desc->changedcxx . . $ newuiSheet#t_gadget_desc#changed.;
1805 }
1806 break;
1807 }
1808 }
1809 }
1810
1811 return false;
1812 }
1813
1814 bool newuiSheetcxx . . $ newuiSheet#::HasChangedcxx . . $ newuiSheet#HasChanged(18a3c31ed0aa5760).(int *iptr) {
1815 int i;
1816
1817 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_realized);
1818
1819 for (i = 0; i < m_ngadgetscxx . . $ newuiSheet#m_ngadgets.; i++) {
1820 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *desc = &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i];
1821 if (desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.) {
1822 switch (desc->typecxx . . $ newuiSheet#t_gadget_desc#type.) {
1823 case GADGET_RADIOcxx . . $ `Descent3/newui_core.cpp:1175:9`!:
1824 case GADGET_LRADIOcxx . . $ `Descent3/newui_core.cpp:1178:9`!:
1825 if ((&desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i.) == iptr) {
1826 return desc->changedcxx . . $ newuiSheet#t_gadget_desc#changed.;
1827 }
1828 break;
1829 }
1830 }
1831 }
1832
1833 return false;
1834 }
1835
1836 bool newuiSheetcxx . . $ newuiSheet#::HasChangedcxx . . $ newuiSheet#HasChanged(2c92555bf46fdf74).(int16_tcxx . . $ int16_t# *sptr) {
1837 int i;
1838
1839 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_realized);
1840
1841 for (i = 0; i < m_ngadgetscxx . . $ newuiSheet#m_ngadgets.; i++) {
1842 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *desc = &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i];
1843 if (desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.) {
1844 switch (desc->typecxx . . $ newuiSheet#t_gadget_desc#type.) {
1845 case GADGET_SLIDERcxx . . $ `Descent3/newui_core.cpp:1179:9`!:
1846 if ((&desc->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0]) == sptr) {
1847 return desc->changedcxx . . $ newuiSheet#t_gadget_desc#changed.;
1848 }
1849 break;
1850 }
1851 }
1852 }
1853
1854 return false;
1855 }
1856
1857 bool newuiSheetcxx . . $ newuiSheet#::HasChangedcxx . . $ newuiSheet#HasChanged(c6b7e35ff6de5671).(char *cptr) {
1858 int i;
1859
1860 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_realized);
1861
1862 for (i = 0; i < m_ngadgetscxx . . $ newuiSheet#m_ngadgets.; i++) {
1863 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *desc = &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i];
1864 if (desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.) {
1865 switch (desc->typecxx . . $ newuiSheet#t_gadget_desc#type.) {
1866 case GADGET_EDITBOXcxx . . $ `Descent3/newui_core.cpp:1180:9`!:
1867 case GADGET_EDITBOXNUMcxx . . $ `Descent3/newui_core.cpp:1182:9`!:
1868 case GADGET_EDITBOXPASScxx . . $ `Descent3/newui_core.cpp:1181:9`!:
1869 if (desc->internalcxx . . $ newuiSheet#t_gadget_desc#internal. == cptr) {
1870 return desc->changedcxx . . $ newuiSheet#t_gadget_desc#changed.;
1871 }
1872 break;
1873 }
1874 }
1875 }
1876
1877 return false;
1878 }
1879
1880 UIGadgetcxx . . $ UIGadget# *newuiSheetcxx . . $ newuiSheet#::GetGadgetcxx . . $ newuiSheet#GetGadget(d6ee160b69f32e15).(int16_tcxx . . $ int16_t# id) {
1881 int i;
1882
1883 for (i = 0; i < m_ngadgetscxx . . $ newuiSheet#m_ngadgets.; i++) {
1884 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *desc = &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i];
1885
1886 if (desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget. && id == (int16_tcxx . . $ int16_t#)desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.->GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).()) {
1887 switch (desc->typecxx . . $ newuiSheet#t_gadget_desc#type.) {
1888 case GADGET_STATIC_TXTcxx . . $ `Descent3/newui_core.cpp:1172:9`!:
1889 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.;
1890 case GADGET_STATIC_BMPcxx . . $ `Descent3/newui_core.cpp:1184:9`!:
1891 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.;
1892 case GADGET_BUTTONcxx . . $ `Descent3/newui_core.cpp:1173:9`!:
1893 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..buttoncxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#button.;
1894 case GADGET_HOTSPOTcxx . . $ `Descent3/newui_core.cpp:1186:9`!:
1895 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..hotcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#hot.;
1896 case GADGET_CHECKBOXcxx . . $ `Descent3/newui_core.cpp:1174:9`!:
1897 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox.;
1898 case GADGET_RADIOcxx . . $ `Descent3/newui_core.cpp:1175:9`!:
1899 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..radiocxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#radio.;
1900 case GADGET_LBUTTONcxx . . $ `Descent3/newui_core.cpp:1176:9`!:
1901 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..buttoncxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#button.;
1902 case GADGET_LCHECKBOXcxx . . $ `Descent3/newui_core.cpp:1177:9`!:
1903 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..chboxcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#chbox.;
1904 case GADGET_LRADIOcxx . . $ `Descent3/newui_core.cpp:1178:9`!:
1905 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..radiocxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#radio.;
1906 case GADGET_SLIDERcxx . . $ `Descent3/newui_core.cpp:1179:9`!:
1907 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..slidercxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#slider.;
1908 case GADGET_EDITBOXcxx . . $ `Descent3/newui_core.cpp:1180:9`!:
1909 case GADGET_EDITBOXPASScxx . . $ `Descent3/newui_core.cpp:1181:9`!:
1910 case GADGET_EDITBOXNUMcxx . . $ `Descent3/newui_core.cpp:1182:9`!:
1911 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..editcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#edit.;
1912 case GADGET_LISTBOXcxx . . $ `Descent3/newui_core.cpp:1183:9`!:
1913 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..lbcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#lb.;
1914 case GADGET_COMBOBOXcxx . . $ `Descent3/newui_core.cpp:1185:9`!:
1915 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..cbcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#cb.;
1916 case GADGET_CHANGEABLE_TXTcxx . . $ `Descent3/newui_core.cpp:1187:9`!:
1917 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..textcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#text.;
1918
1919 default:
1920 return desc->objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget.;
1921 }
1922 }
1923 }
1924
1925 Int3cxx . . $ `misc/pserror.h:247:9`!();
1926 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1927 }
1928
1929 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *newuiSheetcxx . . $ newuiSheet#::AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(int16_tcxx . . $ int16_t# id, int8_tcxx . . $ int8_t# type, const char *title) {
1930 int i = m_ngadgetscxx . . $ newuiSheet#m_ngadgets.;
1931
1932 ASSERTcxx . . $ `misc/pserror.h:246:9`!(!m_realized);
1933 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_gadgetlimit > m_ngadgets);
1934 if (m_gadgetlimitcxx . . $ newuiSheet#m_gadgetlimit. <= m_ngadgetscxx . . $ newuiSheet#m_ngadgets.) {
1935 Errorcxx . . $ Error(326aeb464d16410c).("Internal error in newuiSheet::AddGadget (ngadgets=%d, id=%d, type=%d, title=%s)\n", m_ngadgetscxx . . $ newuiSheet#m_ngadgets., (int)id,
1936 (int)type, title ? title : "NULL");
1937 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1938 }
1939
1940 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].idcxx . . $ newuiSheet#t_gadget_desc#id. = id;
1941 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].typecxx . . $ newuiSheet#t_gadget_desc#type. = type;
1942 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].titlecxx . . $ newuiSheet#t_gadget_desc#title. = title ? mem_strdupcxx . . $ `mem/mem.h:81:9`!(title) : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1943 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].objcxx . . $ newuiSheet#t_gadget_desc#obj..gadgetcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_3#gadget. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1944 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. = 0;
1945 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].changedcxx . . $ newuiSheet#t_gadget_desc#changed. = false;
1946 m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i].internalcxx . . $ newuiSheet#t_gadget_desc#internal. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1947
1948 m_ngadgetscxx . . $ newuiSheet#m_ngadgets.++;
1949
1950 return &m_gadgetlistcxx . . $ newuiSheet#m_gadgetlist.[i];
1951 }
1952
1953 // creates gadget list.
1954 void newuiSheetcxx . . $ newuiSheet#::NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(const char *title, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, tAlignmentcxx . . $ tAlignment# align, int16_tcxx . . $ int16_t# pix_offset) {
1955 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(-1, (align == NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.) ? GADGET_HGROUPcxx . . $ `Descent3/newui_core.cpp:1171:9`! : GADGET_GROUPcxx . . $ `Descent3/newui_core.cpp:1170:9`!, title);
1956 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] = x;
1957 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[1] = y;
1958 gadget->idcxx . . $ newuiSheet#t_gadget_desc#id. = pix_offset;
1959 }
1960
1961 // adds standard button to current group.
1962 void newuiSheetcxx . . $ newuiSheet#::AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(const char *title, int16_tcxx . . $ int16_t# id, int16_tcxx . . $ int16_t# flags) {
1963 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_BUTTONcxx . . $ `Descent3/newui_core.cpp:1173:9`!, title);
1964 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. = flags;
1965 }
1966
1967 // adds standard long button to current group.
1968 void newuiSheetcxx . . $ newuiSheet#::AddLongButtoncxx . . $ newuiSheet#AddLongButton(680bf41633375800).(const char *title, int16_tcxx . . $ int16_t# id, int16_tcxx . . $ int16_t# flags) {
1969 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_LBUTTONcxx . . $ `Descent3/newui_core.cpp:1176:9`!, title);
1970 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. = flags;
1971 }
1972
1973 // adds checkbox to current group. initial state of checkbox can be set.
1974 bool *newuiSheetcxx . . $ newuiSheet#::AddCheckBoxcxx . . $ newuiSheet#AddCheckBox(b1b99af17a84c782).(const char *title, bool init_state, int16_tcxx . . $ int16_t# id) {
1975 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_CHECKBOXcxx . . $ `Descent3/newui_core.cpp:1174:9`!, title);
1976 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b. = init_state;
1977 return &gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b.;
1978 }
1979
1980 // adds checkbox to current group. initial state of checkbox can be set.
1981 bool *newuiSheetcxx . . $ newuiSheet#::AddLongCheckBoxcxx . . $ newuiSheet#AddLongCheckBox(b1b99af17a84c782).(const char *title, bool init_state, int16_tcxx . . $ int16_t# id) {
1982 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_LCHECKBOXcxx . . $ `Descent3/newui_core.cpp:1177:9`!, title);
1983 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b. = init_state;
1984 return &gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b.;
1985 }
1986
1987 // adds a radio button to current group. initial state of radio may be set
1988 int *newuiSheetcxx . . $ newuiSheet#::AddFirstRadioButtoncxx . . $ newuiSheet#AddFirstRadioButton(c0389c32fb6fc938).(const char *title, int16_tcxx . . $ int16_t# id) {
1989 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_RADIOcxx . . $ `Descent3/newui_core.cpp:1175:9`!, title);
1990 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. = 0;
1991 return &gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i.;
1992 }
1993
1994 // adds a radio button to current group. initial state of radio may be set
1995 void newuiSheetcxx . . $ newuiSheet#::AddRadioButtoncxx . . $ newuiSheet#AddRadioButton(9a5cb738bb1a644).(const char *title, int16_tcxx . . $ int16_t# id) {
1996 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_RADIOcxx . . $ `Descent3/newui_core.cpp:1175:9`!, title);
1997 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. = -1;
1998 }
1999
2000 // adds a radio button to current group. initial state of radio may be set
2001 int *newuiSheetcxx . . $ newuiSheet#::AddFirstLongRadioButtoncxx . . $ newuiSheet#AddFirstLongRadioButton(c0389c32fb6fc938).(const char *title, int16_tcxx . . $ int16_t# id) {
2002 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_LRADIOcxx . . $ `Descent3/newui_core.cpp:1178:9`!, title);
2003 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. = 0;
2004 return &gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i.;
2005 }
2006
2007 // adds a radio button to current group. initial state of radio may be set
2008 void newuiSheetcxx . . $ newuiSheet#::AddLongRadioButtoncxx . . $ newuiSheet#AddLongRadioButton(9a5cb738bb1a644).(const char *title, int16_tcxx . . $ int16_t# id) {
2009 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_LRADIOcxx . . $ `Descent3/newui_core.cpp:1178:9`!, title);
2010 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. = -1;
2011 }
2012
2013 // adds a slider, set the range for it too.
2014 int16_tcxx . . $ int16_t# *newuiSheetcxx . . $ newuiSheet#::AddSlidercxx . . $ newuiSheet#AddSlider(8ed53311be8e1fab).(const char *title, int16_tcxx . . $ int16_t# range, int16_tcxx . . $ int16_t# init_pos, tSliderSettingscxx . . $ tSliderSettings# *settings, int16_tcxx . . $ int16_t# id) {
2015 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_SLIDERcxx . . $ `Descent3/newui_core.cpp:1179:9`!, title);
2016 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] = init_pos;
2017 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[1] = range;
2018
2019 if (settings) {
2020 gadget->internalcxx . . $ newuiSheet#t_gadget_desc#internal. = mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(tSliderSettings));
2021 memcpy(gadget->internalcxx . . $ newuiSheet#t_gadget_desc#internal., settings, sizeof(tSliderSettingscxx . . $ tSliderSettings#));
2022 } else {
2023 gadget->internalcxx . . $ newuiSheet#t_gadget_desc#internal. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2024 }
2025
2026 return &gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0];
2027 }
2028
2029 // adds a static text item
2030 void newuiSheetcxx . . $ newuiSheet#::AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(const char *text, ...) {
2031 stdcxx . . $ std/::va_listcxx . . $ std/va_list# arglist;
2032 char buf[512];
2033 int len;
2034
2035 va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(arglist, text);
2036 len = stdcxx . . $ std/::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(buf, 512, text, arglist);
2037 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(arglist);
2038
2039 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(-1, GADGET_STATIC_TXTcxx . . $ `Descent3/newui_core.cpp:1172:9`!, buf);
2040
2041 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..bcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#b. = false; // means small text.
2042 }
2043
2044 // adds a static bitmap
2045 void newuiSheetcxx . . $ newuiSheet#::AddBitmapcxx . . $ newuiSheet#AddBitmap(d4f767463ce0a6b3).(int bm_handle) {
2046 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(-1, GADGET_STATIC_BMPcxx . . $ `Descent3/newui_core.cpp:1184:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2047 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..icxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#i. = bm_handle;
2048 }
2049
2050 // adds a static text item
2051 char *newuiSheetcxx . . $ newuiSheet#::AddChangeableTextcxx . . $ newuiSheet#AddChangeableText(ff224f080444ee45).(int buflen) {
2052 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(-1, GADGET_CHANGEABLE_TXTcxx . . $ `Descent3/newui_core.cpp:1187:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2053 gadget->internalcxx . . $ newuiSheet#t_gadget_desc#internal. = (void *)(size_t)buflen;
2054 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..pcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#p. = mem_malloccxx . . $ `mem/mem.h:79:9`!(buflen);
2055 return (char *)gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..pcxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#p.;
2056 }
2057
2058 // adds a hotspot :(, should word wrap too.
2059 void newuiSheetcxx . . $ newuiSheet#::AddHotspotcxx . . $ newuiSheet#AddHotspot(9900cc9f47e11d13).(const char *title, int16_tcxx . . $ int16_t# w, int16_tcxx . . $ int16_t# h, int16_tcxx . . $ int16_t# id, bool group) {
2060 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_HOTSPOTcxx . . $ `Descent3/newui_core.cpp:1186:9`!, title);
2061 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] = w;
2062 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[1] = h;
2063 gadget->internalcxx . . $ newuiSheet#t_gadget_desc#internal. = (void *)(group);
2064 }
2065
2066 // adds a listbox
2067 newuiListBoxcxx . . $ newuiListBox# *newuiSheetcxx . . $ newuiSheet#::AddListBoxcxx . . $ newuiSheet#AddListBox(b890ce7adcd9a5ed).(int16_tcxx . . $ int16_t# w, int16_tcxx . . $ int16_t# h, int16_tcxx . . $ int16_t# id, uint16_tcxx . . $ uint16_t# flags) {
2068 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_LISTBOXcxx . . $ `Descent3/newui_core.cpp:1183:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2069 newuiListBoxcxx . . $ newuiListBox# *lb = new newuiListBoxcxx . . $ newuiListBox#newuiListBox(49f6e7a06ebc5aa8).;
2070 lb->Createcxx . . $ newuiListBox#Create(e6e6eb18e32bd8f).(m_parentcxx . . $ newuiSheet#m_parent., id, 0, 0, w, h, flags);
2071 m_parentcxx . . $ newuiSheet#m_parent.->RemoveGadgetcxx . . $ UIWindow#RemoveGadget(627f6e6cf27f18b7).(lb);
2072 gadget->internalcxx . . $ newuiSheet#t_gadget_desc#internal. = lb;
2073 return lb;
2074 }
2075
2076 // adds a listbox
2077 newuiComboBoxcxx . . $ newuiComboBox# *newuiSheetcxx . . $ newuiSheet#::AddComboBoxcxx . . $ newuiSheet#AddComboBox(b9251fbe6368b7af).(int16_tcxx . . $ int16_t# id, uint16_tcxx . . $ uint16_t# flags) {
2078 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, GADGET_COMBOBOXcxx . . $ `Descent3/newui_core.cpp:1185:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2079 newuiComboBoxcxx . . $ newuiComboBox# *cb = new newuiComboBoxcxx . . $ newuiComboBox#newuiComboBox(49f6e7a06ebc5aa8).;
2080 cb->Createcxx . . $ newuiComboBox#Create(b592d8b1d10b24b1).(m_parentcxx . . $ newuiSheet#m_parent., id, 0, 0, flags);
2081 m_parentcxx . . $ newuiSheet#m_parent.->RemoveGadgetcxx . . $ UIWindow#RemoveGadget(627f6e6cf27f18b7).(cb);
2082 gadget->internalcxx . . $ newuiSheet#t_gadget_desc#internal. = cb;
2083 return cb;
2084 }
2085
2086 // adds an edit box
2087 char *newuiSheetcxx . . $ newuiSheet#::AddEditBoxcxx . . $ newuiSheet#AddEditBox(56493f8cd670630f).(const char *title, int16_tcxx . . $ int16_t# maxlen, int16_tcxx . . $ int16_t# w, int16_tcxx . . $ int16_t# id, int16_tcxx . . $ int16_t# flags, bool on_escape_quit) {
2088 int8_tcxx . . $ int8_t# type = GADGET_EDITBOXcxx . . $ `Descent3/newui_core.cpp:1180:9`!;
2089 if (flags & UIED_PASSWORDcxx . . $ `ui/ui.h:361:9`!) {
2090 type = GADGET_EDITBOXPASScxx . . $ `Descent3/newui_core.cpp:1181:9`!;
2091 } else if (flags & UIED_NUMBERScxx . . $ `ui/ui.h:362:9`!) {
2092 type = GADGET_EDITBOXNUMcxx . . $ `Descent3/newui_core.cpp:1182:9`!;
2093 }
2094
2095 newuiSheetcxx . . $ newuiSheet#::t_gadget_desccxx . . $ newuiSheet#t_gadget_desc# *gadget = AddGadgetcxx . . $ newuiSheet#AddGadget(23885b9c9481ab71).(id, type, title);
2096
2097 ASSERTcxx . . $ `misc/pserror.h:246:9`!(maxlen < EDIT_BUFLEN_MAXcxx . . $ `Descent3/newui_core.cpp:372:9`!);
2098 ASSERTcxx . . $ `misc/pserror.h:246:9`!(w <= 0xfff);
2099
2100 char *strbuf = (char *)mem_malloccxx . . $ `mem/mem.h:79:9`!(maxlen + 1);
2101 strbuf[0] = 0;
2102 gadget->internalcxx . . $ newuiSheet#t_gadget_desc#internal. = strbuf;
2103 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] = (w & 0xfff);
2104 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[1] = maxlen;
2105
2106 // awful hack to store extra info into gadget structure. width should never exceed 4096
2107 if (on_escape_quit) {
2108 gadget->parmcxx . . $ newuiSheet#t_gadget_desc#parm..scxx . . $ newuiSheet#t_gadget_desc#$anonymous_type_2#s.[0] |= (0x1000);
2109 }
2110
2111 return (char *)gadget->internalcxx . . $ newuiSheet#t_gadget_desc#internal.;
2112 }
2113
2114 //////////////////////////////////////////////////////////////////////////////
2115 // CLASS simple buttons
2116
2117 newuiButtoncxx . . $ newuiButton#::newuiButtoncxx . . $ newuiButton#newuiButton(49f6e7a06ebc5aa8).() {
2118 m_bkgcxx . . $ newuiButton#m_bkg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2119 m_litbkgcxx . . $ newuiButton#m_litbkg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2120 m_textcxx . . $ newuiButton#m_text. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2121 }
2122
2123 void newuiButtoncxx . . $ newuiButton#::Createcxx . . $ newuiButton#Create(6c82988af4899650).(UIWindowcxx . . $ UIWindow# *menu, int16_tcxx . . $ int16_t# id, const char *name, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, int16_tcxx . . $ int16_t# flags) {
2124 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{""};
2125 UIButtoncxx . . $ UIButton#::Createcxx . . $ UIButton#Create(55c0967870198d96).(menu, id, &item, x, y, 10, 8, flags | UIF_FITcxx . . $ `ui/ui.h:343:9`!);
2126
2127 if (flags & NEWUI_BTNF_FRAMEDcxx . . $ `Descent3/newui_core.h:184:9`!) {
2128 ASSERTcxx . . $ `misc/pserror.h:246:9`!(!(flags & NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!)); // remove this if art is added.
2129 if (!m_bkgcxx . . $ newuiButton#m_bkg.) {
2130 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).((flags & NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!) ? NEWUI_LBTNFRAMED_FILEcxx . . $ `Descent3/newui_core.cpp:270:9`! : NEWUI_BTNFRAMED_FILEcxx . . $ `Descent3/newui_core.cpp:272:9`!);
2131 }
2132 if (!m_litbkgcxx . . $ newuiButton#m_litbkg.) {
2133 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).((flags & NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!) ? NEWUI_LBTNLITFRAMED_FILEcxx . . $ `Descent3/newui_core.cpp:271:9`! : NEWUI_BTNLITFRAMED_FILEcxx . . $ `Descent3/newui_core.cpp:273:9`!);
2134 }
2135 }
2136
2137 newuiButtoncxx . . $ newuiButton#::InitStatescxx . . $ newuiButton#InitStates(e7abf97c08fae620).(name, (flags & NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!) != 0);
2138 }
2139
2140 void newuiTinyButtoncxx . . $ newuiTinyButton#::Createcxx . . $ newuiTinyButton#Create(752e5b2327f90754).(UIWindowcxx . . $ UIWindow# *wnd, int16_tcxx . . $ int16_t# id, const char *name, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y) {
2141 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_TINYBTN_FILEcxx . . $ `Descent3/newui_core.cpp:291:9`!);
2142 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_TINYBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:292:9`!);
2143 newuiButtoncxx . . $ newuiButton#::Createcxx . . $ newuiButton#Create(6c82988af4899650).(wnd, id, name, x, y);
2144 }
2145
2146 // override: called when resized or before drawing.
2147 void newuiButtoncxx . . $ newuiButton#::OnFormatcxx . . $ newuiButton#OnFormat(49f6e7a06ebc5aa8).() {
2148 m_Wcxx . . $ UIObject#m_W. = GetStateItemcxx . . $ UIButton#GetStateItem(6e2eddbf98f33a4f).(m_Statecxx . . $ UIButton#m_State.)->widthcxx . . $ UIItem#width(b126dc7c1de90089).();
2149 m_Hcxx . . $ UIObject#m_H. = GetStateItemcxx . . $ UIButton#GetStateItem(6e2eddbf98f33a4f).(m_Statecxx . . $ UIButton#m_State.)->heightcxx . . $ UIItem#height(b126dc7c1de90089).();
2150
2151 UIGadgetcxx . . $ UIGadget#::OnFormatcxx . . $ UIGadget#OnFormat(49f6e7a06ebc5aa8).();
2152 }
2153
2154 void newuiButtoncxx . . $ newuiButton#::InitStatescxx . . $ newuiButton#InitStates(e7abf97c08fae620).(const char *name, bool is_long, int16_tcxx . . $ int16_t# flags) {
2155 if (!m_bkgcxx . . $ newuiButton#m_bkg.) {
2156 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(is_long ? NEWUI_LBTN_FILEcxx . . $ `Descent3/newui_core.cpp:266:9`! : NEWUI_BTN_FILEcxx . . $ `Descent3/newui_core.cpp:268:9`!);
2157 }
2158
2159 if (!m_litbkgcxx . . $ newuiButton#m_litbkg.) {
2160 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(is_long ? NEWUI_LBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:267:9`! : NEWUI_BTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:269:9`!);
2161 }
2162
2163 if (name && !m_textcxx . . $ newuiButton#m_text.) {
2164 m_textcxx . . $ newuiButton#m_text. = GadgetSmallTextcxx . . $ GadgetSmallText(a7872db8a769bd23).(name);
2165 }
2166
2167 SetStateItemcxx . . $ UIButton#SetStateItem(be8be563f9cef951).(UI_BTS_DISABLEDcxx . . $ `ui/ui.h:542:9`!, m_bkgcxx . . $ newuiButton#m_bkg.);
2168 SetStateItemcxx . . $ UIButton#SetStateItem(be8be563f9cef951).(UI_BTS_INACTIVEcxx . . $ `ui/ui.h:543:9`!, m_bkgcxx . . $ newuiButton#m_bkg.);
2169 SetStateItemcxx . . $ UIButton#SetStateItem(be8be563f9cef951).(UI_BTS_HILITEcxx . . $ `ui/ui.h:544:9`!, m_bkgcxx . . $ newuiButton#m_bkg.);
2170 SetStateItemcxx . . $ UIButton#SetStateItem(be8be563f9cef951).(UI_BTS_ACTIVATEDcxx . . $ `ui/ui.h:545:9`!, m_litbkgcxx . . $ newuiButton#m_litbkg.);
2171
2172 OnFormatcxx . . $ newuiButton#OnFormat(49f6e7a06ebc5aa8).();
2173 }
2174
2175 void newuiButtoncxx . . $ newuiButton#::OnDestroycxx . . $ newuiButton#OnDestroy(49f6e7a06ebc5aa8).() {
2176 if (m_bkgcxx . . $ newuiButton#m_bkg.) {
2177 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_bkgcxx . . $ newuiButton#m_bkg.);
2178 m_bkgcxx . . $ newuiButton#m_bkg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2179 }
2180 if (m_litbkgcxx . . $ newuiButton#m_litbkg.) {
2181 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_litbkgcxx . . $ newuiButton#m_litbkg.);
2182 m_litbkgcxx . . $ newuiButton#m_litbkg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2183 }
2184 if (m_textcxx . . $ newuiButton#m_text.) {
2185 delete m_textcxx . . $ newuiButton#m_text.;
2186 m_textcxx . . $ newuiButton#m_text. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2187 }
2188
2189 UIButtoncxx . . $ UIButton#::OnDestroycxx . . $ UIButton#OnDestroy(49f6e7a06ebc5aa8).();
2190 }
2191
2192 void newuiButtoncxx . . $ newuiButton#::OnDrawcxx . . $ newuiButton#OnDraw(49f6e7a06ebc5aa8).() {
2193 uint8_tcxx . . $ uint8_t# alpha = IsDisabledcxx . . $ UIGadget#IsDisabled(c9857a73d68e59ba).() ? 128 : 255;
2194
2195 if (GetStateItemcxx . . $ UIButton#GetStateItem(6e2eddbf98f33a4f).(m_Statecxx . . $ UIButton#m_State.)) {
2196 GetStateItemcxx . . $ UIButton#GetStateItem(6e2eddbf98f33a4f).(m_Statecxx . . $ UIButton#m_State.)->set_alphacxx . . $ UIItem#set_alpha(ac50b47256ae7414).(alpha);
2197 GetStateItemcxx . . $ UIButton#GetStateItem(6e2eddbf98f33a4f).(m_Statecxx . . $ UIButton#m_State.)->drawcxx . . $ UIItem#draw(84329bcd07240ccf).(0, 0);
2198 }
2199
2200 if (m_textcxx . . $ newuiButton#m_text.) {
2201 m_textcxx . . $ newuiButton#m_text.->set_alphacxx . . $ UITextItem#set_alpha(ac50b47256ae7414).(alpha);
2202 m_textcxx . . $ newuiButton#m_text.->drawcxx . . $ UISnazzyTextItem#draw(84329bcd07240ccf).((m_Wcxx . . $ UIObject#m_W. - m_textcxx . . $ newuiButton#m_text.->widthcxx . . $ UITextItem#width(b126dc7c1de90089).()) / 2, (m_Hcxx . . $ UIObject#m_H. - m_textcxx . . $ newuiButton#m_text.->heightcxx . . $ UITextItem#height(b126dc7c1de90089).()) / 2);
2203 }
2204 }
2205
2206 void newuiButtoncxx . . $ newuiButton#::OnLostFocuscxx . . $ newuiButton#OnLostFocus(49f6e7a06ebc5aa8).() {
2207 if (m_textcxx . . $ newuiButton#m_text.) {
2208 m_textcxx . . $ newuiButton#m_text.->set_flagscxx . . $ UISnazzyTextItem#set_flags(cb2f890c2fdad230).(0);
2209 m_textcxx . . $ newuiButton#m_text.->set_colorcxx . . $ UITextItem#set_color(cb2f890c2fdad230).(NEWUI_GADGETFONT_COLORcxx . . $ `Descent3/newui_core.h:71:9`!);
2210 }
2211 UIButtoncxx . . $ UIButton#::OnLostFocuscxx . . $ UIButton#OnLostFocus(49f6e7a06ebc5aa8).();
2212 }
2213
2214 void newuiButtoncxx . . $ newuiButton#::OnGainFocuscxx . . $ newuiButton#OnGainFocus(49f6e7a06ebc5aa8).() {
2215 if (m_textcxx . . $ newuiButton#m_text.) {
2216 m_textcxx . . $ newuiButton#m_text.->set_colorcxx . . $ UITextItem#set_color(cb2f890c2fdad230).(NEWUI_GADGETFONT_HICOLORcxx . . $ `Descent3/newui_core.h:73:9`!);
2217 m_textcxx . . $ newuiButton#m_text.->set_flagscxx . . $ UISnazzyTextItem#set_flags(cb2f890c2fdad230).(UISNAZZYTEXTF_BLINKINGcxx . . $ `ui/uires.h:180:9`!);
2218 }
2219 UIButtoncxx . . $ UIButton#::OnGainFocuscxx . . $ UIButton#OnGainFocus(49f6e7a06ebc5aa8).();
2220 }
2221
2222 //////////////////////////////////////////////////////////////////////////////
2223 // CLASS a large option button used in menus.
2224
2225 void newuiMenuOptionButtoncxx . . $ newuiMenuOptionButton#::Createcxx . . $ newuiMenuOptionButton#Create(1deaf4d7e2763ddc).(newuiMenucxx . . $ newuiMenu# *menu, newuiMenuOptionButtoncxx . . $ newuiMenuOptionButton# *last, int16_tcxx . . $ int16_t# id, const char *name, int16_tcxx . . $ int16_t# x,
2226 int16_tcxx . . $ int16_t# y, bool mono_press) {
2227 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LRGBTN_FILEcxx . . $ `Descent3/newui_core.cpp:264:9`!);
2228 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LRGBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:265:9`!);
2229 m_textcxx . . $ newuiButton#m_text. = GadgetLargeTextcxx . . $ GadgetLargeText(a7872db8a769bd23).(name);
2230 m_mono_presscxx . . $ newuiMenuOptionButton#m_mono_press. = mono_press;
2231 m_prev_btncxx . . $ newuiMenuOptionButton#m_prev_btn. = last;
2232 m_next_btncxx . . $ newuiMenuOptionButton#m_next_btn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2233 if (m_prev_btncxx . . $ newuiMenuOptionButton#m_prev_btn.) {
2234 m_prev_btncxx . . $ newuiMenuOptionButton#m_prev_btn.->m_next_btncxx . . $ newuiMenuOptionButton#m_next_btn. = this;
2235 }
2236
2237 newuiButtoncxx . . $ newuiButton#::Createcxx . . $ newuiButton#Create(6c82988af4899650).(menu, id, name, x, y);
2238 }
2239
2240 void newuiMenuOptionButtoncxx . . $ newuiMenuOptionButton#::OnMouseBtnDowncxx . . $ newuiMenuOptionButton#OnMouseBtnDown(d4f767463ce0a6b3).(int btn) {
2241 if (btn == UILMSEBTNcxx . . $ `ui/uisys.h:36:9`!) {
2242 if ((m_Statecxx . . $ UIButton#m_State. != UI_BTS_ACTIVATEDcxx . . $ `ui/ui.h:545:9`!) && PT_IN_GADGETcxx . . $ PT_IN_GADGET(55d2799d541f12b5).(m_Wndcxx . . $ UIGadget#m_Wnd., this, UI_inputcxx . . $ UI_input..mxcxx . . $ tUIInput#mx., UI_inputcxx . . $ UI_input..mycxx . . $ tUIInput#my.)) {
2243 m_Statecxx . . $ UIButton#m_State. = UI_BTS_ACTIVATEDcxx . . $ `ui/ui.h:545:9`!;
2244 LOCK_FOCUScxx . . $ `ui/uisys.h:107:9`!(this);
2245 // mprintf(0, "mouse down in button gadget (%d)\n", GetID());
2246 if (m_mono_presscxx . . $ newuiMenuOptionButton#m_mono_press.) {
2247 // mprintf(0, "selected button gadget (%d)\n", GetID());
2248 OnSelectcxx . . $ UIGadget#OnSelect(49f6e7a06ebc5aa8).();
2249 m_Statecxx . . $ UIButton#m_State. = UI_BTS_HILITEcxx . . $ `ui/ui.h:544:9`!;
2250 }
2251 }
2252 }
2253 }
2254
2255 void newuiMenuOptionButtoncxx . . $ newuiMenuOptionButton#::OnMouseBtnUpcxx . . $ newuiMenuOptionButton#OnMouseBtnUp(d4f767463ce0a6b3).(int btn) {
2256 if (btn == UILMSEBTNcxx . . $ `ui/uisys.h:36:9`!) {
2257 if (m_Statecxx . . $ UIButton#m_State. == UI_BTS_ACTIVATEDcxx . . $ `ui/ui.h:545:9`!) {
2258 if (PT_IN_GADGETcxx . . $ PT_IN_GADGET(55d2799d541f12b5).(UIGadgetcxx . . $ UIGadget#::m_Wndcxx . . $ UIGadget#m_Wnd., this, UI_inputcxx . . $ UI_input..mxcxx . . $ tUIInput#mx., UI_inputcxx . . $ UI_input..mycxx . . $ tUIInput#my.)) {
2259 m_Statecxx . . $ UIButton#m_State. = UI_BTS_HILITEcxx . . $ `ui/ui.h:544:9`!;
2260 // if (!m_mono_press) {
2261 OnSelectcxx . . $ UIGadget#OnSelect(49f6e7a06ebc5aa8).();
2262 // }
2263 } else {
2264 m_Statecxx . . $ UIButton#m_State. = UI_BTS_INACTIVEcxx . . $ `ui/ui.h:543:9`!;
2265 }
2266 }
2267 UNLOCK_FOCUScxx . . $ `ui/uisys.h:109:9`!(this);
2268 }
2269 }
2270
2271 void newuiMenuOptionButtoncxx . . $ newuiMenuOptionButton#::OnKeyDowncxx . . $ newuiMenuOptionButton#OnKeyDown(d4f767463ce0a6b3).(int key) {
2272 if (key == KEY_DOWNcxx . . $ `ddio/ddio_common.h:319:9`! || key == KEY_RIGHTcxx . . $ `ddio/ddio_common.h:321:9`!) {
2273 if (m_next_btncxx . . $ newuiMenuOptionButton#m_next_btn.) {
2274 if (UIGadgetcxx . . $ UIGadget#::IsLockedcxx . . $ UIGadget#IsLocked(50ce9a9e25b4a850).()) {
2275 UNLOCK_FOCUScxx . . $ `ui/uisys.h:109:9`!(this);
2276 }
2277 m_Wndcxx . . $ UIGadget#m_Wnd.->SetFocusOnGadgetcxx . . $ UIWindow#SetFocusOnGadget(75ffd377f9406104).(m_next_btncxx . . $ newuiMenuOptionButton#m_next_btn., true);
2278 }
2279 } else if (key == KEY_UPcxx . . $ `ddio/ddio_common.h:318:9`! || key == KEY_LEFTcxx . . $ `ddio/ddio_common.h:320:9`!) {
2280 if (m_prev_btncxx . . $ newuiMenuOptionButton#m_prev_btn.) {
2281 if (UIGadgetcxx . . $ UIGadget#::IsLockedcxx . . $ UIGadget#IsLocked(50ce9a9e25b4a850).()) {
2282 UNLOCK_FOCUScxx . . $ `ui/uisys.h:109:9`!(this);
2283 }
2284 m_Wndcxx . . $ UIGadget#m_Wnd.->SetFocusOnGadgetcxx . . $ UIWindow#SetFocusOnGadget(75ffd377f9406104).(m_prev_btncxx . . $ newuiMenuOptionButton#m_prev_btn., true);
2285 }
2286 }
2287 }
2288
2289 void newuiMenuOptionButtoncxx . . $ newuiMenuOptionButton#::OnKeyUpcxx . . $ newuiMenuOptionButton#OnKeyUp(d4f767463ce0a6b3).(int key) {}
2290
2291 //////////////////////////////////////////////////////////////////////////////
2292 // CLASS creates an arrow button that is sensitive to touch (when down, always select)
2293
2294 void newuiArrowButtoncxx . . $ newuiArrowButton#::Createcxx . . $ newuiArrowButton#Create(a92569a4941e4071).(UIWindowcxx . . $ UIWindow# *wnd, int16_tcxx . . $ int16_t# id, int16_tcxx . . $ int16_t# type, const char *name, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y) {
2295 switch (type) {
2296 case NEWUI_ARROW_LEFTcxx . . $ `Descent3/newui_core.h:99:9`!:
2297 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LARR_FILEcxx . . $ `Descent3/newui_core.cpp:279:9`!);
2298 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LARRLIT_FILEcxx . . $ `Descent3/newui_core.cpp:280:9`!);
2299 break;
2300 case NEWUI_ARROW_RIGHTcxx . . $ `Descent3/newui_core.h:100:9`!:
2301 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_RARR_FILEcxx . . $ `Descent3/newui_core.cpp:281:9`!);
2302 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_RARRLIT_FILEcxx . . $ `Descent3/newui_core.cpp:282:9`!);
2303 break;
2304 case NEWUI_ARROW_UPcxx . . $ `Descent3/newui_core.h:101:9`!:
2305 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_UARR_FILEcxx . . $ `Descent3/newui_core.cpp:283:9`!);
2306 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_UARRLIT_FILEcxx . . $ `Descent3/newui_core.cpp:284:9`!);
2307 break;
2308 case NEWUI_ARROW_DOWNcxx . . $ `Descent3/newui_core.h:102:9`!:
2309 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_DARR_FILEcxx . . $ `Descent3/newui_core.cpp:285:9`!);
2310 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_DARRLIT_FILEcxx . . $ `Descent3/newui_core.cpp:286:9`!);
2311 break;
2312 case NEWUI_ARROW_CBUPcxx . . $ `Descent3/newui_core.h:103:9`!:
2313 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_UARRCB_FILEcxx . . $ `Descent3/newui_core.cpp:287:9`!);
2314 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_UARRLITCB_FILEcxx . . $ `Descent3/newui_core.cpp:288:9`!);
2315 break;
2316 case NEWUI_ARROW_CBDOWNcxx . . $ `Descent3/newui_core.h:104:9`!:
2317 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_DARRCB_FILEcxx . . $ `Descent3/newui_core.cpp:289:9`!);
2318 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_DARRLITCB_FILEcxx . . $ `Descent3/newui_core.cpp:290:9`!);
2319 break;
2320 default:
2321 Int3cxx . . $ `misc/pserror.h:247:9`!();
2322 }
2323
2324 newuiButtoncxx . . $ newuiButton#::Createcxx . . $ newuiButton#Create(6c82988af4899650).(wnd, id, name, x, y);
2325 UIGadgetcxx . . $ UIGadget#::SetDatumcxx . . $ UIGadget#SetDatum(68e3ae50fe6578a9).(type);
2326
2327 m_timercxx . . $ newuiArrowButton#m_timer. = 0.0f;
2328 m_selecttimercxx . . $ newuiArrowButton#m_selecttimer. = 0.0f;
2329 m_hiddencxx . . $ newuiArrowButton#m_hidden. = false;
2330 }
2331
2332 void newuiArrowButtoncxx . . $ newuiArrowButton#::Showcxx . . $ newuiArrowButton#Show(b45ddcbc8423892c).(bool show) { m_hiddencxx . . $ newuiArrowButton#m_hidden. = !show; }
2333
2334 void newuiArrowButtoncxx . . $ newuiArrowButton#::OnMouseBtnDowncxx . . $ newuiArrowButton#OnMouseBtnDown(d4f767463ce0a6b3).(int btn) {
2335 bool mouse_in_gadget =
2336 PT_IN_GADGETcxx . . $ PT_IN_GADGET(55d2799d541f12b5).(m_Wndcxx . . $ UIGadget#m_Wnd., this, UI_inputcxx . . $ UI_input..mxcxx . . $ tUIInput#mx., UI_inputcxx . . $ UI_input..mycxx . . $ tUIInput#my.); // DAJ Added to keep stray clicks from changing values
2337
2338 if (btn == UILMSEBTNcxx . . $ `ui/uisys.h:36:9`! && mouse_in_gadget) {
2339 if (m_Statecxx . . $ UIButton#m_State. == UI_BTS_HILITEcxx . . $ `ui/ui.h:544:9`!) {
2340 if (!m_hiddencxx . . $ newuiArrowButton#m_hidden.) {
2341 m_Statecxx . . $ UIButton#m_State. = UI_BTS_ACTIVATEDcxx . . $ `ui/ui.h:545:9`!;
2342 LOCK_FOCUScxx . . $ `ui/uisys.h:107:9`!(this);
2343 m_timercxx . . $ newuiArrowButton#m_timer. = 0.0f;
2344 }
2345 }
2346 if (m_Statecxx . . $ UIButton#m_State. == UI_BTS_ACTIVATEDcxx . . $ `ui/ui.h:545:9`!) {
2347 // this is so that select messages get set at correct times
2348 if (m_hiddencxx . . $ newuiArrowButton#m_hidden.) {
2349 m_Statecxx . . $ UIButton#m_State. = UI_BTS_HILITEcxx . . $ `ui/ui.h:544:9`!;
2350 UNLOCK_FOCUScxx . . $ `ui/uisys.h:109:9`!(this);
2351 } else {
2352 if (m_timercxx . . $ newuiArrowButton#m_timer. >= m_selecttimercxx . . $ newuiArrowButton#m_selecttimer.) {
2353 if (m_selecttimercxx . . $ newuiArrowButton#m_selecttimer. == 0.0f) {
2354 m_selecttimercxx . . $ newuiArrowButton#m_selecttimer. = 0.5f;
2355 } else if (m_selecttimercxx . . $ newuiArrowButton#m_selecttimer. == 0.5f) {
2356 m_selecttimercxx . . $ newuiArrowButton#m_selecttimer. = 0.050f;
2357 }
2358 OnSelectcxx . . $ UIGadget#OnSelect(49f6e7a06ebc5aa8).(); // DAJ moved from above the m_selecttimer set since this is recursive
2359 m_timercxx . . $ newuiArrowButton#m_timer. = 0.0f;
2360 }
2361 m_timercxx . . $ newuiArrowButton#m_timer. += UIFrameTimecxx . . $ UIFrameTime.;
2362 }
2363 }
2364 }
2365 }
2366
2367 void newuiArrowButtoncxx . . $ newuiArrowButton#::OnMouseBtnUpcxx . . $ newuiArrowButton#OnMouseBtnUp(d4f767463ce0a6b3).(int btn) {
2368 if (btn == UILMSEBTNcxx . . $ `ui/uisys.h:36:9`!) {
2369 if (m_Statecxx . . $ UIButton#m_State. == UI_BTS_ACTIVATEDcxx . . $ `ui/ui.h:545:9`!) {
2370 if (PT_IN_GADGETcxx . . $ PT_IN_GADGET(55d2799d541f12b5).(UIGadgetcxx . . $ UIGadget#::m_Wndcxx . . $ UIGadget#m_Wnd., this, UI_inputcxx . . $ UI_input..mxcxx . . $ tUIInput#mx., UI_inputcxx . . $ UI_input..mycxx . . $ tUIInput#my.)) {
2371 m_Statecxx . . $ UIButton#m_State. = UI_BTS_HILITEcxx . . $ `ui/ui.h:544:9`!;
2372 } else {
2373 m_Statecxx . . $ UIButton#m_State. = UI_BTS_INACTIVEcxx . . $ `ui/ui.h:543:9`!;
2374 }
2375 }
2376 UNLOCK_FOCUScxx . . $ `ui/uisys.h:109:9`!(this);
2377
2378 m_selecttimercxx . . $ newuiArrowButton#m_selecttimer. = 0.0f;
2379 m_timercxx . . $ newuiArrowButton#m_timer. = 0.0f;
2380 }
2381 }
2382
2383 void newuiArrowButtoncxx . . $ newuiArrowButton#::OnDrawcxx . . $ newuiArrowButton#OnDraw(49f6e7a06ebc5aa8).() {
2384 if (m_hiddencxx . . $ newuiArrowButton#m_hidden.)
2385 return;
2386
2387 newuiButtoncxx . . $ newuiButton#::OnDrawcxx . . $ newuiButton#OnDraw(49f6e7a06ebc5aa8).();
2388 }
2389
2390 //////////////////////////////////////////////////////////////////////////////
2391 // CLASS a new check box: note that newuiButton and UICheckBox will share the same UIButton base
2392 // since bott newuiButton and UICheckBox inherit UIButton virtually.
2393
2394 newuiCheckBoxcxx . . $ newuiCheckBox#::newuiCheckBoxcxx . . $ newuiCheckBox#newuiCheckBox(49f6e7a06ebc5aa8).() {}
2395
2396 void newuiCheckBoxcxx . . $ newuiCheckBox#::Createcxx . . $ newuiCheckBox#Create(88ee86519b70f83b).(UIWindowcxx . . $ UIWindow# *wnd, int16_tcxx . . $ int16_t# id, const char *name, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, bool is_long) {
2397 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(is_long ? NEWUI_LCHKBTN_FILEcxx . . $ `Descent3/newui_core.cpp:274:9`! : NEWUI_CHKBTN_FILEcxx . . $ `Descent3/newui_core.cpp:276:9`!);
2398 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(is_long ? NEWUI_LCHKBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:275:9`! : NEWUI_CHKBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:277:9`!);
2399
2400 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{""};
2401 UICheckBoxcxx . . $ UICheckBox#::Createcxx . . $ UICheckBox#Create(55c0967870198d96).(wnd, id, &item, x, y, 10, 8, UIF_FITcxx . . $ `ui/ui.h:343:9`!);
2402 newuiButtoncxx . . $ newuiButton#::InitStatescxx . . $ newuiButton#InitStates(e7abf97c08fae620).(name, is_long);
2403 }
2404
2405 // this will use the newuiButton drawing scheme
2406 void newuiCheckBoxcxx . . $ newuiCheckBox#::OnDrawcxx . . $ newuiCheckBox#OnDraw(49f6e7a06ebc5aa8).() { newuiButtoncxx . . $ newuiButton#::OnDrawcxx . . $ newuiButton#OnDraw(49f6e7a06ebc5aa8).(); }
2407
2408 //////////////////////////////////////////////////////////////////////////////
2409 // CLASS a new radio button
2410
2411 newuiRadioButtoncxx . . $ newuiRadioButton#::newuiRadioButtoncxx . . $ newuiRadioButton#newuiRadioButton(49f6e7a06ebc5aa8).() {}
2412
2413 void newuiRadioButtoncxx . . $ newuiRadioButton#::Createcxx . . $ newuiRadioButton#Create(7778cd589e48544c).(UIWindowcxx . . $ UIWindow# *wnd, UIRadioButtoncxx . . $ UIRadioButton# *prev_rb, int16_tcxx . . $ int16_t# id, const char *name, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y,
2414 bool is_long) {
2415 m_bkgcxx . . $ newuiButton#m_bkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(is_long ? NEWUI_LBTN_FILEcxx . . $ `Descent3/newui_core.cpp:266:9`! : NEWUI_BTN_FILEcxx . . $ `Descent3/newui_core.cpp:268:9`!);
2416 m_litbkgcxx . . $ newuiButton#m_litbkg. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(is_long ? NEWUI_LCHKBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:275:9`! : NEWUI_CHKBTNLIT_FILEcxx . . $ `Descent3/newui_core.cpp:277:9`!);
2417
2418 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{""};
2419 UIRadioButtoncxx . . $ UIRadioButton#::Createcxx . . $ UIRadioButton#Create(2c6e3f78865b93cb).(wnd, prev_rb, id, &item, x, y, 10, 8, UIF_FITcxx . . $ `ui/ui.h:343:9`!);
2420 newuiButtoncxx . . $ newuiButton#::InitStatescxx . . $ newuiButton#InitStates(e7abf97c08fae620).(name, is_long);
2421 }
2422
2423 // this will use the newuiButton drawing scheme
2424 void newuiRadioButtoncxx . . $ newuiRadioButton#::OnDrawcxx . . $ newuiRadioButton#OnDraw(49f6e7a06ebc5aa8).() { newuiButtoncxx . . $ newuiButton#::OnDrawcxx . . $ newuiButton#OnDraw(49f6e7a06ebc5aa8).(); }
2425
2426 //////////////////////////////////////////////////////////////////////////////
2427 // CLASS a new slider.
2428
2429 newuiSlidercxx . . $ newuiSlider#::newuiSlidercxx . . $ newuiSlider#newuiSlider(49f6e7a06ebc5aa8).() {
2430 m_poscxx . . $ newuiSlider#m_pos. = m_unitrangecxx . . $ newuiSlider#m_unitrange. = 0;
2431 m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2432 m_titlecxx . . $ newuiSlider#m_title. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2433 }
2434
2435 void newuiSlidercxx . . $ newuiSlider#::Createcxx . . $ newuiSlider#Create(6c82988af4899650).(UIWindowcxx . . $ UIWindow# *wnd, int16_tcxx . . $ int16_t# id, const char *name, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, int16_tcxx . . $ int16_t# range) {
2436 ASSERTcxx . . $ `misc/pserror.h:246:9`!(range > 0);
2437
2438 if (name) {
2439 m_titlecxx . . $ newuiSlider#m_title. = MonitorSmallTextcxx . . $ MonitorSmallText(a7872db8a769bd23).(name);
2440 }
2441
2442 m_poscxx . . $ newuiSlider#m_pos. = range;
2443 m_unitrangecxx . . $ newuiSlider#m_unitrange. = range;
2444 m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_SLIDER_FILEcxx . . $ `Descent3/newui_core.cpp:278:9`!);
2445
2446 UIGadgetcxx . . $ UIGadget#::Createcxx . . $ UIGadget#Create(43707b8add2f137d).(wnd, id, x, y, 10, 10, 0);
2447
2448 m_unit_settingscxx . . $ newuiSlider#m_unit_settings..typecxx . . $ tSliderSettings#type. = -1;
2449 }
2450
2451 void newuiSlidercxx . . $ newuiSlider#::Offsetcxx . . $ newuiSlider#Offset(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# offs) { newuiSlidercxx . . $ newuiSlider#::SetPoscxx . . $ newuiSlider#SetPos(68e3ae50fe6578a9).(m_poscxx . . $ newuiSlider#m_pos. + offs); }
2452
2453 void newuiSlidercxx . . $ newuiSlider#::SetPoscxx . . $ newuiSlider#SetPos(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# pos) {
2454 if (pos < 0)
2455 pos = 0;
2456 if (pos > m_unitrangecxx . . $ newuiSlider#m_unitrange.)
2457 pos = m_unitrangecxx . . $ newuiSlider#m_unitrange.;
2458 m_poscxx . . $ newuiSlider#m_pos. = pos;
2459 }
2460
2461 void newuiSlidercxx . . $ newuiSlider#::SetRangecxx . . $ newuiSlider#SetRange(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# range) { m_unitrangecxx . . $ newuiSlider#m_unitrange. = range; }
2462
2463 // when gadget is added to a window (AddGadget is called)
2464 void newuiSlidercxx . . $ newuiSlider#::OnAttachToWindowcxx . . $ newuiSlider#OnAttachToWindow(49f6e7a06ebc5aa8).() {
2465 int16_tcxx . . $ int16_t# bx = m_Xcxx . . $ UIObject#m_X., by = m_Ycxx . . $ UIObject#m_Y.;
2466
2467 if (m_titlecxx . . $ newuiSlider#m_title.) {
2468 by += m_titlecxx . . $ newuiSlider#m_title.->heightcxx . . $ UITextItem#height(b126dc7c1de90089).() + 5;
2469 bx += 2;
2470 }
2471
2472 m_minus_btncxx . . $ newuiSlider#m_minus_btn..Createcxx . . $ newuiArrowButton#Create(a92569a4941e4071).(m_Wndcxx . . $ UIGadget#m_Wnd., -1, NEWUI_ARROW_LEFTcxx . . $ `Descent3/newui_core.h:99:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, bx, by);
2473 m_minus_btncxx . . $ newuiSlider#m_minus_btn..SetFlagcxx . . $ UIGadget#SetFlag(d4f767463ce0a6b3).(UIF_NOTIFYMASTERSELcxx . . $ `ui/ui.h:346:9`!);
2474 AttachSlaveGadgetcxx . . $ UIGadget#AttachSlaveGadget(627f6e6cf27f18b7).(&m_minus_btncxx . . $ newuiSlider#m_minus_btn.);
2475 m_plus_btncxx . . $ newuiSlider#m_plus_btn..Createcxx . . $ newuiArrowButton#Create(a92569a4941e4071).(m_Wndcxx . . $ UIGadget#m_Wnd., -1, NEWUI_ARROW_RIGHTcxx . . $ `Descent3/newui_core.h:100:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, bx + m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp.->widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() - 24, by);
2476 m_plus_btncxx . . $ newuiSlider#m_plus_btn..SetFlagcxx . . $ UIGadget#SetFlag(d4f767463ce0a6b3).(UIF_NOTIFYMASTERSELcxx . . $ `ui/ui.h:346:9`!);
2477 AttachSlaveGadgetcxx . . $ UIGadget#AttachSlaveGadget(627f6e6cf27f18b7).(&m_plus_btncxx . . $ newuiSlider#m_plus_btn.);
2478 }
2479
2480 // when gadget is detached from window
2481 void newuiSlidercxx . . $ newuiSlider#::OnDetachFromWindowcxx . . $ newuiSlider#OnDetachFromWindow(49f6e7a06ebc5aa8).() {
2482 if (m_plus_btncxx . . $ newuiSlider#m_plus_btn..IsCreatedcxx . . $ UIObject#IsCreated(50ce9a9e25b4a850).()) {
2483 DetachSlaveGadgetcxx . . $ UIGadget#DetachSlaveGadget(627f6e6cf27f18b7).(&m_plus_btncxx . . $ newuiSlider#m_plus_btn.);
2484 m_plus_btncxx . . $ newuiSlider#m_plus_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
2485 }
2486 if (m_minus_btncxx . . $ newuiSlider#m_minus_btn..IsCreatedcxx . . $ UIObject#IsCreated(50ce9a9e25b4a850).()) {
2487 DetachSlaveGadgetcxx . . $ UIGadget#DetachSlaveGadget(627f6e6cf27f18b7).(&m_minus_btncxx . . $ newuiSlider#m_minus_btn.);
2488 m_minus_btncxx . . $ newuiSlider#m_minus_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
2489 }
2490 }
2491
2492 void newuiSlidercxx . . $ newuiSlider#::SetUnitscxx . . $ newuiSlider#SetUnits(4353f1a13209e2eb).(tSliderSettingscxx . . $ tSliderSettings# *settings) {
2493 if (settings == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
2494 m_unit_settingscxx . . $ newuiSlider#m_unit_settings..typecxx . . $ tSliderSettings#type. = -1;
2495 } else {
2496 memcpy(&m_unit_settingscxx . . $ newuiSlider#m_unit_settings., settings, sizeof(m_unit_settingscxx . . $ newuiSlider#m_unit_settings.));
2497 }
2498 }
2499
2500 void newuiSlidercxx . . $ newuiSlider#::OnFormatcxx . . $ newuiSlider#OnFormat(49f6e7a06ebc5aa8).() {
2501 if (m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp.) {
2502 m_Wcxx . . $ UIObject#m_W. = m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp.->widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).();
2503 m_Hcxx . . $ UIObject#m_H. = m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp.->heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).();
2504 if (m_titlecxx . . $ newuiSlider#m_title.) {
2505 m_Hcxx . . $ UIObject#m_H. += m_titlecxx . . $ newuiSlider#m_title.->heightcxx . . $ UITextItem#height(b126dc7c1de90089).();
2506 }
2507 }
2508 }
2509
2510 void newuiSlidercxx . . $ newuiSlider#::OnLostFocuscxx . . $ newuiSlider#OnLostFocus(49f6e7a06ebc5aa8).() {
2511 if (m_titlecxx . . $ newuiSlider#m_title.) {
2512 m_titlecxx . . $ newuiSlider#m_title.->set_flagscxx . . $ UISnazzyTextItem#set_flags(cb2f890c2fdad230).(0);
2513 }
2514 }
2515
2516 void newuiSlidercxx . . $ newuiSlider#::OnGainFocuscxx . . $ newuiSlider#OnGainFocus(49f6e7a06ebc5aa8).() {
2517 if (m_titlecxx . . $ newuiSlider#m_title.) {
2518 m_titlecxx . . $ newuiSlider#m_title.->set_flagscxx . . $ UISnazzyTextItem#set_flags(cb2f890c2fdad230).(UISNAZZYTEXTF_BLINKINGcxx . . $ `ui/uires.h:180:9`!);
2519 }
2520 }
2521
2522 // override: behavior when key pressed.
2523 void newuiSlidercxx . . $ newuiSlider#::OnKeyDowncxx . . $ newuiSlider#OnKeyDown(d4f767463ce0a6b3).(int key) {
2524 if (key == KEY_LEFTcxx . . $ `ddio/ddio_common.h:320:9`!) {
2525 newuiSlidercxx . . $ newuiSlider#::Offsetcxx . . $ newuiSlider#Offset(68e3ae50fe6578a9).(-1);
2526 UIGadgetcxx . . $ UIGadget#::OnSelectcxx . . $ UIGadget#OnSelect(49f6e7a06ebc5aa8).();
2527 }
2528 if (key == KEY_RIGHTcxx . . $ `ddio/ddio_common.h:321:9`!) {
2529 newuiSlidercxx . . $ newuiSlider#::Offsetcxx . . $ newuiSlider#Offset(68e3ae50fe6578a9).(1);
2530 UIGadgetcxx . . $ UIGadget#::OnSelectcxx . . $ UIGadget#OnSelect(49f6e7a06ebc5aa8).();
2531 }
2532 }
2533
2534 // override: behavior when key released.
2535 void newuiSlidercxx . . $ newuiSlider#::OnKeyUpcxx . . $ newuiSlider#OnKeyUp(d4f767463ce0a6b3).(int key) {}
2536
2537 void newuiSlidercxx . . $ newuiSlider#::OnDrawcxx . . $ newuiSlider#OnDraw(49f6e7a06ebc5aa8).() {
2538 int ox = 0, oy = 0;
2539 int x, lx;
2540 float percent_full, delta_g, green_intensity;
2541
2542 percent_full = (float)m_poscxx . . $ newuiSlider#m_pos. / (float)m_unitrangecxx . . $ newuiSlider#m_unitrange.;
2543
2544 // draw units value if available
2545 if (m_unit_settingscxx . . $ newuiSlider#m_unit_settings..typecxx . . $ tSliderSettings#type. > -1) {
2546 char str[8];
2547
2548 switch (m_unit_settingscxx . . $ newuiSlider#m_unit_settings..typecxx . . $ tSliderSettings#type.) {
2549 case SLIDER_UNITS_INTcxx . . $ `Descent3/newui_core.h:163:9`!:
2550 snprintf(str, sizeof(str), "%d",
2551 m_unit_settingscxx . . $ newuiSlider#m_unit_settings..min_valcxx . . $ tSliderSettings#min_val..icxx . . $ tSliderSettings#$anonymous_type_0#i. +
2552 (int)floorcxx . . $ floor(fbcf3211dfe1bfd1).((m_unit_settingscxx . . $ newuiSlider#m_unit_settings..max_valcxx . . $ tSliderSettings#max_val..icxx . . $ tSliderSettings#$anonymous_type_1#i. - m_unit_settingscxx . . $ newuiSlider#m_unit_settings..min_valcxx . . $ tSliderSettings#min_val..icxx . . $ tSliderSettings#$anonymous_type_0#i.) * percent_full + 0.5f));
2553 break;
2554 case SLIDER_UNITS_FLOATcxx . . $ `Descent3/newui_core.h:165:9`!:
2555 snprintf(str, sizeof(str), "%.2f",
2556 m_unit_settingscxx . . $ newuiSlider#m_unit_settings..min_valcxx . . $ tSliderSettings#min_val..fcxx . . $ tSliderSettings#$anonymous_type_0#f. + (m_unit_settingscxx . . $ newuiSlider#m_unit_settings..max_valcxx . . $ tSliderSettings#max_val..fcxx . . $ tSliderSettings#$anonymous_type_1#f. - m_unit_settingscxx . . $ newuiSlider#m_unit_settings..min_valcxx . . $ tSliderSettings#min_val..fcxx . . $ tSliderSettings#$anonymous_type_0#f.) * percent_full);
2557 break;
2558 case SLIDER_UNITS_PERCENTcxx . . $ `Descent3/newui_core.h:164:9`!:
2559 snprintf(str, sizeof(str), "%d%%", (int)((percent_full * 100.0f) + 0.5f));
2560 break;
2561 default:
2562 Int3cxx . . $ `misc/pserror.h:247:9`!();
2563 str[0] = 0;
2564 }
2565
2566 UITextItemcxx . . $ UITextItem# value_txtcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, str, NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!);
2567 value_txt.drawcxx . . $ UITextItem#draw(84329bcd07240ccf).(ox + m_Wcxx . . $ UIObject#m_W. - value_txt.widthcxx . . $ UITextItem#width(b126dc7c1de90089).() - 1, oy + 1);
2568 }
2569
2570 // draw graphic bar first
2571 if (m_titlecxx . . $ newuiSlider#m_title.) {
2572 m_titlecxx . . $ newuiSlider#m_title.->drawcxx . . $ UISnazzyTextItem#draw(84329bcd07240ccf).(ox, oy + 1);
2573 oy += m_titlecxx . . $ newuiSlider#m_title.->heightcxx . . $ UITextItem#height(b126dc7c1de90089).() + 2;
2574 }
2575
2576 // draw bar frame
2577 if (m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp.) {
2578 m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp.->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(ox, oy);
2579 ox += 20; // move to where bar will be filled in.
2580 oy += 2;
2581 }
2582
2583 // draw slider bar now.
2584 int width = m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp.->widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() - 42;
2585 int height = m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp.->heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).() - 6;
2586
2587 lx = (percent_full * width) + ox;
2588 delta_g = (lx - ox) ? (percent_full * 255.0f) / (lx - ox) : 0.0f;
2589 green_intensity = 0.0f;
2590
2591 for (x = ox; x < lx; x++) {
2592 ui_DrawLinecxx . . $ ui_DrawLine(fe09a4b73d8d396f).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, green_intensity, 0), x, oy + 1, x, oy + height - 1);
2593 green_intensity += delta_g;
2594 }
2595 }
2596
2597 void newuiSlidercxx . . $ newuiSlider#::OnDestroycxx . . $ newuiSlider#OnDestroy(49f6e7a06ebc5aa8).() {
2598 if (m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp.) {
2599 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp.);
2600 m_bar_bmpcxx . . $ newuiSlider#m_bar_bmp. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2601 }
2602 if (m_titlecxx . . $ newuiSlider#m_title.) {
2603 delete m_titlecxx . . $ newuiSlider#m_title.;
2604 m_titlecxx . . $ newuiSlider#m_title. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2605 }
2606 }
2607
2608 // this function will handle when an arrow button was pressed
2609 void newuiSlidercxx . . $ newuiSlider#::OnNotifySelectcxx . . $ newuiSlider#OnNotifySelect(627f6e6cf27f18b7).(UIGadgetcxx . . $ UIGadget# *g) {
2610 switch (g->GetDatumcxx . . $ UIGadget#GetDatum(524863554b4a534e).()) {
2611 case NEWUI_ARROW_LEFTcxx . . $ `Descent3/newui_core.h:99:9`!:
2612 newuiSlidercxx . . $ newuiSlider#::Offsetcxx . . $ newuiSlider#Offset(68e3ae50fe6578a9).(-1);
2613 break;
2614 case NEWUI_ARROW_RIGHTcxx . . $ `Descent3/newui_core.h:100:9`!:
2615 newuiSlidercxx . . $ newuiSlider#::Offsetcxx . . $ newuiSlider#Offset(68e3ae50fe6578a9).(1);
2616 break;
2617 }
2618
2619 UIGadgetcxx . . $ UIGadget#::OnSelectcxx . . $ UIGadget#OnSelect(49f6e7a06ebc5aa8).();
2620 }
2621
2622 // CLASS a new listbox. uses less memory than the old listbox hopefully.
2623
2624 newuiListBoxcxx . . $ newuiListBox#::newuiListBoxcxx . . $ newuiListBox#newuiListBox(49f6e7a06ebc5aa8).() {
2625 m_ItemListcxx . . $ newuiListBox#m_ItemList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2626 m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2627 m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2628 selectchange_fncxx . . $ newuiListBox#selectchange_fn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2629 selectchange_id_fncxx . . $ newuiListBox#selectchange_id_fn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2630 m_callbackptrcxx . . $ newuiListBox#m_callbackptr. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2631 m_NumItemscxx . . $ newuiListBox#m_NumItems. = 0;
2632 m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. = -1;
2633 m_Indexcxx . . $ newuiListBox#m_Index. = 0;
2634 m_NumVisibleItemscxx . . $ newuiListBox#m_NumVisibleItems. = 0;
2635 m_mse_clickedcxx . . $ newuiListBox#m_mse_clicked. = false;
2636 m_nclickscxx . . $ newuiListBox#m_nclicks. = 0;
2637 m_mse_xcxx . . $ newuiListBox#m_mse_x. = 0;
2638 m_mse_ycxx . . $ newuiListBox#m_mse_y. = 0;
2639 m_click_timecxx . . $ newuiListBox#m_click_time. = 0.0f;
2640 }
2641
2642 void newuiListBoxcxx . . $ newuiListBox#::Createcxx . . $ newuiListBox#Create(e6e6eb18e32bd8f).(UIWindowcxx . . $ UIWindow# *wnd, int16_tcxx . . $ int16_t# id, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, int16_tcxx . . $ int16_t# w, int16_tcxx . . $ int16_t# h, uint16_tcxx . . $ uint16_t# flags) {
2643 m_ItemListcxx . . $ newuiListBox#m_ItemList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2644 m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2645 m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2646 selectchange_fncxx . . $ newuiListBox#selectchange_fn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2647 selectchange_id_fncxx . . $ newuiListBox#selectchange_id_fn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2648 m_callbackptrcxx . . $ newuiListBox#m_callbackptr. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2649 m_NumItemscxx . . $ newuiListBox#m_NumItems. = 0;
2650 m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. = -1;
2651 m_Indexcxx . . $ newuiListBox#m_Index. = 0;
2652 m_NumVisibleItemscxx . . $ newuiListBox#m_NumVisibleItems. = 0;
2653 m_boffscxx . . $ newuiListBox#m_boffs. = 12;
2654 m_nclickscxx . . $ newuiListBox#m_nclicks. = 0;
2655 m_mse_clickedcxx . . $ newuiListBox#m_mse_clicked. = false;
2656 m_click_timecxx . . $ newuiListBox#m_click_time. = 0.0f;
2657
2658 m_piecescxx . . $ newuiListBox#m_pieces.[N_PIECE_IDXcxx . . $ `Descent3/newui_core.h:85:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LB_N_FILEcxx . . $ `Descent3/newui_core.cpp:298:9`!);
2659 m_piecescxx . . $ newuiListBox#m_pieces.[NE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:86:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LB_NE_FILEcxx . . $ `Descent3/newui_core.cpp:299:9`!);
2660 m_piecescxx . . $ newuiListBox#m_pieces.[E_PIECE_IDXcxx . . $ `Descent3/newui_core.h:87:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LB_E_FILEcxx . . $ `Descent3/newui_core.cpp:300:9`!);
2661 m_piecescxx . . $ newuiListBox#m_pieces.[SE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:88:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LB_SE_FILEcxx . . $ `Descent3/newui_core.cpp:301:9`!);
2662 m_piecescxx . . $ newuiListBox#m_pieces.[S_PIECE_IDXcxx . . $ `Descent3/newui_core.h:89:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LB_S_FILEcxx . . $ `Descent3/newui_core.cpp:302:9`!);
2663 m_piecescxx . . $ newuiListBox#m_pieces.[SW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:90:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LB_SW_FILEcxx . . $ `Descent3/newui_core.cpp:303:9`!);
2664 m_piecescxx . . $ newuiListBox#m_pieces.[W_PIECE_IDXcxx . . $ `Descent3/newui_core.h:91:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LB_W_FILEcxx . . $ `Descent3/newui_core.cpp:304:9`!);
2665 m_piecescxx . . $ newuiListBox#m_pieces.[NW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:92:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_LB_NW_FILEcxx . . $ `Descent3/newui_core.cpp:305:9`!);
2666
2667 // determine true width and height (snap width and height to 32 pixel boundaries
2668 int16_tcxx . . $ int16_t# p_w = LB_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:360:9`!, p_h = LB_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:361:9`!;
2669 int16_tcxx . . $ int16_t# t_width = (w / p_w);
2670 int16_tcxx . . $ int16_t# t_height = (h / p_h);
2671 if (w % p_w)
2672 t_width++;
2673 if (h % p_h)
2674 t_height++;
2675 w = t_width * p_w;
2676 h = t_height * p_h;
2677
2678 UIGadgetcxx . . $ UIGadget#::Createcxx . . $ UIGadget#Create(43707b8add2f137d).(wnd, id, x, y, w, h, flags);
2679 }
2680
2681 // functions to add or remove items,
2682 void newuiListBoxcxx . . $ newuiListBox#::AddItemcxx . . $ newuiListBox#AddItem(85c52e162fed56f9).(const char *name) {
2683 char **temp;
2684 int i;
2685 int *tempvirt2real, *tempreal2virt;
2686 int real_index = -1;
2687
2688 if (m_Flagscxx . . $ UIGadget#m_Flags. & UILB_NOSORTcxx . . $ `ui/ui.h:356:9`!) {
2689 // insert without sort
2690
2691 if ((m_NumItemscxx . . $ newuiListBox#m_NumItems. % LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) == 0) {
2692 // dynamically allocated memory for listbox, expand as needed.
2693 temp = (char **)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(char *));
2694 tempvirt2real = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(int));
2695 tempreal2virt = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(int));
2696
2697 if (m_ItemListcxx . . $ newuiListBox#m_ItemList.) {
2698 for (i = 0; i < m_NumItemscxx . . $ newuiListBox#m_NumItems.; i++) {
2699 temp[i] = m_ItemListcxx . . $ newuiListBox#m_ItemList.[i];
2700 tempvirt2real[i] = m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.[i];
2701 tempreal2virt[i] = m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[i];
2702 }
2703
2704 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList);
2705 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Virt2Real);
2706 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Real2Virt);
2707 }
2708 m_ItemListcxx . . $ newuiListBox#m_ItemList. = temp;
2709 m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real. = tempvirt2real;
2710 m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt. = tempreal2virt;
2711 }
2712
2713 real_index = m_NumItemscxx . . $ newuiListBox#m_NumItems.;
2714 } else {
2715 // only text item listboxes!
2716
2717 // insert with sorting
2718 if ((m_NumItemscxx . . $ newuiListBox#m_NumItems. % LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) == 0) {
2719 // dynamically allocated memory for listbox, expand as needed.
2720 int oidx = 0, cidx = 0;
2721 int pidx = 0;
2722 int result;
2723
2724 temp = (char **)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(char *));
2725 tempvirt2real = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(int));
2726 tempreal2virt = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(int));
2727
2728 real_index = -1;
2729
2730 if (m_ItemListcxx . . $ newuiListBox#m_ItemList.) {
2731 while (oidx <= m_NumItemscxx . . $ newuiListBox#m_NumItems.) {
2732 if (oidx == m_NumItemscxx . . $ newuiListBox#m_NumItems.) {
2733 if (real_index == -1) {
2734 real_index = oidx;
2735 } else {
2736 temp[cidx] = m_ItemListcxx . . $ newuiListBox#m_ItemList.[pidx];
2737 tempreal2virt[cidx] = m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[pidx];
2738 }
2739 oidx++;
2740 continue;
2741 }
2742
2743 if (m_Flagscxx . . $ UIGadget#m_Flags. & UILB_CASESENSITIVEcxx . . $ `ui/ui.h:357:9`!)
2744 result = strcmp(m_ItemListcxx . . $ newuiListBox#m_ItemList.[cidx], name);
2745 else
2746 result = stricmpcxx . . $ `linux/linux_fix.h:43:9`!(m_ItemList[cidx], name);
2747 if (result < 0) {
2748 // copy old
2749 temp[cidx] = m_ItemListcxx . . $ newuiListBox#m_ItemList.[pidx];
2750 tempreal2virt[cidx] = m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[pidx];
2751 cidx++;
2752 pidx++;
2753 } else if (result >= 0) {
2754 // see if we need to insert, if not just keep copying
2755 if (real_index == -1) {
2756 real_index = cidx;
2757 cidx++;
2758 } else {
2759 temp[cidx] = m_ItemListcxx . . $ newuiListBox#m_ItemList.[pidx];
2760 tempreal2virt[cidx] = m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[pidx];
2761 cidx++;
2762 pidx++;
2763 }
2764 }
2765 oidx++;
2766 }
2767 ASSERTcxx . . $ `misc/pserror.h:246:9`!(real_index != -1);
2768
2769 // now we need to fix m_Virt2Real to represent the new structure,
2770 // all values>=real_index must be incremented
2771 for (oidx = 0; oidx <= m_NumItemscxx . . $ newuiListBox#m_NumItems.; oidx++) {
2772 if (oidx < m_NumItemscxx . . $ newuiListBox#m_NumItems.) {
2773 tempvirt2real[oidx] = m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.[oidx];
2774
2775 // if(oidx!=real_index){
2776 if (tempvirt2real[oidx] >= real_index)
2777 tempvirt2real[oidx]++;
2778 }
2779 }
2780
2781 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList);
2782 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Virt2Real);
2783 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Real2Virt);
2784 } else {
2785 real_index = 0;
2786 }
2787
2788 m_ItemListcxx . . $ newuiListBox#m_ItemList. = temp;
2789 m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real. = tempvirt2real;
2790 m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt. = tempreal2virt;
2791 } else {
2792 // find where to insert, without allocating memory
2793 int oidx = 0, cidx = 0;
2794 real_index = -1;
2795 int result;
2796
2797 int old_r2v;
2798 char *old_item = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2799
2800 while (oidx <= m_NumItemscxx . . $ newuiListBox#m_NumItems.) {
2801
2802 if (oidx == m_NumItemscxx . . $ newuiListBox#m_NumItems.) {
2803 // we're past the slot of the old buffer
2804 if (real_index == -1) {
2805 // we haven't set the real index yet, so it has to go here
2806 real_index = m_NumItemscxx . . $ newuiListBox#m_NumItems.;
2807 } else {
2808 // the real index has been set, we're still pulling back
2809 m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[cidx] = old_r2v;
2810 m_ItemListcxx . . $ newuiListBox#m_ItemList.[cidx] = old_item;
2811 }
2812 oidx++;
2813 continue;
2814 } else {
2815 if (m_Flagscxx . . $ UIGadget#m_Flags. & UILB_CASESENSITIVEcxx . . $ `ui/ui.h:357:9`!)
2816 result = strcmp(m_ItemListcxx . . $ newuiListBox#m_ItemList.[cidx], name);
2817 else
2818 result = stricmpcxx . . $ `linux/linux_fix.h:43:9`!(m_ItemList[cidx], name);
2819 }
2820
2821 if (result < 0) {
2822 // we haven't gotten to the string yet, keep as they are
2823 cidx++;
2824 } else if (result >= 0) {
2825 // see if we need to insert, if not just keep copying
2826 if (real_index == -1) {
2827 // we need to insert here
2828 real_index = cidx;
2829 old_item = m_ItemListcxx . . $ newuiListBox#m_ItemList.[cidx];
2830 old_r2v = m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[cidx];
2831 cidx++;
2832 } else {
2833 // old_item and old_r2v should be set!
2834 ASSERTcxx . . $ `misc/pserror.h:246:9`!(old_item);
2835 char *oi;
2836 int or2v;
2837
2838 or2v = m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[cidx];
2839 oi = m_ItemListcxx . . $ newuiListBox#m_ItemList.[cidx];
2840
2841 m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[cidx] = old_r2v;
2842 m_ItemListcxx . . $ newuiListBox#m_ItemList.[cidx] = old_item;
2843 old_r2v = or2v;
2844 old_item = oi;
2845
2846 cidx++;
2847 }
2848 }
2849
2850 // continue on
2851 oidx++;
2852 }
2853
2854 ASSERTcxx . . $ `misc/pserror.h:246:9`!(real_index != -1);
2855
2856 // now we need to fix m_Virt2Real to represent the new structure,
2857 // all values>=real_index must be incremented
2858 cidx = 0;
2859 for (oidx = 0; oidx <= m_NumItemscxx . . $ newuiListBox#m_NumItems.; oidx++) {
2860 if (oidx != real_index) {
2861 if (m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.[cidx] >= real_index)
2862 m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.[cidx]++;
2863 cidx++;
2864 }
2865 }
2866 }
2867 }
2868
2869 // copy item passed to list.
2870 m_ItemListcxx . . $ newuiListBox#m_ItemList.[real_index] = mem_strdupcxx . . $ `mem/mem.h:81:9`!(name);
2871 m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.[m_NumItemscxx . . $ newuiListBox#m_NumItems.] = real_index;
2872 m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[real_index] = m_NumItemscxx . . $ newuiListBox#m_NumItems.;
2873 m_NumItemscxx . . $ newuiListBox#m_NumItems.++;
2874
2875 if (real_index <= m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.) {
2876 // adjust selected index
2877 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. < m_NumItemscxx . . $ newuiListBox#m_NumItems. - 1)
2878 m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.++;
2879 }
2880 }
2881
2882 void newuiListBoxcxx . . $ newuiListBox#::RemoveItemcxx . . $ newuiListBox#RemoveItem(85c52e162fed56f9).(const char *name) {
2883 int i, j, found = -1;
2884
2885 for (i = 0; i < m_NumItemscxx . . $ newuiListBox#m_NumItems.; i++) {
2886 int res;
2887 res = (m_Flagscxx . . $ UIGadget#m_Flags. & UILB_CASESENSITIVEcxx . . $ `ui/ui.h:357:9`!) ? stricmpcxx . . $ `linux/linux_fix.h:43:9`!(m_ItemList[i], name) : strcmp(m_ItemListcxx . . $ newuiListBox#m_ItemList.[i], name);
2888 if (res == 0) {
2889 found = i;
2890 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList[found]);
2891 m_ItemListcxx . . $ newuiListBox#m_ItemList.[found] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2892 break;
2893 }
2894 }
2895 if (found == -1) {
2896 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "newuiListBox:: Didn't find item to remove!\n");
2897 return;
2898 }
2899
2900 // found is the real index to remove
2901 // go through virt2real and subtract one from values of found or higher
2902 // go through real2virt and move everything from index found on down, and subtract
2903 // 1 from those with value of found or higher
2904 int real_index = found; // index to remove
2905 int virt_index = m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[found]; // index to remove
2906 int real_thresh = virt_index;
2907 int virt_thresh = real_index;
2908
2909 for (j = 0; j < (m_NumItemscxx . . $ newuiListBox#m_NumItems. - 1); j++) {
2910 if (j >= real_index) {
2911 m_ItemListcxx . . $ newuiListBox#m_ItemList.[j] = m_ItemListcxx . . $ newuiListBox#m_ItemList.[j + 1];
2912 m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[j] = m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[j + 1];
2913 }
2914
2915 if (j >= virt_index) {
2916 m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.[j] = m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.[j + 1];
2917 }
2918
2919 if (m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[j] >= real_thresh)
2920 m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[j]--;
2921
2922 if (m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.[j] >= virt_thresh)
2923 m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.[j]--;
2924 }
2925 m_NumItemscxx . . $ newuiListBox#m_NumItems.--;
2926
2927 if (real_index <= m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.) {
2928 // adjust selected index
2929 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. > 0)
2930 m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.--;
2931 }
2932 }
2933
2934 void newuiListBoxcxx . . $ newuiListBox#::RemoveAllcxx . . $ newuiListBox#RemoveAll(49f6e7a06ebc5aa8).() {
2935 m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. = -1;
2936
2937 if (m_ItemListcxx . . $ newuiListBox#m_ItemList.) {
2938 int i;
2939 for (i = 0; i < m_NumItemscxx . . $ newuiListBox#m_NumItems.; i++) {
2940 if (m_ItemListcxx . . $ newuiListBox#m_ItemList.[i])
2941 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList[i]);
2942 }
2943 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList);
2944 }
2945
2946 if (m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.)
2947 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Virt2Real);
2948
2949 if (m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.)
2950 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Real2Virt);
2951
2952 m_ItemListcxx . . $ newuiListBox#m_ItemList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2953 m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2954 m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2955 m_Indexcxx . . $ newuiListBox#m_Index. = m_NumItemscxx . . $ newuiListBox#m_NumItems. = 0;
2956 }
2957
2958 // item information
2959 int newuiListBoxcxx . . $ newuiListBox#::GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).() {
2960 if (m_NumItemscxx . . $ newuiListBox#m_NumItems. == 0)
2961 return 0;
2962
2963 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. < 0)
2964 return m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.;
2965
2966 if (!m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.)
2967 return 0;
2968
2969 int virt_index = m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.];
2970 ASSERTcxx . . $ `misc/pserror.h:246:9`!(virt_index >= 0 && virt_index < m_NumItems);
2971 return virt_index;
2972 }
2973
2974 void newuiListBoxcxx . . $ newuiListBox#::SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).(int index) {
2975 if (m_NumItemscxx . . $ newuiListBox#m_NumItems. == 0)
2976 return;
2977
2978 if (index >= 0 && index < m_NumItemscxx . . $ newuiListBox#m_NumItems.) {
2979 int real_index = m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.[index], old_index = m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.;
2980 int i = 0, y;
2981
2982 ASSERTcxx . . $ `misc/pserror.h:246:9`!(real_index >= 0 && real_index < m_NumItems);
2983 m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. = real_index;
2984
2985 // determine how many items fit in a listbox the long way.
2986 for (i = 0, y = m_boffscxx . . $ newuiListBox#m_boffs.; i < m_NumItemscxx . . $ newuiListBox#m_NumItems.; i++) {
2987 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).(m_ItemListcxx . . $ newuiListBox#m_ItemList.[i]);
2988 item.set_fontcxx . . $ UITextItem#set_font(d4f767463ce0a6b3).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!);
2989
2990 y += item.heightcxx . . $ UITextItem#height(b126dc7c1de90089).();
2991 if (y > (m_Hcxx . . $ UIObject#m_H. - m_boffscxx . . $ newuiListBox#m_boffs. - item.heightcxx . . $ UITextItem#height(b126dc7c1de90089).())) {
2992 i++;
2993 break;
2994 }
2995 }
2996
2997 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. < m_Indexcxx . . $ newuiListBox#m_Index.) {
2998 m_Indexcxx . . $ newuiListBox#m_Index. = m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.;
2999 }
3000 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. >= (m_Indexcxx . . $ newuiListBox#m_Index. + i)) {
3001 m_Indexcxx . . $ newuiListBox#m_Index. = m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. - i + 1;
3002 }
3003 if (m_Indexcxx . . $ newuiListBox#m_Index. < 0) {
3004 m_Indexcxx . . $ newuiListBox#m_Index. = 0;
3005 }
3006
3007 // call callbacks if selection really changed.
3008 if (old_index != m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.) {
3009 if (selectchange_fncxx . . $ newuiListBox#selectchange_fn.)
3010 (*selectchange_fncxx . . $ newuiListBox#selectchange_fn.)(index);
3011 if (selectchange_id_fncxx . . $ newuiListBox#selectchange_id_fn.)
3012 (*selectchange_id_fncxx . . $ newuiListBox#selectchange_id_fn.)(GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).(), m_callbackptrcxx . . $ newuiListBox#m_callbackptr.);
3013 }
3014 }
3015 }
3016
3017 void newuiListBoxcxx . . $ newuiListBox#::SetInternalCurrentIndexcxx . . $ newuiListBox#SetInternalCurrentIndex(d4f767463ce0a6b3).(int index) {}
3018
3019 bool newuiListBoxcxx . . $ newuiListBox#::GetCurrentItemcxx . . $ newuiListBox#GetCurrentItem(37e8d18a243bba77).(char *buffer, int buflen) {
3020 return newuiListBoxcxx . . $ newuiListBox#::GetItemcxx . . $ newuiListBox#GetItem(3f730e01d352290e).(m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.], buffer, buflen);
3021 }
3022
3023 bool newuiListBoxcxx . . $ newuiListBox#::GetItemcxx . . $ newuiListBox#GetItem(3f730e01d352290e).(int index, char *buffer, int buflen) {
3024 if (m_NumItemscxx . . $ newuiListBox#m_NumItems. == 0) {
3025 return false;
3026 *buffer = 0;
3027 }
3028
3029 if (index >= 0 && index < m_NumItemscxx . . $ newuiListBox#m_NumItems.) {
3030 int real_index = m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.[index];
3031 ASSERTcxx . . $ `misc/pserror.h:246:9`!(real_index >= 0 && real_index < m_NumItems);
3032 strncpy(buffer, m_ItemListcxx . . $ newuiListBox#m_ItemList.[real_index], buflen - 1);
3033 buffer[buflen - 1] = 0;
3034 return true;
3035 }
3036
3037 return false;
3038 }
3039
3040 bool newuiListBoxcxx . . $ newuiListBox#::SetCurrentItemcxx . . $ newuiListBox#SetCurrentItem(c5f7da30cbc0f4e9).(const char *name) {
3041 int i, found = 0;
3042
3043 for (i = 0; i < m_NumItemscxx . . $ newuiListBox#m_NumItems.; i++) {
3044 int res = (m_Flagscxx . . $ UIGadget#m_Flags. & UILB_CASESENSITIVEcxx . . $ `ui/ui.h:357:9`!) ? stricmpcxx . . $ `linux/linux_fix.h:43:9`!(m_ItemList[i], name) : strcmp(m_ItemListcxx . . $ newuiListBox#m_ItemList.[i], name);
3045 if (res == 0) {
3046 SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).(m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[i]);
3047 found = 1;
3048 break;
3049 }
3050 }
3051
3052 if (!found) {
3053 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "newuiListBox::SelectItem item not found!\n");
3054 return false;
3055 }
3056
3057 return true;
3058 }
3059
3060 // set callbacks
3061 void newuiListBoxcxx . . $ newuiListBox#::SetSelectChangeCallbackcxx . . $ newuiListBox#SetSelectChangeCallback(94eb4457dc8d4d10).(void (*fn)(int)) { selectchange_fncxx . . $ newuiListBox#selectchange_fn. = fn; }
3062
3063 void newuiListBoxcxx . . $ newuiListBox#::SetSelectChangeCallbackcxx . . $ newuiListBox#SetSelectChangeCallback(af3d7c1df3fe7292).(void (*fn)(int, void *), void *ptr) {
3064 selectchange_id_fncxx . . $ newuiListBox#selectchange_id_fn. = fn;
3065 m_callbackptrcxx . . $ newuiListBox#m_callbackptr. = ptr;
3066 }
3067
3068 // override: behavior when gadget loses input focus.
3069 void newuiListBoxcxx . . $ newuiListBox#::OnLostFocuscxx . . $ newuiListBox#OnLostFocus(49f6e7a06ebc5aa8).() {}
3070
3071 // override: behavior when gadget gains input focus.
3072 void newuiListBoxcxx . . $ newuiListBox#::OnGainFocuscxx . . $ newuiListBox#OnGainFocus(49f6e7a06ebc5aa8).() {}
3073
3074 // behavior when gadget is being drawn.
3075 void newuiListBoxcxx . . $ newuiListBox#::OnDrawcxx . . $ newuiListBox#OnDraw(49f6e7a06ebc5aa8).() {
3076 int t_width = (m_Wcxx . . $ UIObject#m_W. / 32), tx, x;
3077 int t_height = (m_Hcxx . . $ UIObject#m_H. / 32), ty, y;
3078
3079 // draw tiles.
3080 tx = x = 0;
3081 ty = y = 0;
3082
3083 // top row.
3084 m_piecescxx . . $ newuiListBox#m_pieces.[NW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:92:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y);
3085 tx++;
3086 x += LB_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:360:9`!;
3087 while (tx++ < (t_width - 1)) {
3088 m_piecescxx . . $ newuiListBox#m_pieces.[N_PIECE_IDXcxx . . $ `Descent3/newui_core.h:85:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y);
3089 x += LB_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:360:9`!;
3090 }
3091 m_piecescxx . . $ newuiListBox#m_pieces.[NE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:86:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y);
3092 tx++;
3093 x = 0;
3094 y += LB_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:361:9`!;
3095 ty++;
3096
3097 // mid rows.
3098 while (ty++ < (t_height - 1)) {
3099 m_piecescxx . . $ newuiListBox#m_pieces.[W_PIECE_IDXcxx . . $ `Descent3/newui_core.h:91:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y);
3100 x += LB_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:360:9`!;
3101 tx = 1;
3102 while (tx++ < (t_width - 1)) {
3103 x += LB_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:360:9`!;
3104 }
3105 m_piecescxx . . $ newuiListBox#m_pieces.[E_PIECE_IDXcxx . . $ `Descent3/newui_core.h:87:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y);
3106 tx++;
3107 x = 0;
3108 y += LB_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:361:9`!;
3109 }
3110
3111 // bottom row.
3112 m_piecescxx . . $ newuiListBox#m_pieces.[SW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:90:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y);
3113 x += LB_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:360:9`!;
3114 tx = 1;
3115 while (tx++ < (t_width - 1)) {
3116 m_piecescxx . . $ newuiListBox#m_pieces.[S_PIECE_IDXcxx . . $ `Descent3/newui_core.h:89:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y);
3117 x += LB_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:360:9`!;
3118 }
3119 m_piecescxx . . $ newuiListBox#m_pieces.[SE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:88:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y);
3120 tx++;
3121 ty++;
3122
3123 // draw text?
3124 int i;
3125 uint8_tcxx . . $ uint8_t# alpha = 255;
3126 bool auto_select = ((m_Flagscxx . . $ UIGadget#m_Flags. & UILB_AUTOSELECTcxx . . $ `ui/ui.h:355:9`!) > 0);
3127 bool use_scroll = true;
3128
3129 ui_SetTextClipcxx . . $ ui_SetTextClip(748afa4755bc9595).(m_boffscxx . . $ newuiListBox#m_boffs., m_boffscxx . . $ newuiListBox#m_boffs., m_Wcxx . . $ UIObject#m_W. - m_boffscxx . . $ newuiListBox#m_boffs. - m_up_btncxx . . $ newuiListBox#m_up_btn..Wcxx . . $ UIObject#W(455f465bc33b4cdf).(), m_Hcxx . . $ UIObject#m_H. - m_boffscxx . . $ newuiListBox#m_boffs.);
3130
3131 for (i = m_Indexcxx . . $ newuiListBox#m_Index., y = m_boffscxx . . $ newuiListBox#m_boffs.; i < m_NumItemscxx . . $ newuiListBox#m_NumItems.; i++) {
3132 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).(m_ItemListcxx . . $ newuiListBox#m_ItemList.[i]);
3133 item.set_fontcxx . . $ UITextItem#set_font(d4f767463ce0a6b3).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!);
3134
3135 if (m_mse_clickedcxx . . $ newuiListBox#m_mse_clicked.) {
3136 if (m_mse_ycxx . . $ newuiListBox#m_mse_y. >= y && m_mse_ycxx . . $ newuiListBox#m_mse_y. <= (y + item.heightcxx . . $ UITextItem#height(b126dc7c1de90089).() - 1)) {
3137 if (m_mse_xcxx . . $ newuiListBox#m_mse_x. > m_boffscxx . . $ newuiListBox#m_boffs. && m_mse_xcxx . . $ newuiListBox#m_mse_x. < (m_Wcxx . . $ UIObject#m_W. - m_boffscxx . . $ newuiListBox#m_boffs. - 12)) {
3138 newuiListBoxcxx . . $ newuiListBox#::SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).((m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.) ? m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[i] : 0);
3139 // item.set_font(GADGET9_NEWUI_FONT);
3140 }
3141 }
3142 }
3143
3144 y += item.heightcxx . . $ UITextItem#height(b126dc7c1de90089).();
3145 if (y > (m_Hcxx . . $ UIObject#m_H. - m_boffscxx . . $ newuiListBox#m_boffs. - item.heightcxx . . $ UITextItem#height(b126dc7c1de90089).())) {
3146 break;
3147 }
3148 }
3149
3150 m_mse_clickedcxx . . $ newuiListBox#m_mse_clicked. = false;
3151
3152 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. == -1 && m_NumItemscxx . . $ newuiListBox#m_NumItems. > 0) {
3153 newuiListBoxcxx . . $ newuiListBox#::SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).(m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[0]);
3154 }
3155
3156 for (i = m_Indexcxx . . $ newuiListBox#m_Index., y = m_boffscxx . . $ newuiListBox#m_boffs.; i < m_NumItemscxx . . $ newuiListBox#m_NumItems.; i++) {
3157 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).(m_ItemListcxx . . $ newuiListBox#m_ItemList.[i]);
3158
3159 item.set_fontcxx . . $ UITextItem#set_font(d4f767463ce0a6b3).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!);
3160 item.set_colorcxx . . $ UITextItem#set_color(cb2f890c2fdad230).(NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!);
3161
3162 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. == i) {
3163 // draw a bar?
3164 ddgr_colorcxx . . $ ddgr_color# bar_color;
3165 // item.set_font(GADGET9_NEWUI_FONT);
3166 // item.set_color(NEWUI_GADGETFONT_COLOR);
3167 bar_color = m_infocuscxx . . $ UIGadget#m_infocus. ? GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 64, 0) : GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 32, 0);
3168 ui_DrawRectcxx . . $ ui_DrawRect(fe09a4b73d8d396f).(bar_color, m_boffscxx . . $ newuiListBox#m_boffs., y, m_Wcxx . . $ UIObject#m_W. - m_boffscxx . . $ newuiListBox#m_boffs. - m_up_btncxx . . $ newuiListBox#m_up_btn..Wcxx . . $ UIObject#W(455f465bc33b4cdf).(), y + item.heightcxx . . $ UITextItem#height(b126dc7c1de90089).());
3169 }
3170
3171 if (!m_infocuscxx . . $ UIGadget#m_infocus.) {
3172 item.set_alphacxx . . $ UITextItem#set_alpha(ac50b47256ae7414).(192);
3173 }
3174
3175 item.drawcxx . . $ UITextItem#draw(84329bcd07240ccf).(m_boffscxx . . $ newuiListBox#m_boffs., y);
3176
3177 y += item.heightcxx . . $ UITextItem#height(b126dc7c1de90089).();
3178 if (y > (m_Hcxx . . $ UIObject#m_H. - m_boffscxx . . $ newuiListBox#m_boffs. - item.heightcxx . . $ UITextItem#height(b126dc7c1de90089).())) {
3179 i++;
3180 break;
3181 }
3182 }
3183
3184 if (m_NumItemscxx . . $ newuiListBox#m_NumItems.) {
3185 if (use_scroll && auto_select) {
3186 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. < m_Indexcxx . . $ newuiListBox#m_Index.)
3187 newuiListBoxcxx . . $ newuiListBox#::SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).(m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[m_Indexcxx . . $ newuiListBox#m_Index.]);
3188 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. > i)
3189 newuiListBoxcxx . . $ newuiListBox#::SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).(m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[i]);
3190 }
3191 }
3192
3193 m_NumVisibleItemscxx . . $ newuiListBox#m_NumVisibleItems. = (i - m_Indexcxx . . $ newuiListBox#m_Index.);
3194
3195 ui_ResetTextClipcxx . . $ ui_ResetTextClip(49f6e7a06ebc5aa8).();
3196 }
3197
3198 // behavior when key is pressed.
3199 void newuiListBoxcxx . . $ newuiListBox#::OnKeyDowncxx . . $ newuiListBox#OnKeyDown(d4f767463ce0a6b3).(int key) {
3200 if (key == KEY_SPACEBARcxx . . $ `ddio/ddio_common.h:271:9`!) {
3201
3202 } else {
3203 int new_selected_index = m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.;
3204
3205 if (key == KEY_UPcxx . . $ `ddio/ddio_common.h:318:9`!) {
3206 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. > 0) {
3207 new_selected_index = m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. - 1;
3208 }
3209 } else if (key == KEY_DOWNcxx . . $ `ddio/ddio_common.h:319:9`!) {
3210 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. < (m_NumItemscxx . . $ newuiListBox#m_NumItems. - 1)) {
3211 new_selected_index = m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. + 1;
3212 }
3213 } else if (key == KEY_PAGEUPcxx . . $ `ddio/ddio_common.h:314:9`!) {
3214 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. != m_Indexcxx . . $ newuiListBox#m_Index.) {
3215 new_selected_index = m_Indexcxx . . $ newuiListBox#m_Index.;
3216 } else {
3217 new_selected_index = m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. - m_NumVisibleItemscxx . . $ newuiListBox#m_NumVisibleItems.;
3218 if (new_selected_index < 0)
3219 new_selected_index = 0;
3220 }
3221 } else if (key == KEY_PAGEDOWNcxx . . $ `ddio/ddio_common.h:317:9`!) {
3222 if (m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. != (m_Indexcxx . . $ newuiListBox#m_Index. + m_NumVisibleItemscxx . . $ newuiListBox#m_NumVisibleItems. - 1)) {
3223 new_selected_index = (m_Indexcxx . . $ newuiListBox#m_Index. + m_NumVisibleItemscxx . . $ newuiListBox#m_NumVisibleItems. - 1);
3224 } else {
3225 new_selected_index = m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. + m_NumVisibleItemscxx . . $ newuiListBox#m_NumVisibleItems.;
3226 if (new_selected_index >= m_NumItemscxx . . $ newuiListBox#m_NumItems.)
3227 new_selected_index = m_NumItemscxx . . $ newuiListBox#m_NumItems. - 1;
3228 }
3229 }
3230 newuiListBoxcxx . . $ newuiListBox#::SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).((m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.) ? m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.[new_selected_index] : 0);
3231 }
3232 }
3233
3234 // behavior when key is released.
3235 void newuiListBoxcxx . . $ newuiListBox#::OnKeyUpcxx . . $ newuiListBox#OnKeyUp(d4f767463ce0a6b3).(int key) {}
3236
3237 // behavior when mouse button is pressed.
3238 void newuiListBoxcxx . . $ newuiListBox#::OnMouseBtnDowncxx . . $ newuiListBox#OnMouseBtnDown(d4f767463ce0a6b3).(int btn) {
3239 bool mouse_in_gadget = PT_IN_GADGETcxx . . $ PT_IN_GADGET(55d2799d541f12b5).(m_Wndcxx . . $ UIGadget#m_Wnd., this, UI_inputcxx . . $ UI_input..mxcxx . . $ tUIInput#mx., UI_inputcxx . . $ UI_input..mycxx . . $ tUIInput#my.);
3240
3241 if (btn == UILMSEBTNcxx . . $ `ui/uisys.h:36:9`! && mouse_in_gadget) {
3242 float time_delta = 0.0f, old_click_time;
3243 m_mse_xcxx . . $ newuiListBox#m_mse_x. = SCREEN_TO_GAD_Xcxx . . $ SCREEN_TO_GAD_X(dafe5a5d85eeac89).(this, UI_inputcxx . . $ UI_input..mxcxx . . $ tUIInput#mx.);
3244 m_mse_ycxx . . $ newuiListBox#m_mse_y. = SCREEN_TO_GAD_Ycxx . . $ SCREEN_TO_GAD_Y(dafe5a5d85eeac89).(this, UI_inputcxx . . $ UI_input..mycxx . . $ tUIInput#my.);
3245 m_mse_clickedcxx . . $ newuiListBox#m_mse_clicked. = true;
3246
3247 old_click_time = m_click_timecxx . . $ newuiListBox#m_click_time.;
3248 m_click_timecxx . . $ newuiListBox#m_click_time. = UI_TIMEcxx . . $ UI_TIME(9b8c9e39889c762c).();
3249
3250 time_delta = m_click_timecxx . . $ newuiListBox#m_click_time. - old_click_time;
3251 if (time_delta > UI_DBLCLICK_DELAYcxx . . $ `ui/uisys.h:40:9`!) {
3252 m_nclickscxx . . $ newuiListBox#m_nclicks. = 0;
3253 }
3254
3255 if (m_nclickscxx . . $ newuiListBox#m_nclicks. == 0) {
3256 LOCK_FOCUScxx . . $ `ui/uisys.h:107:9`!(this);
3257 m_nclickscxx . . $ newuiListBox#m_nclicks. = 1;
3258 // mprintf(0, "click 1\n");
3259 } else if (m_nclickscxx . . $ newuiListBox#m_nclicks. == 2) {
3260 // mprintf(0, "click 2\n");
3261 LOCK_FOCUScxx . . $ `ui/uisys.h:107:9`!(this);
3262 if (((m_click_timecxx . . $ newuiListBox#m_click_time. - old_click_time) < UI_DBLCLICK_DELAYcxx . . $ `ui/uisys.h:40:9`!)) {
3263 if (abscxx . . $ abs(a1851578aea3f541).(m_mse_xcxx . . $ newuiListBox#m_mse_x. - m_last_mse_xcxx . . $ newuiListBox#m_last_mse_x.) < UI_DBLCLICK_MSEDELTAcxx . . $ `ui/uisys.h:41:9`! && abscxx . . $ abs(a1851578aea3f541).(m_mse_ycxx . . $ newuiListBox#m_mse_y. - m_last_mse_ycxx . . $ newuiListBox#m_last_mse_y.) < UI_DBLCLICK_MSEDELTAcxx . . $ `ui/uisys.h:41:9`!) {
3264 if (m_NumItemscxx . . $ newuiListBox#m_NumItems. > 0 && m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex. > -1) {
3265 int y, i;
3266 for (i = m_Indexcxx . . $ newuiListBox#m_Index., y = m_boffscxx . . $ newuiListBox#m_boffs.; i < m_NumItemscxx . . $ newuiListBox#m_NumItems.; i++) {
3267 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).(m_ItemListcxx . . $ newuiListBox#m_ItemList.[i]);
3268 item.set_fontcxx . . $ UITextItem#set_font(d4f767463ce0a6b3).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!);
3269
3270 if (m_mse_ycxx . . $ newuiListBox#m_mse_y. >= y && m_mse_ycxx . . $ newuiListBox#m_mse_y. <= (y + item.heightcxx . . $ UITextItem#height(b126dc7c1de90089).() - 1)) {
3271 if (m_mse_xcxx . . $ newuiListBox#m_mse_x. > m_boffscxx . . $ newuiListBox#m_boffs. && m_mse_xcxx . . $ newuiListBox#m_mse_x. < (m_Wcxx . . $ UIObject#m_W. - m_boffscxx . . $ newuiListBox#m_boffs. - 12)) {
3272 OnSelectcxx . . $ newuiListBox#OnSelect(49f6e7a06ebc5aa8).();
3273 // mprintf(0, "select!\n");
3274 m_nclickscxx . . $ newuiListBox#m_nclicks. = 0;
3275 break;
3276 }
3277 }
3278 y += item.heightcxx . . $ UITextItem#height(b126dc7c1de90089).();
3279 if (y > (m_Hcxx . . $ UIObject#m_H. - m_boffscxx . . $ newuiListBox#m_boffs. - item.heightcxx . . $ UITextItem#height(b126dc7c1de90089).())) {
3280 break;
3281 }
3282 }
3283 UNLOCK_FOCUScxx . . $ `ui/uisys.h:109:9`!(this);
3284 }
3285 }
3286 }
3287 if (m_nclickscxx . . $ newuiListBox#m_nclicks. == 2)
3288 m_nclickscxx . . $ newuiListBox#m_nclicks. = 3;
3289 }
3290 m_last_mse_xcxx . . $ newuiListBox#m_last_mse_x. = m_mse_xcxx . . $ newuiListBox#m_mse_x.;
3291 m_last_mse_ycxx . . $ newuiListBox#m_last_mse_y. = m_mse_ycxx . . $ newuiListBox#m_mse_y.;
3292 } else if (btn == UILMSEBTNcxx . . $ `ui/uisys.h:36:9`! && !mouse_in_gadget) {
3293 if (IsLockedcxx . . $ UIGadget#IsLocked(50ce9a9e25b4a850).())
3294 UNLOCK_FOCUScxx . . $ `ui/uisys.h:109:9`!(this);
3295 m_nclickscxx . . $ newuiListBox#m_nclicks. = 0;
3296 }
3297 }
3298
3299 // behavior when mouse button is released.
3300 void newuiListBoxcxx . . $ newuiListBox#::OnMouseBtnUpcxx . . $ newuiListBox#OnMouseBtnUp(d4f767463ce0a6b3).(int btn) {
3301 bool mouse_in_gadget = PT_IN_GADGETcxx . . $ PT_IN_GADGET(55d2799d541f12b5).(m_Wndcxx . . $ UIGadget#m_Wnd., this, UI_inputcxx . . $ UI_input..mxcxx . . $ tUIInput#mx., UI_inputcxx . . $ UI_input..mycxx . . $ tUIInput#my.);
3302
3303 if (btn == UILMSEBTNcxx . . $ `ui/uisys.h:36:9`! && mouse_in_gadget) {
3304 UNLOCK_FOCUScxx . . $ `ui/uisys.h:109:9`!(this);
3305 if (m_nclickscxx . . $ newuiListBox#m_nclicks. == 1)
3306 m_nclickscxx . . $ newuiListBox#m_nclicks. = 2;
3307 else if (m_nclickscxx . . $ newuiListBox#m_nclicks. == 3)
3308 m_nclickscxx . . $ newuiListBox#m_nclicks. = 0;
3309 m_last_selected_indexcxx . . $ newuiListBox#m_last_selected_index. = m_SelectedIndexcxx . . $ newuiListBox#m_SelectedIndex.;
3310 }
3311 }
3312
3313 // this function will handle when an arrow button was pressed
3314 void newuiListBoxcxx . . $ newuiListBox#::OnNotifySelectcxx . . $ newuiListBox#OnNotifySelect(627f6e6cf27f18b7).(UIGadgetcxx . . $ UIGadget# *g) {
3315 switch (g->GetDatumcxx . . $ UIGadget#GetDatum(524863554b4a534e).()) {
3316 case NEWUI_ARROW_UPcxx . . $ `Descent3/newui_core.h:101:9`!:
3317 newuiListBoxcxx . . $ newuiListBox#::Offsetcxx . . $ newuiListBox#Offset(68e3ae50fe6578a9).(-1);
3318 break;
3319 case NEWUI_ARROW_DOWNcxx . . $ `Descent3/newui_core.h:102:9`!:
3320 newuiListBoxcxx . . $ newuiListBox#::Offsetcxx . . $ newuiListBox#Offset(68e3ae50fe6578a9).(1);
3321 break;
3322 }
3323 }
3324
3325 // when a listbox item was double clicked (or entered)
3326 void newuiListBoxcxx . . $ newuiListBox#::OnSelectcxx . . $ newuiListBox#OnSelect(49f6e7a06ebc5aa8).() { UIGadgetcxx . . $ UIGadget#::OnSelectcxx . . $ UIGadget#OnSelect(49f6e7a06ebc5aa8).(); }
3327
3328 // called when destroyed.
3329 void newuiListBoxcxx . . $ newuiListBox#::OnDestroycxx . . $ newuiListBox#OnDestroy(49f6e7a06ebc5aa8).() {
3330 int i;
3331
3332 if (m_up_btncxx . . $ newuiListBox#m_up_btn..IsCreatedcxx . . $ UIObject#IsCreated(50ce9a9e25b4a850).())
3333 m_up_btncxx . . $ newuiListBox#m_up_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
3334 if (m_down_btncxx . . $ newuiListBox#m_down_btn..IsCreatedcxx . . $ UIObject#IsCreated(50ce9a9e25b4a850).())
3335 m_down_btncxx . . $ newuiListBox#m_down_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
3336
3337 for (i = 0; i < m_NumItemscxx . . $ newuiListBox#m_NumItems.; i++) {
3338 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList[i]);
3339 }
3340
3341 if (m_ItemListcxx . . $ newuiListBox#m_ItemList.)
3342 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList);
3343 if (m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt.)
3344 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Real2Virt);
3345 if (m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real.)
3346 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Virt2Real);
3347
3348 m_ItemListcxx . . $ newuiListBox#m_ItemList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3349 m_Real2Virtcxx . . $ newuiListBox#m_Real2Virt. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3350 m_Virt2Realcxx . . $ newuiListBox#m_Virt2Real. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3351
3352 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiListBox#m_pieces.[N_PIECE_IDXcxx . . $ `Descent3/newui_core.h:85:9`!]);
3353 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiListBox#m_pieces.[NE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:86:9`!]);
3354 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiListBox#m_pieces.[E_PIECE_IDXcxx . . $ `Descent3/newui_core.h:87:9`!]);
3355 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiListBox#m_pieces.[SE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:88:9`!]);
3356 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiListBox#m_pieces.[S_PIECE_IDXcxx . . $ `Descent3/newui_core.h:89:9`!]);
3357 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiListBox#m_pieces.[SW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:90:9`!]);
3358 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiListBox#m_pieces.[W_PIECE_IDXcxx . . $ `Descent3/newui_core.h:91:9`!]);
3359 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiListBox#m_pieces.[NW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:92:9`!]);
3360
3361 UIGadgetcxx . . $ UIGadget#::OnDestroycxx . . $ UIGadget#OnDestroy(49f6e7a06ebc5aa8).();
3362 }
3363
3364 // override: behavior when gadget is processed
3365 void newuiListBoxcxx . . $ newuiListBox#::OnUserProcesscxx . . $ newuiListBox#OnUserProcess(49f6e7a06ebc5aa8).() {}
3366
3367 // when gadget is added to a window (AddGadget is called)
3368 void newuiListBoxcxx . . $ newuiListBox#::OnAttachToWindowcxx . . $ newuiListBox#OnAttachToWindow(49f6e7a06ebc5aa8).() {
3369 m_up_btncxx . . $ newuiListBox#m_up_btn..Createcxx . . $ newuiArrowButton#Create(a92569a4941e4071).(m_Wndcxx . . $ UIGadget#m_Wnd., -1, NEWUI_ARROW_UPcxx . . $ `Descent3/newui_core.h:101:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, m_Xcxx . . $ UIObject#m_X. + m_Wcxx . . $ UIObject#m_W. - m_boffscxx . . $ newuiListBox#m_boffs. - 8, m_Ycxx . . $ UIObject#m_Y. + m_boffscxx . . $ newuiListBox#m_boffs. - 1);
3370 m_up_btncxx . . $ newuiListBox#m_up_btn..SetFlagcxx . . $ UIGadget#SetFlag(d4f767463ce0a6b3).(UIF_NOTIFYMASTERSELcxx . . $ `ui/ui.h:346:9`!);
3371 AttachSlaveGadgetcxx . . $ UIGadget#AttachSlaveGadget(627f6e6cf27f18b7).(&m_up_btncxx . . $ newuiListBox#m_up_btn.);
3372
3373 m_down_btncxx . . $ newuiListBox#m_down_btn..Createcxx . . $ newuiArrowButton#Create(a92569a4941e4071).(m_Wndcxx . . $ UIGadget#m_Wnd., -1, NEWUI_ARROW_DOWNcxx . . $ `Descent3/newui_core.h:102:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, m_Xcxx . . $ UIObject#m_X. + m_Wcxx . . $ UIObject#m_W. - m_boffscxx . . $ newuiListBox#m_boffs. - 8, m_Ycxx . . $ UIObject#m_Y. + m_Hcxx . . $ UIObject#m_H. - m_boffscxx . . $ newuiListBox#m_boffs. - 19);
3374 m_down_btncxx . . $ newuiListBox#m_down_btn..SetFlagcxx . . $ UIGadget#SetFlag(d4f767463ce0a6b3).(UIF_NOTIFYMASTERSELcxx . . $ `ui/ui.h:346:9`!);
3375 AttachSlaveGadgetcxx . . $ UIGadget#AttachSlaveGadget(627f6e6cf27f18b7).(&m_down_btncxx . . $ newuiListBox#m_down_btn.);
3376 }
3377
3378 void newuiListBoxcxx . . $ newuiListBox#::OnDetachFromWindowcxx . . $ newuiListBox#OnDetachFromWindow(49f6e7a06ebc5aa8).() {
3379 DetachSlaveGadgetcxx . . $ UIGadget#DetachSlaveGadget(627f6e6cf27f18b7).(&m_down_btncxx . . $ newuiListBox#m_down_btn.);
3380 m_down_btncxx . . $ newuiListBox#m_down_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
3381 DetachSlaveGadgetcxx . . $ UIGadget#DetachSlaveGadget(627f6e6cf27f18b7).(&m_up_btncxx . . $ newuiListBox#m_up_btn.);
3382 m_up_btncxx . . $ newuiListBox#m_up_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
3383 }
3384
3385 void newuiListBoxcxx . . $ newuiListBox#::Offsetcxx . . $ newuiListBox#Offset(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# offs) {
3386 m_Indexcxx . . $ newuiListBox#m_Index. = m_Indexcxx . . $ newuiListBox#m_Index. + offs;
3387 if (m_Indexcxx . . $ newuiListBox#m_Index. < 0) {
3388 m_Indexcxx . . $ newuiListBox#m_Index. = 0;
3389 } else if (m_Indexcxx . . $ newuiListBox#m_Index. >= (m_NumItemscxx . . $ newuiListBox#m_NumItems. - m_NumVisibleItemscxx . . $ newuiListBox#m_NumVisibleItems.)) {
3390 m_Indexcxx . . $ newuiListBox#m_Index. = m_NumItemscxx . . $ newuiListBox#m_NumItems. - m_NumVisibleItemscxx . . $ newuiListBox#m_NumVisibleItems.;
3391 }
3392 }
3393
3394 // CLASS a new listbox. uses less memory than the old listbox hopefully.
3395
3396 newuiComboBoxcxx . . $ newuiComboBox#::newuiComboBoxcxx . . $ newuiComboBox#newuiComboBox(49f6e7a06ebc5aa8).() {
3397 m_ItemListcxx . . $ newuiComboBox#m_ItemList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3398 m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3399 m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3400 selectchange_fncxx . . $ newuiComboBox#selectchange_fn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3401 m_NumItemscxx . . $ newuiComboBox#m_NumItems. = 0;
3402 m_Indexcxx . . $ newuiComboBox#m_Index. = 0;
3403 }
3404
3405 void newuiComboBoxcxx . . $ newuiComboBox#::Createcxx . . $ newuiComboBox#Create(b592d8b1d10b24b1).(UIWindowcxx . . $ UIWindow# *wnd, int16_tcxx . . $ int16_t# id, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, uint16_tcxx . . $ uint16_t# flags) {
3406 m_ItemListcxx . . $ newuiComboBox#m_ItemList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3407 m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3408 m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3409 selectchange_fncxx . . $ newuiComboBox#selectchange_fn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3410 m_NumItemscxx . . $ newuiComboBox#m_NumItems. = 0;
3411 m_Indexcxx . . $ newuiComboBox#m_Index. = 0;
3412 m_showupcxx . . $ newuiComboBox#m_showup. = m_showdowncxx . . $ newuiComboBox#m_showdown. = false;
3413
3414 m_barbmpcxx . . $ newuiComboBox#m_barbmp. = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_CB_FILEcxx . . $ `Descent3/newui_core.cpp:307:9`!);
3415 m_boffscxx . . $ newuiComboBox#m_boffs. = 12;
3416
3417 // determine true width and height (snap width and height to 32 pixel boundaries
3418 UIGadgetcxx . . $ UIGadget#::Createcxx . . $ UIGadget#Create(43707b8add2f137d).(wnd, id, x, y, m_barbmpcxx . . $ newuiComboBox#m_barbmp.->widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(), m_barbmpcxx . . $ newuiComboBox#m_barbmp.->heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).(), flags);
3419 }
3420
3421 // functions to add or remove items,
3422 void newuiComboBoxcxx . . $ newuiComboBox#::AddItemcxx . . $ newuiComboBox#AddItem(85c52e162fed56f9).(const char *name) {
3423 char **temp;
3424 int i;
3425 int *tempvirt2real, *tempreal2virt;
3426 int real_index = -1;
3427
3428 if (m_Flagscxx . . $ UIGadget#m_Flags. & UILB_NOSORTcxx . . $ `ui/ui.h:356:9`!) {
3429 // insert without sort
3430
3431 if ((m_NumItemscxx . . $ newuiComboBox#m_NumItems. % LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) == 0) {
3432 // dynamically allocated memory for listbox, expand as needed.
3433 temp = (char **)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(char *));
3434 tempvirt2real = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(int));
3435 tempreal2virt = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(int));
3436
3437 if (m_ItemListcxx . . $ newuiComboBox#m_ItemList.) {
3438 for (i = 0; i < m_NumItemscxx . . $ newuiComboBox#m_NumItems.; i++) {
3439 temp[i] = m_ItemListcxx . . $ newuiComboBox#m_ItemList.[i];
3440 tempvirt2real[i] = m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.[i];
3441 tempreal2virt[i] = m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[i];
3442 }
3443
3444 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList);
3445 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Virt2Real);
3446 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Real2Virt);
3447 }
3448 m_ItemListcxx . . $ newuiComboBox#m_ItemList. = temp;
3449 m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real. = tempvirt2real;
3450 m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt. = tempreal2virt;
3451 }
3452
3453 real_index = m_NumItemscxx . . $ newuiComboBox#m_NumItems.;
3454 } else {
3455 // only text item listboxes!
3456
3457 // insert with sorting
3458 if ((m_NumItemscxx . . $ newuiComboBox#m_NumItems. % LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) == 0) {
3459 // dynamically allocated memory for listbox, expand as needed.
3460 int oidx = 0, cidx = 0;
3461 int pidx = 0;
3462 int result;
3463
3464 temp = (char **)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(char *));
3465 tempvirt2real = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(int));
3466 tempreal2virt = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!((m_NumItems + LISTBOX_BUFFER_SIZEcxx . . $ `ui/ui.h:879:9`!) * sizeof(int));
3467
3468 real_index = -1;
3469
3470 if (m_ItemListcxx . . $ newuiComboBox#m_ItemList.) {
3471 while (oidx <= m_NumItemscxx . . $ newuiComboBox#m_NumItems.) {
3472 if (oidx == m_NumItemscxx . . $ newuiComboBox#m_NumItems.) {
3473 if (real_index == -1) {
3474 real_index = oidx;
3475 } else {
3476 temp[cidx] = m_ItemListcxx . . $ newuiComboBox#m_ItemList.[pidx];
3477 tempreal2virt[cidx] = m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[pidx];
3478 }
3479 oidx++;
3480 continue;
3481 }
3482
3483 if (m_Flagscxx . . $ UIGadget#m_Flags. & UILB_CASESENSITIVEcxx . . $ `ui/ui.h:357:9`!)
3484 result = strcmp(m_ItemListcxx . . $ newuiComboBox#m_ItemList.[cidx], name);
3485 else
3486 result = stricmpcxx . . $ `linux/linux_fix.h:43:9`!(m_ItemList[cidx], name);
3487 if (result < 0) {
3488 // copy old
3489 temp[cidx] = m_ItemListcxx . . $ newuiComboBox#m_ItemList.[pidx];
3490 tempreal2virt[cidx] = m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[pidx];
3491 cidx++;
3492 pidx++;
3493 } else if (result >= 0) {
3494 // see if we need to insert, if not just keep copying
3495 if (real_index == -1) {
3496 real_index = cidx;
3497 cidx++;
3498 } else {
3499 temp[cidx] = m_ItemListcxx . . $ newuiComboBox#m_ItemList.[pidx];
3500 tempreal2virt[cidx] = m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[pidx];
3501 cidx++;
3502 pidx++;
3503 }
3504 }
3505 oidx++;
3506 }
3507 ASSERTcxx . . $ `misc/pserror.h:246:9`!(real_index != -1);
3508
3509 // now we need to fix m_Virt2Real to represent the new structure,
3510 // all values>=real_index must be incremented
3511 for (oidx = 0; oidx <= m_NumItemscxx . . $ newuiComboBox#m_NumItems.; oidx++) {
3512 if (oidx < m_NumItemscxx . . $ newuiComboBox#m_NumItems.) {
3513 tempvirt2real[oidx] = m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.[oidx];
3514
3515 // if(oidx!=real_index){
3516 if (tempvirt2real[oidx] >= real_index)
3517 tempvirt2real[oidx]++;
3518 }
3519 }
3520
3521 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList);
3522 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Virt2Real);
3523 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Real2Virt);
3524 } else {
3525 real_index = 0;
3526 }
3527
3528 m_ItemListcxx . . $ newuiComboBox#m_ItemList. = temp;
3529 m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real. = tempvirt2real;
3530 m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt. = tempreal2virt;
3531 } else {
3532 // find where to insert, without allocating memory
3533 int oidx = 0, cidx = 0;
3534 real_index = -1;
3535 int result;
3536
3537 int old_r2v;
3538 char *old_item = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3539
3540 while (oidx <= m_NumItemscxx . . $ newuiComboBox#m_NumItems.) {
3541
3542 if (oidx == m_NumItemscxx . . $ newuiComboBox#m_NumItems.) {
3543 // we're past the slot of the old buffer
3544 if (real_index == -1) {
3545 // we haven't set the real index yet, so it has to go here
3546 real_index = m_NumItemscxx . . $ newuiComboBox#m_NumItems.;
3547 } else {
3548 // the real index has been set, we're still pulling back
3549 m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[cidx] = old_r2v;
3550 m_ItemListcxx . . $ newuiComboBox#m_ItemList.[cidx] = old_item;
3551 }
3552 oidx++;
3553 continue;
3554 } else {
3555 if (m_Flagscxx . . $ UIGadget#m_Flags. & UILB_CASESENSITIVEcxx . . $ `ui/ui.h:357:9`!)
3556 result = strcmp(m_ItemListcxx . . $ newuiComboBox#m_ItemList.[cidx], name);
3557 else
3558 result = stricmpcxx . . $ `linux/linux_fix.h:43:9`!(m_ItemList[cidx], name);
3559 }
3560
3561 if (result < 0) {
3562 // we haven't gotten to the string yet, keep as they are
3563 cidx++;
3564 } else if (result >= 0) {
3565 // see if we need to insert, if not just keep copying
3566 if (real_index == -1) {
3567 // we need to insert here
3568 real_index = cidx;
3569 old_item = m_ItemListcxx . . $ newuiComboBox#m_ItemList.[cidx];
3570 old_r2v = m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[cidx];
3571 cidx++;
3572 } else {
3573 // old_item and old_r2v should be set!
3574 ASSERTcxx . . $ `misc/pserror.h:246:9`!(old_item);
3575 char *oi;
3576 int or2v;
3577
3578 or2v = m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[cidx];
3579 oi = m_ItemListcxx . . $ newuiComboBox#m_ItemList.[cidx];
3580
3581 m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[cidx] = old_r2v;
3582 m_ItemListcxx . . $ newuiComboBox#m_ItemList.[cidx] = old_item;
3583 old_r2v = or2v;
3584 old_item = oi;
3585
3586 cidx++;
3587 }
3588 }
3589
3590 // continue on
3591 oidx++;
3592 }
3593
3594 ASSERTcxx . . $ `misc/pserror.h:246:9`!(real_index != -1);
3595
3596 // now we need to fix m_Virt2Real to represent the new structure,
3597 // all values>=real_index must be incremented
3598 cidx = 0;
3599 for (oidx = 0; oidx <= m_NumItemscxx . . $ newuiComboBox#m_NumItems.; oidx++) {
3600 if (oidx != real_index) {
3601 if (m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.[cidx] >= real_index)
3602 m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.[cidx]++;
3603 cidx++;
3604 }
3605 }
3606 }
3607 }
3608
3609 // copy item passed to list.
3610 m_ItemListcxx . . $ newuiComboBox#m_ItemList.[real_index] = mem_strdupcxx . . $ `mem/mem.h:81:9`!(name);
3611 m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.[m_NumItemscxx . . $ newuiComboBox#m_NumItems.] = real_index;
3612 m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[real_index] = m_NumItemscxx . . $ newuiComboBox#m_NumItems.;
3613 m_NumItemscxx . . $ newuiComboBox#m_NumItems.++;
3614
3615 if (real_index <= m_Indexcxx . . $ newuiComboBox#m_Index.) {
3616 // adjust selected index
3617 if (m_Indexcxx . . $ newuiComboBox#m_Index. < m_NumItemscxx . . $ newuiComboBox#m_NumItems. - 1)
3618 m_Indexcxx . . $ newuiComboBox#m_Index.++;
3619 }
3620 }
3621
3622 void newuiComboBoxcxx . . $ newuiComboBox#::RemoveItemcxx . . $ newuiComboBox#RemoveItem(85c52e162fed56f9).(const char *name) {
3623 int i, j, found = -1;
3624
3625 for (i = 0; i < m_NumItemscxx . . $ newuiComboBox#m_NumItems.; i++) {
3626 int res;
3627 res = (m_Flagscxx . . $ UIGadget#m_Flags. & UILB_CASESENSITIVEcxx . . $ `ui/ui.h:357:9`!) ? stricmpcxx . . $ `linux/linux_fix.h:43:9`!(m_ItemList[i], name) : strcmp(m_ItemListcxx . . $ newuiComboBox#m_ItemList.[i], name);
3628 if (res == 0) {
3629 found = i;
3630 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList[found]);
3631 m_ItemListcxx . . $ newuiComboBox#m_ItemList.[found] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3632 break;
3633 }
3634 }
3635 if (found == -1) {
3636 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "newuiComboBox:: Didn't find item to remove!\n");
3637 return;
3638 }
3639
3640 // found is the real index to remove
3641 // go through virt2real and subtract one from values of found or higher
3642 // go through real2virt and move everything from index found on down, and subtract
3643 // 1 from those with value of found or higher
3644 int real_index = found; // index to remove
3645 int virt_index = m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[found]; // index to remove
3646 int real_thresh = virt_index;
3647 int virt_thresh = real_index;
3648
3649 for (j = 0; j < (m_NumItemscxx . . $ newuiComboBox#m_NumItems. - 1); j++) {
3650 if (j >= real_index) {
3651 m_ItemListcxx . . $ newuiComboBox#m_ItemList.[j] = m_ItemListcxx . . $ newuiComboBox#m_ItemList.[j + 1];
3652 m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[j] = m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[j + 1];
3653 }
3654
3655 if (j >= virt_index) {
3656 m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.[j] = m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.[j + 1];
3657 }
3658
3659 if (m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[j] >= real_thresh)
3660 m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[j]--;
3661
3662 if (m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.[j] >= virt_thresh)
3663 m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.[j]--;
3664 }
3665 m_NumItemscxx . . $ newuiComboBox#m_NumItems.--;
3666
3667 if (real_index <= m_Indexcxx . . $ newuiComboBox#m_Index.) {
3668 // adjust selected index
3669 m_Indexcxx . . $ newuiComboBox#m_Index.--;
3670 }
3671 }
3672
3673 void newuiComboBoxcxx . . $ newuiComboBox#::RemoveAllcxx . . $ newuiComboBox#RemoveAll(49f6e7a06ebc5aa8).() {
3674 if (m_ItemListcxx . . $ newuiComboBox#m_ItemList.) {
3675 int i;
3676 for (i = 0; i < m_NumItemscxx . . $ newuiComboBox#m_NumItems.; i++) {
3677 if (m_ItemListcxx . . $ newuiComboBox#m_ItemList.[i])
3678 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList[i]);
3679 }
3680 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList);
3681 }
3682
3683 if (m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.)
3684 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Virt2Real);
3685
3686 if (m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.)
3687 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Real2Virt);
3688
3689 m_ItemListcxx . . $ newuiComboBox#m_ItemList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3690 m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3691 m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3692 m_Indexcxx . . $ newuiComboBox#m_Index. = m_NumItemscxx . . $ newuiComboBox#m_NumItems. = 0;
3693 }
3694
3695 // item information
3696 int newuiComboBoxcxx . . $ newuiComboBox#::GetCurrentIndexcxx . . $ newuiComboBox#GetCurrentIndex(b126dc7c1de90089).() {
3697 if (m_NumItemscxx . . $ newuiComboBox#m_NumItems. == 0)
3698 return 0;
3699
3700 if (!m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.)
3701 return 0;
3702
3703 int virt_index = m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[m_Indexcxx . . $ newuiComboBox#m_Index.];
3704 ASSERTcxx . . $ `misc/pserror.h:246:9`!(virt_index >= 0 && virt_index < m_NumItems);
3705 return virt_index;
3706 }
3707
3708 void newuiComboBoxcxx . . $ newuiComboBox#::SetCurrentIndexcxx . . $ newuiComboBox#SetCurrentIndex(d4f767463ce0a6b3).(int index) {
3709 if (m_NumItemscxx . . $ newuiComboBox#m_NumItems. == 0)
3710 return;
3711
3712 if (index >= 0 && index < m_NumItemscxx . . $ newuiComboBox#m_NumItems.) {
3713 int real_index = m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.[index], old_index = m_Indexcxx . . $ newuiComboBox#m_Index.;
3714
3715 ASSERTcxx . . $ `misc/pserror.h:246:9`!(real_index >= 0 && real_index < m_NumItems);
3716 m_Indexcxx . . $ newuiComboBox#m_Index. = real_index;
3717 if (m_Indexcxx . . $ newuiComboBox#m_Index. < 0) {
3718 m_Indexcxx . . $ newuiComboBox#m_Index. = 0;
3719 }
3720
3721 // call callbacks if selection really changed.
3722 if (old_index != m_Indexcxx . . $ newuiComboBox#m_Index.) {
3723 if (selectchange_fncxx . . $ newuiComboBox#selectchange_fn.)
3724 (*selectchange_fncxx . . $ newuiComboBox#selectchange_fn.)(index);
3725 }
3726 }
3727 }
3728
3729 bool newuiComboBoxcxx . . $ newuiComboBox#::GetCurrentItemcxx . . $ newuiComboBox#GetCurrentItem(37e8d18a243bba77).(char *buffer, int buflen) {
3730 return newuiComboBoxcxx . . $ newuiComboBox#::GetItemcxx . . $ newuiComboBox#GetItem(3f730e01d352290e).(m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[m_Indexcxx . . $ newuiComboBox#m_Index.], buffer, buflen);
3731 }
3732
3733 bool newuiComboBoxcxx . . $ newuiComboBox#::GetItemcxx . . $ newuiComboBox#GetItem(3f730e01d352290e).(int index, char *buffer, int buflen) {
3734 if (m_NumItemscxx . . $ newuiComboBox#m_NumItems. == 0) {
3735 return false;
3736 *buffer = 0;
3737 }
3738
3739 if (index >= 0 && index < m_NumItemscxx . . $ newuiComboBox#m_NumItems.) {
3740 int real_index = m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.[index];
3741 ASSERTcxx . . $ `misc/pserror.h:246:9`!(real_index >= 0 && real_index < m_NumItems);
3742 strncpy(buffer, m_ItemListcxx . . $ newuiComboBox#m_ItemList.[real_index], buflen - 1);
3743 buffer[buflen - 1] = 0;
3744 return true;
3745 }
3746
3747 return false;
3748 }
3749
3750 bool newuiComboBoxcxx . . $ newuiComboBox#::SetCurrentItemcxx . . $ newuiComboBox#SetCurrentItem(c5f7da30cbc0f4e9).(const char *name) {
3751 int i, found = 0;
3752
3753 for (i = 0; i < m_NumItemscxx . . $ newuiComboBox#m_NumItems.; i++) {
3754 int res = (m_Flagscxx . . $ UIGadget#m_Flags. & UILB_CASESENSITIVEcxx . . $ `ui/ui.h:357:9`!) ? stricmpcxx . . $ `linux/linux_fix.h:43:9`!(m_ItemList[i], name) : strcmp(m_ItemListcxx . . $ newuiComboBox#m_ItemList.[i], name);
3755 if (res == 0) {
3756 SetCurrentIndexcxx . . $ newuiComboBox#SetCurrentIndex(d4f767463ce0a6b3).(m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[i]);
3757 found = 1;
3758 break;
3759 }
3760 }
3761
3762 if (!found) {
3763 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "newuiComboBox::SelectItem item not found!\n");
3764 return false;
3765 }
3766
3767 return true;
3768 }
3769
3770 // set callbacks
3771 void newuiComboBoxcxx . . $ newuiComboBox#::SetSelectChangeCallbackcxx . . $ newuiComboBox#SetSelectChangeCallback(94eb4457dc8d4d10).(void (*fn)(int)) { selectchange_fncxx . . $ newuiComboBox#selectchange_fn. = fn; }
3772
3773 // behavior when gadget is being drawn.
3774 void newuiComboBoxcxx . . $ newuiComboBox#::OnDrawcxx . . $ newuiComboBox#OnDraw(49f6e7a06ebc5aa8).() {
3775 m_barbmpcxx . . $ newuiComboBox#m_barbmp.->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(0, 0);
3776 bool auto_select = ((m_Flagscxx . . $ UIGadget#m_Flags. & UILB_AUTOSELECTcxx . . $ `ui/ui.h:355:9`!) > 0);
3777 bool use_scroll = true;
3778
3779 ui_SetTextClipcxx . . $ ui_SetTextClip(748afa4755bc9595).(m_boffscxx . . $ newuiComboBox#m_boffs., 1, m_Wcxx . . $ UIObject#m_W. - m_boffscxx . . $ newuiComboBox#m_boffs. - m_up_btncxx . . $ newuiComboBox#m_up_btn..Wcxx . . $ UIObject#W(455f465bc33b4cdf).(), m_Hcxx . . $ UIObject#m_H. - 1);
3780
3781 // decide whether to show arrows. , tricky code.
3782 if (m_NumItemscxx . . $ newuiComboBox#m_NumItems. > 1) {
3783 if (m_Indexcxx . . $ newuiComboBox#m_Index. < (m_NumItemscxx . . $ newuiComboBox#m_NumItems. - 1) && !m_showdowncxx . . $ newuiComboBox#m_showdown.) {
3784 m_showdowncxx . . $ newuiComboBox#m_showdown. = true;
3785 m_down_btncxx . . $ newuiComboBox#m_down_btn..Showcxx . . $ newuiArrowButton#Show(b45ddcbc8423892c).(true);
3786 }
3787 if (m_Indexcxx . . $ newuiComboBox#m_Index. > 0 && !m_showupcxx . . $ newuiComboBox#m_showup.) {
3788 m_showupcxx . . $ newuiComboBox#m_showup. = true;
3789 m_up_btncxx . . $ newuiComboBox#m_up_btn..Showcxx . . $ newuiArrowButton#Show(b45ddcbc8423892c).(true);
3790 }
3791 }
3792
3793 if (m_Indexcxx . . $ newuiComboBox#m_Index. == (m_NumItemscxx . . $ newuiComboBox#m_NumItems. - 1) && m_showdowncxx . . $ newuiComboBox#m_showdown.) {
3794 m_showdowncxx . . $ newuiComboBox#m_showdown. = false;
3795 m_down_btncxx . . $ newuiComboBox#m_down_btn..Showcxx . . $ newuiArrowButton#Show(b45ddcbc8423892c).(false);
3796 }
3797 if (m_Indexcxx . . $ newuiComboBox#m_Index. == 0 && m_showupcxx . . $ newuiComboBox#m_showup.) {
3798 m_showupcxx . . $ newuiComboBox#m_showup. = false;
3799 m_up_btncxx . . $ newuiComboBox#m_up_btn..Showcxx . . $ newuiArrowButton#Show(b45ddcbc8423892c).(false);
3800 }
3801
3802 // use gamma 192 for non focus.
3803 if (m_NumItemscxx . . $ newuiComboBox#m_NumItems. && m_Indexcxx . . $ newuiComboBox#m_Index. < m_NumItemscxx . . $ newuiComboBox#m_NumItems. && m_Indexcxx . . $ newuiComboBox#m_Index. >= 0) {
3804 UITextItemcxx . . $ UITextItem# textcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, m_ItemListcxx . . $ newuiComboBox#m_ItemList.[m_Indexcxx . . $ newuiComboBox#m_Index.], NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!);
3805 text.drawcxx . . $ UITextItem#draw(84329bcd07240ccf).(m_boffscxx . . $ newuiComboBox#m_boffs. + 8, 4);
3806 }
3807
3808 ui_ResetTextClipcxx . . $ ui_ResetTextClip(49f6e7a06ebc5aa8).();
3809 }
3810
3811 // behavior when key is pressed.
3812 void newuiComboBoxcxx . . $ newuiComboBox#::OnKeyDowncxx . . $ newuiComboBox#OnKeyDown(d4f767463ce0a6b3).(int key) {
3813 int new_selected_index = m_Indexcxx . . $ newuiComboBox#m_Index.;
3814
3815 if (key == KEY_UPcxx . . $ `ddio/ddio_common.h:318:9`!) {
3816 if (m_Indexcxx . . $ newuiComboBox#m_Index. > 0) {
3817 new_selected_index = m_Indexcxx . . $ newuiComboBox#m_Index. - 1;
3818 }
3819 } else if (key == KEY_DOWNcxx . . $ `ddio/ddio_common.h:319:9`!) {
3820 if (m_Indexcxx . . $ newuiComboBox#m_Index. < (m_NumItemscxx . . $ newuiComboBox#m_NumItems. - 1)) {
3821 new_selected_index = m_Indexcxx . . $ newuiComboBox#m_Index. + 1;
3822 }
3823 }
3824 newuiComboBoxcxx . . $ newuiComboBox#::SetCurrentIndexcxx . . $ newuiComboBox#SetCurrentIndex(d4f767463ce0a6b3).((m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.) ? m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.[new_selected_index] : 0);
3825 }
3826
3827 // this function will handle when an arrow button was pressed
3828 void newuiComboBoxcxx . . $ newuiComboBox#::OnNotifySelectcxx . . $ newuiComboBox#OnNotifySelect(627f6e6cf27f18b7).(UIGadgetcxx . . $ UIGadget# *g) {
3829 switch (g->GetDatumcxx . . $ UIGadget#GetDatum(524863554b4a534e).()) {
3830 case NEWUI_ARROW_CBUPcxx . . $ `Descent3/newui_core.h:103:9`!:
3831 newuiComboBoxcxx . . $ newuiComboBox#::OnKeyDowncxx . . $ newuiComboBox#OnKeyDown(d4f767463ce0a6b3).(KEY_UPcxx . . $ `ddio/ddio_common.h:318:9`!);
3832 break;
3833 case NEWUI_ARROW_CBDOWNcxx . . $ `Descent3/newui_core.h:104:9`!:
3834 newuiComboBoxcxx . . $ newuiComboBox#::OnKeyDowncxx . . $ newuiComboBox#OnKeyDown(d4f767463ce0a6b3).(KEY_DOWNcxx . . $ `ddio/ddio_common.h:319:9`!);
3835 break;
3836 }
3837 }
3838
3839 // when a listbox item was double clicked (or entered)
3840 void newuiComboBoxcxx . . $ newuiComboBox#::OnSelectcxx . . $ newuiComboBox#OnSelect(49f6e7a06ebc5aa8).() { UIGadgetcxx . . $ UIGadget#::OnSelectcxx . . $ UIGadget#OnSelect(49f6e7a06ebc5aa8).(); }
3841
3842 // called when destroyed.
3843 void newuiComboBoxcxx . . $ newuiComboBox#::OnDestroycxx . . $ newuiComboBox#OnDestroy(49f6e7a06ebc5aa8).() {
3844 int i;
3845
3846 if (m_up_btncxx . . $ newuiComboBox#m_up_btn..IsCreatedcxx . . $ UIObject#IsCreated(50ce9a9e25b4a850).())
3847 m_up_btncxx . . $ newuiComboBox#m_up_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
3848 if (m_down_btncxx . . $ newuiComboBox#m_down_btn..IsCreatedcxx . . $ UIObject#IsCreated(50ce9a9e25b4a850).())
3849 m_down_btncxx . . $ newuiComboBox#m_down_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
3850
3851 for (i = 0; i < m_NumItemscxx . . $ newuiComboBox#m_NumItems.; i++) {
3852 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList[i]);
3853 }
3854
3855 if (m_ItemListcxx . . $ newuiComboBox#m_ItemList.)
3856 mem_freecxx . . $ `mem/mem.h:80:9`!(m_ItemList);
3857 if (m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt.)
3858 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Real2Virt);
3859 if (m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real.)
3860 mem_freecxx . . $ `mem/mem.h:80:9`!(m_Virt2Real);
3861
3862 m_ItemListcxx . . $ newuiComboBox#m_ItemList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3863 m_Real2Virtcxx . . $ newuiComboBox#m_Real2Virt. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3864 m_Virt2Realcxx . . $ newuiComboBox#m_Virt2Real. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3865
3866 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_barbmpcxx . . $ newuiComboBox#m_barbmp.);
3867
3868 UIGadgetcxx . . $ UIGadget#::OnDestroycxx . . $ UIGadget#OnDestroy(49f6e7a06ebc5aa8).();
3869 }
3870
3871 // when gadget is added to a window (AddGadget is called)
3872 void newuiComboBoxcxx . . $ newuiComboBox#::OnAttachToWindowcxx . . $ newuiComboBox#OnAttachToWindow(49f6e7a06ebc5aa8).() {
3873 m_boffscxx . . $ newuiComboBox#m_boffs. = 16;
3874 m_up_btncxx . . $ newuiComboBox#m_up_btn..Createcxx . . $ newuiArrowButton#Create(a92569a4941e4071).(m_Wndcxx . . $ UIGadget#m_Wnd., -1, NEWUI_ARROW_CBUPcxx . . $ `Descent3/newui_core.h:103:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, m_Xcxx . . $ UIObject#m_X. + 4, m_Ycxx . . $ UIObject#m_Y. + 3);
3875 m_up_btncxx . . $ newuiComboBox#m_up_btn..SetFlagcxx . . $ UIGadget#SetFlag(d4f767463ce0a6b3).(UIF_NOTIFYMASTERSELcxx . . $ `ui/ui.h:346:9`!);
3876 m_showupcxx . . $ newuiComboBox#m_showup. = true;
3877 AttachSlaveGadgetcxx . . $ UIGadget#AttachSlaveGadget(627f6e6cf27f18b7).(&m_up_btncxx . . $ newuiComboBox#m_up_btn.);
3878 // m_showup = false;
3879 // m_Wnd->RemoveGadget(&m_up_btn);
3880
3881 m_down_btncxx . . $ newuiComboBox#m_down_btn..Createcxx . . $ newuiArrowButton#Create(a92569a4941e4071).(m_Wndcxx . . $ UIGadget#m_Wnd., -1, NEWUI_ARROW_CBDOWNcxx . . $ `Descent3/newui_core.h:104:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, m_Xcxx . . $ UIObject#m_X. + m_Wcxx . . $ UIObject#m_W. - m_boffscxx . . $ newuiComboBox#m_boffs. - 8, m_Ycxx . . $ UIObject#m_Y. + 3);
3882 m_down_btncxx . . $ newuiComboBox#m_down_btn..SetFlagcxx . . $ UIGadget#SetFlag(d4f767463ce0a6b3).(UIF_NOTIFYMASTERSELcxx . . $ `ui/ui.h:346:9`!);
3883 AttachSlaveGadgetcxx . . $ UIGadget#AttachSlaveGadget(627f6e6cf27f18b7).(&m_down_btncxx . . $ newuiComboBox#m_down_btn.);
3884 m_showdowncxx . . $ newuiComboBox#m_showdown. = true;
3885 // m_showdown = false;
3886 // m_Wnd->RemoveGadget(&m_down_btn);
3887 }
3888
3889 void newuiComboBoxcxx . . $ newuiComboBox#::OnDetachFromWindowcxx . . $ newuiComboBox#OnDetachFromWindow(49f6e7a06ebc5aa8).() {
3890 if (m_showdowncxx . . $ newuiComboBox#m_showdown.) {
3891 DetachSlaveGadgetcxx . . $ UIGadget#DetachSlaveGadget(627f6e6cf27f18b7).(&m_down_btncxx . . $ newuiComboBox#m_down_btn.);
3892 m_showdowncxx . . $ newuiComboBox#m_showdown. = false;
3893 }
3894 m_down_btncxx . . $ newuiComboBox#m_down_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
3895 if (m_showupcxx . . $ newuiComboBox#m_showup.) {
3896 DetachSlaveGadgetcxx . . $ UIGadget#DetachSlaveGadget(627f6e6cf27f18b7).(&m_up_btncxx . . $ newuiComboBox#m_up_btn.);
3897 m_showupcxx . . $ newuiComboBox#m_showup. = false;
3898 }
3899 m_up_btncxx . . $ newuiComboBox#m_up_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
3900 }
3901
3902 // CLASS newuiEditBox
3903
3904 newuiEditBoxcxx . . $ newuiEditBox#::newuiEditBoxcxx . . $ newuiEditBox#newuiEditBox(49f6e7a06ebc5aa8).() { m_titlecxx . . $ newuiEditBox#m_title. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; }
3905
3906 void newuiEditBoxcxx . . $ newuiEditBox#::Createcxx . . $ newuiEditBox#Create(3c6611c2642a6f36).(UIWindowcxx . . $ UIWindow# *wnd, int16_tcxx . . $ int16_t# id, const char *name, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, int16_tcxx . . $ int16_t# w, int16_tcxx . . $ int16_t# flags) {
3907 // if (name) {
3908 // m_title = new UISnazzyTextItem(0, MONITOR9_NEWUI_FONT, name, NEWUI_MONITORFONT_COLOR);
3909 // }
3910 UIEditcxx . . $ UIEdit#::Createcxx . . $ UIEdit#Create(43707b8add2f137d).(wnd, (int)id, x, y, w ? w : EDIT_GADGET_WIDTHcxx . . $ `Descent3/newui_core.cpp:370:9`!, EDIT_GADGET_HEIGHTcxx . . $ `Descent3/newui_core.cpp:371:9`!, flags | UIF_BORDERcxx . . $ `ui/ui.h:344:9`!);
3911
3912 // if (m_title) {
3913 // UIEdit::SetTextBounds(m_title->width()+12, m_W-1);
3914 // }
3915 // else {
3916 UIEditcxx . . $ UIEdit#::SetTextBoundscxx . . $ UIEdit#SetTextBounds(b1146eedae1e1d0b).(1, m_Wcxx . . $ UIObject#m_W. - 1, -1);
3917 // }
3918
3919 UIEditcxx . . $ UIEdit#::SetColorcxx . . $ UIEdit#SetColor(cb2f890c2fdad230).(NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!);
3920 UIEditcxx . . $ UIEdit#::SetFontcxx . . $ UIEdit#SetFont(d4f767463ce0a6b3).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!);
3921
3922 m_quick_escape_enablecxx . . $ newuiEditBox#m_quick_escape_enable. = false;
3923 }
3924
3925 void newuiEditBoxcxx . . $ newuiEditBox#::EnableOnQuickEscapeBehaviorcxx . . $ newuiEditBox#EnableOnQuickEscapeBehavior(b45ddcbc8423892c).(bool do_it) { m_quick_escape_enablecxx . . $ newuiEditBox#m_quick_escape_enable. = do_it; }
3926
3927 void newuiEditBoxcxx . . $ newuiEditBox#::OnDestroycxx . . $ newuiEditBox#OnDestroy(49f6e7a06ebc5aa8).() {
3928 if (m_titlecxx . . $ newuiEditBox#m_title.) {
3929 delete m_titlecxx . . $ newuiEditBox#m_title.;
3930 m_titlecxx . . $ newuiEditBox#m_title. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3931 }
3932
3933 UIEditcxx . . $ UIEdit#::OnDestroycxx . . $ UIEdit#OnDestroy(49f6e7a06ebc5aa8).();
3934 }
3935
3936 void newuiEditBoxcxx . . $ newuiEditBox#::OnDrawcxx . . $ newuiEditBox#OnDraw(49f6e7a06ebc5aa8).() {
3937 ui_DrawBoxcxx . . $ ui_DrawBox(fe09a4b73d8d396f).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(128, 128, 128), 0, 0, m_Wcxx . . $ UIObject#m_W., m_Hcxx . . $ UIObject#m_H.);
3938 if (m_titlecxx . . $ newuiEditBox#m_title.) {
3939 if (HasFocuscxx . . $ UIGadget#HasFocus(50ce9a9e25b4a850).()) {
3940 m_titlecxx . . $ newuiEditBox#m_title.->set_flagscxx . . $ UISnazzyTextItem#set_flags(cb2f890c2fdad230).(UISNAZZYTEXTF_BLINKINGcxx . . $ `ui/uires.h:180:9`!);
3941 } else {
3942 m_titlecxx . . $ newuiEditBox#m_title.->set_flagscxx . . $ UISnazzyTextItem#set_flags(cb2f890c2fdad230).(0);
3943 }
3944 m_titlecxx . . $ newuiEditBox#m_title.->drawcxx . . $ UISnazzyTextItem#draw(84329bcd07240ccf).(0, 0);
3945 }
3946
3947 DrawTextcxx . . $ UIEdit#DrawText(49f6e7a06ebc5aa8).();
3948 }
3949
3950 void newuiEditBoxcxx . . $ newuiEditBox#::OnKeyDowncxx . . $ newuiEditBox#OnKeyDown(d4f767463ce0a6b3).(int key) {
3951 UIEditcxx . . $ UIEdit#::OnKeyDowncxx . . $ UIEdit#OnKeyDown(d4f767463ce0a6b3).(key);
3952 if (key == KEY_ESCcxx . . $ `ddio/ddio_common.h:267:9`! && m_quick_escape_enablecxx . . $ newuiEditBox#m_quick_escape_enable.) {
3953 UIEditcxx . . $ UIEdit#::SetTextcxx . . $ UIEdit#SetText(85c52e162fed56f9).(NEWUI_EDIT_CANCELED_STRcxx . . $ `Descent3/newui_core.h:180:9`!);
3954 OnSelectcxx . . $ UIEdit#OnSelect(49f6e7a06ebc5aa8).();
3955 }
3956 }
3957
3958 // the new classic hotspot CLASS
3959
3960 newuiHotspotcxx . . $ newuiHotspot#::newuiHotspotcxx . . $ newuiHotspot#newuiHotspot(49f6e7a06ebc5aa8).() { m_titlecxx . . $ newuiHotspot#m_title. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; }
3961
3962 void newuiHotspotcxx . . $ newuiHotspot#::Createcxx . . $ newuiHotspot#Create(c5b4ce760113345f).(UIWindowcxx . . $ UIWindow# *wnd, int16_tcxx . . $ int16_t# id, const char *title, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, int16_tcxx . . $ int16_t# w, int16_tcxx . . $ int16_t# h, int16_tcxx . . $ int16_t# flags) {
3963 if (title) {
3964 m_titlecxx . . $ newuiHotspot#m_title. = mem_strdupcxx . . $ `mem/mem.h:81:9`!(title);
3965 } else {
3966 m_titlecxx . . $ newuiHotspot#m_title. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3967 }
3968
3969 m_alphacxx . . $ newuiHotspot#m_alpha. = 0;
3970 m_alpha_adjustcxx . . $ newuiHotspot#m_alpha_adjust. = 0;
3971 m_mse_timercxx . . $ newuiHotspot#m_mse_timer. = -1.0f;
3972
3973 UIGadgetcxx . . $ UIGadget#::Createcxx . . $ UIGadget#Create(43707b8add2f137d).(wnd, id, x, y, w, h, flags);
3974 }
3975
3976 void newuiHotspotcxx . . $ newuiHotspot#::OnDrawcxx . . $ newuiHotspot#OnDraw(49f6e7a06ebc5aa8).() {
3977 static char buf[256];
3978 char *strptr;
3979 int y = 2, x = 2;
3980
3981 textaux_WordWrapcxx . . $ textaux_WordWrap(2480230cce71d9d7).(m_titlecxx . . $ newuiHotspot#m_title., buf, m_Wcxx . . $ UIObject#m_W. - 22, MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!);
3982
3983 strptr = strtok(buf, "\n");
3984 while (strptr) {
3985 UITextItemcxx . . $ UITextItem# textcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, strptr, NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!);
3986 ddgr_colorcxx . . $ ddgr_color# col =
3987 (m_alpha_adjustcxx . . $ newuiHotspot#m_alpha_adjust. != 0) ? GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(160 + m_alphacxx . . $ newuiHotspot#m_alpha., 160 + m_alphacxx . . $ newuiHotspot#m_alpha., 0 + m_alphacxx . . $ newuiHotspot#m_alpha.) : NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!;
3988 text.set_colorcxx . . $ UITextItem#set_color(cb2f890c2fdad230).(col);
3989 text.set_alphacxx . . $ UITextItem#set_alpha(ac50b47256ae7414).((m_alpha_adjustcxx . . $ newuiHotspot#m_alpha_adjust. != 0) ? 255 : 128);
3990 text.drawcxx . . $ UITextItem#draw(84329bcd07240ccf).(x, y);
3991 y += text.heightcxx . . $ UITextItem#height(b126dc7c1de90089).();
3992 x = 20;
3993
3994 strptr = strtok(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "\n");
3995 }
3996
3997 if (m_alpha_adjustcxx . . $ newuiHotspot#m_alpha_adjust. != 0) {
3998 m_alphacxx . . $ newuiHotspot#m_alpha. += m_alpha_adjustcxx . . $ newuiHotspot#m_alpha_adjust.;
3999 if (m_alphacxx . . $ newuiHotspot#m_alpha. < 0) {
4000 m_alphacxx . . $ newuiHotspot#m_alpha. = 0;
4001 m_alpha_adjustcxx . . $ newuiHotspot#m_alpha_adjust. = 6;
4002 } else if (m_alphacxx . . $ newuiHotspot#m_alpha. > 94) {
4003 m_alphacxx . . $ newuiHotspot#m_alpha. = 94;
4004 m_alpha_adjustcxx . . $ newuiHotspot#m_alpha_adjust. = -6;
4005 }
4006 }
4007 if (!m_infocuscxx . . $ UIGadget#m_infocus.) {
4008 m_alpha_adjustcxx . . $ newuiHotspot#m_alpha_adjust. = 0;
4009 m_alphacxx . . $ newuiHotspot#m_alpha. = 0;
4010 }
4011 }
4012
4013 void newuiHotspotcxx . . $ newuiHotspot#::OnDestroycxx . . $ newuiHotspot#OnDestroy(49f6e7a06ebc5aa8).() {
4014 if (m_titlecxx . . $ newuiHotspot#m_title.) {
4015 mem_freecxx . . $ `mem/mem.h:80:9`!(m_title);
4016 m_titlecxx . . $ newuiHotspot#m_title. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4017 }
4018
4019 UIGadgetcxx . . $ UIGadget#::OnDestroycxx . . $ UIGadget#OnDestroy(49f6e7a06ebc5aa8).();
4020 }
4021
4022 void newuiHotspotcxx . . $ newuiHotspot#::OnMouseBtnDowncxx . . $ newuiHotspot#OnMouseBtnDown(d4f767463ce0a6b3).(int btn) {
4023 if (btn == UILMSEBTNcxx . . $ `ui/uisys.h:36:9`!) {
4024 LOCK_FOCUScxx . . $ `ui/uisys.h:107:9`!(this);
4025 if (m_mse_timercxx . . $ newuiHotspot#m_mse_timer. > -1.0f) {
4026 if ((UI_TIMEcxx . . $ UI_TIME(9b8c9e39889c762c).() - m_mse_timercxx . . $ newuiHotspot#m_mse_timer.) < UI_DBLCLICK_DELAYcxx . . $ `ui/uisys.h:40:9`!) {
4027 if (PT_IN_GADGETcxx . . $ PT_IN_GADGET(55d2799d541f12b5).(UIGadgetcxx . . $ UIGadget#::m_Wndcxx . . $ UIGadget#m_Wnd., this, UI_inputcxx . . $ UI_input..mxcxx . . $ tUIInput#mx., UI_inputcxx . . $ UI_input..mycxx . . $ tUIInput#my.)) {
4028 UNLOCK_FOCUScxx . . $ `ui/uisys.h:109:9`!(this);
4029 OnSelectcxx . . $ UIGadget#OnSelect(49f6e7a06ebc5aa8).();
4030 }
4031 }
4032 m_mse_timercxx . . $ newuiHotspot#m_mse_timer. = -1.0f;
4033 }
4034 }
4035 }
4036
4037 void newuiHotspotcxx . . $ newuiHotspot#::OnMouseBtnUpcxx . . $ newuiHotspot#OnMouseBtnUp(d4f767463ce0a6b3).(int btn) {
4038 if (btn == UILMSEBTNcxx . . $ `ui/uisys.h:36:9`!) {
4039 UNLOCK_FOCUScxx . . $ `ui/uisys.h:109:9`!(this);
4040
4041 if (PT_IN_GADGETcxx . . $ PT_IN_GADGET(55d2799d541f12b5).(UIGadgetcxx . . $ UIGadget#::m_Wndcxx . . $ UIGadget#m_Wnd., this, UI_inputcxx . . $ UI_input..mxcxx . . $ tUIInput#mx., UI_inputcxx . . $ UI_input..mycxx . . $ tUIInput#my.)) {
4042 if (m_mse_timercxx . . $ newuiHotspot#m_mse_timer. == -1.0f) {
4043 m_mse_timercxx . . $ newuiHotspot#m_mse_timer. = UI_TIMEcxx . . $ UI_TIME(9b8c9e39889c762c).();
4044 }
4045 }
4046 }
4047 }
4048
4049 void newuiHotspotcxx . . $ newuiHotspot#::OnGainFocuscxx . . $ newuiHotspot#OnGainFocus(49f6e7a06ebc5aa8).() {
4050 m_alphacxx . . $ newuiHotspot#m_alpha. = 0;
4051 m_alpha_adjustcxx . . $ newuiHotspot#m_alpha_adjust. = 6;
4052 }
4053
4054 void newuiHotspotcxx . . $ newuiHotspot#::OnLostFocuscxx . . $ newuiHotspot#OnLostFocus(49f6e7a06ebc5aa8).() {
4055 m_alphacxx . . $ newuiHotspot#m_alpha. = 0;
4056 m_alpha_adjustcxx . . $ newuiHotspot#m_alpha_adjust. = 0;
4057 }
4058
4059 ///////////////////////////////////////////////////////////////////////////////
4060 // CLASS, sizable window
4061
4062 newuiTiledWindowcxx . . $ newuiTiledWindow#::newuiTiledWindowcxx . . $ newuiTiledWindow#newuiTiledWindow(49f6e7a06ebc5aa8).() {
4063 m_startui_cbcxx . . $ newuiTiledWindow#m_startui_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4064 m_endui_cbcxx . . $ newuiTiledWindow#m_endui_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4065 m_draw_cbcxx . . $ newuiTiledWindow#m_draw_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4066 m_onframe_cbcxx . . $ newuiTiledWindow#m_onframe_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4067 m_datacxx . . $ newuiTiledWindow#m_data. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4068 m_titlecxx . . $ newuiTiledWindow#m_title.[0] = 0;
4069 m_realizedcxx . . $ newuiTiledWindow#m_realized. = false;
4070 }
4071
4072 void newuiTiledWindowcxx . . $ newuiTiledWindow#::Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(const char *title, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y, int16_tcxx . . $ int16_t# w, int16_tcxx . . $ int16_t# h, int flags) {
4073 if (title) {
4074 ASSERTcxx . . $ `misc/pserror.h:246:9`!(strlen(title) < (sizeof(m_title) - 1));
4075 }
4076
4077 // adjust w and height acoordingly with bitmap background width and height.
4078 int bk_width = (w / TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!) + ((w % TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!) ? 1 : 0);
4079 int bk_height = (h / TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!) + ((h % TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!) ? 1 : 0);
4080
4081 if (bk_width < 4)
4082 bk_width = 4;
4083 if (bk_height < 4)
4084 bk_height = 4;
4085
4086 w = bk_width * TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!;
4087 h = bk_height * TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!;
4088
4089 UIWindowcxx . . $ UIWindow#::Createcxx . . $ UIWindow#Create(1559a299834bcdd5).(x, y, w, h, flags | UIF_CENTERcxx . . $ `ui/ui.h:342:9`!);
4090
4091 if (title) {
4092 strcpy(m_titlecxx . . $ newuiTiledWindow#m_title., title);
4093 } else {
4094 m_titlecxx . . $ newuiTiledWindow#m_title.[0] = 0;
4095 }
4096
4097 // initialze stuff
4098 m_startui_cbcxx . . $ newuiTiledWindow#m_startui_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4099 m_endui_cbcxx . . $ newuiTiledWindow#m_endui_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4100 m_draw_cbcxx . . $ newuiTiledWindow#m_draw_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4101 m_onframe_cbcxx . . $ newuiTiledWindow#m_onframe_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4102 m_datacxx . . $ newuiTiledWindow#m_data. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4103 m_realizedcxx . . $ newuiTiledWindow#m_realized. = false;
4104
4105 m_sheetcxx . . $ newuiTiledWindow#m_sheet..Createcxx . . $ newuiSheet#Create(d9d4491c5dd23a91).(this, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 96, NEWUI_TILED_SHEET_Xcxx . . $ `Descent3/newui_core.cpp:354:9`!, title ? NEWUI_TILED_SHEET_Ycxx . . $ `Descent3/newui_core.cpp:355:9`! : NEWUI_TILED_TITLE_Ycxx . . $ `Descent3/newui_core.cpp:357:9`!);
4106
4107 // graphics.
4108 m_piecescxx . . $ newuiTiledWindow#m_pieces.[N_PIECE_IDXcxx . . $ `Descent3/newui_core.h:85:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_N_FILEcxx . . $ `Descent3/newui_core.cpp:309:9`!);
4109 m_piecescxx . . $ newuiTiledWindow#m_pieces.[NE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:86:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_NE_FILEcxx . . $ `Descent3/newui_core.cpp:310:9`!);
4110 m_piecescxx . . $ newuiTiledWindow#m_pieces.[E_PIECE_IDXcxx . . $ `Descent3/newui_core.h:87:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_E_FILEcxx . . $ `Descent3/newui_core.cpp:311:9`!);
4111 m_piecescxx . . $ newuiTiledWindow#m_pieces.[SE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:88:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_SE_FILEcxx . . $ `Descent3/newui_core.cpp:312:9`!);
4112 m_piecescxx . . $ newuiTiledWindow#m_pieces.[S_PIECE_IDXcxx . . $ `Descent3/newui_core.h:89:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_S_FILEcxx . . $ `Descent3/newui_core.cpp:313:9`!);
4113 m_piecescxx . . $ newuiTiledWindow#m_pieces.[SW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:90:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_SW_FILEcxx . . $ `Descent3/newui_core.cpp:314:9`!);
4114 m_piecescxx . . $ newuiTiledWindow#m_pieces.[W_PIECE_IDXcxx . . $ `Descent3/newui_core.h:91:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_W_FILEcxx . . $ `Descent3/newui_core.cpp:315:9`!);
4115 m_piecescxx . . $ newuiTiledWindow#m_pieces.[NW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:92:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_NW_FILEcxx . . $ `Descent3/newui_core.cpp:316:9`!);
4116 m_piecescxx . . $ newuiTiledWindow#m_pieces.[C_PIECE_IDXcxx . . $ `Descent3/newui_core.h:93:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_C_FILEcxx . . $ `Descent3/newui_core.cpp:317:9`!);
4117
4118 m_piecescxx . . $ newuiTiledWindow#m_pieces.[TL_PIECE_IDXcxx . . $ `Descent3/newui_core.h:94:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_TITLE_L_FILEcxx . . $ `Descent3/newui_core.cpp:319:9`!);
4119 m_piecescxx . . $ newuiTiledWindow#m_pieces.[TC_PIECE_IDXcxx . . $ `Descent3/newui_core.h:95:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_TITLE_C_FILEcxx . . $ `Descent3/newui_core.cpp:320:9`!);
4120 m_piecescxx . . $ newuiTiledWindow#m_pieces.[TR_PIECE_IDXcxx . . $ `Descent3/newui_core.h:96:9`!] = Newui_resourcescxx . . $ Newui_resources..Loadcxx . . $ newuiResources#Load(9af3ea6534c90d0f).(NEWUI_WIN_TITLE_R_FILEcxx . . $ `Descent3/newui_core.cpp:321:9`!);
4121 }
4122
4123 // grab a newui interface from it.
4124 newuiSheetcxx . . $ newuiSheet# *newuiTiledWindowcxx . . $ newuiTiledWindow#::GetSheetcxx . . $ newuiTiledWindow#GetSheet(661381a276e5b628).() { return &m_sheetcxx . . $ newuiTiledWindow#m_sheet.; }
4125
4126 // do user interface on it.
4127 int newuiTiledWindowcxx . . $ newuiTiledWindow#::DoUIcxx . . $ newuiTiledWindow#DoUI(b126dc7c1de90089).() {
4128 // start ui.
4129 UI_frame_resultcxx . . $ UI_frame_result. = -1;
4130 ui_ShowCursorcxx . . $ ui_ShowCursor(c9857a73d68e59ba).();
4131
4132 if (m_startui_cbcxx . . $ newuiTiledWindow#m_startui_cb.) {
4133 (*m_startui_cbcxx . . $ newuiTiledWindow#m_startui_cb.)(this, m_datacxx . . $ newuiTiledWindow#m_data.);
4134 }
4135
4136 if (!m_realizedcxx . . $ newuiTiledWindow#m_realized.) {
4137 m_sheetcxx . . $ newuiTiledWindow#m_sheet..Realizecxx . . $ newuiSheet#Realize(49f6e7a06ebc5aa8).();
4138 m_realizedcxx . . $ newuiTiledWindow#m_realized. = true;
4139 }
4140
4141 // refreshes gadgets on current sheet.
4142 m_sheetcxx . . $ newuiTiledWindow#m_sheet..UpdateChangescxx . . $ newuiSheet#UpdateChanges(49f6e7a06ebc5aa8).();
4143
4144 // this should poll UI_frame_result.
4145 while (UI_frame_resultcxx . . $ UI_frame_result. == -1) {
4146
4147 Descentcxx . . $ Descent.->defercxx . . $ oeApplication#defer(db52760e79bf9054).();
4148 DoUIFramecxx . . $ DoUIFrame(49f6e7a06ebc5aa8).();
4149 if (m_onframe_cbcxx . . $ newuiTiledWindow#m_onframe_cb.) {
4150 (*m_onframe_cbcxx . . $ newuiTiledWindow#m_onframe_cb.)(this, m_datacxx . . $ newuiTiledWindow#m_data.);
4151 }
4152 if (m_draw_cbcxx . . $ newuiTiledWindow#m_draw_cb.) {
4153 ui_StartDrawcxx . . $ ui_StartDraw(748afa4755bc9595).(m_Xcxx . . $ UIObject#m_X., m_Ycxx . . $ UIObject#m_Y., m_Xcxx . . $ UIObject#m_X. + m_Wcxx . . $ UIObject#m_W., m_Ycxx . . $ UIObject#m_Y. + m_Hcxx . . $ UIObject#m_H.);
4154 (*m_draw_cbcxx . . $ newuiTiledWindow#m_draw_cb.)(this, m_datacxx . . $ newuiTiledWindow#m_data.);
4155 ui_EndDrawcxx . . $ ui_EndDraw(49f6e7a06ebc5aa8).();
4156 ui_DoCursorcxx . . $ ui_DoCursor(49f6e7a06ebc5aa8).();
4157 }
4158 rend_Flipcxx . . $ rend_Flip(49f6e7a06ebc5aa8).();
4159 }
4160
4161 // refreshes gadgets on current sheet.
4162 m_sheetcxx . . $ newuiTiledWindow#m_sheet..UpdateReturnValuescxx . . $ newuiSheet#UpdateReturnValues(49f6e7a06ebc5aa8).();
4163
4164 if (m_endui_cbcxx . . $ newuiTiledWindow#m_endui_cb.) {
4165 (*m_endui_cbcxx . . $ newuiTiledWindow#m_endui_cb.)(this, m_datacxx . . $ newuiTiledWindow#m_data.);
4166 }
4167
4168 // cleanup
4169 ui_HideCursorcxx . . $ ui_HideCursor(c9857a73d68e59ba).();
4170 ui_Flushcxx . . $ ui_Flush(49f6e7a06ebc5aa8).();
4171
4172 return UI_frame_resultcxx . . $ UI_frame_result.;
4173 }
4174
4175 void newuiTiledWindowcxx . . $ newuiTiledWindow#::SetDatacxx . . $ newuiTiledWindow#SetData(5d22bdacc48458e8).(void *data) { m_datacxx . . $ newuiTiledWindow#m_data. = data; }
4176
4177 // set callbacks
4178 // first called when DoUI is called.
4179 void newuiTiledWindowcxx . . $ newuiTiledWindow#::SetOnStartUICBcxx . . $ newuiTiledWindow#SetOnStartUICB(af93e79073e6e663).(void (*fn)(newuiTiledWindowcxx . . $ newuiTiledWindow# *, void *)) { m_startui_cbcxx . . $ newuiTiledWindow#m_startui_cb. = fn; }
4180
4181 // called when DoUI returns
4182 void newuiTiledWindowcxx . . $ newuiTiledWindow#::SetOnEndUICBcxx . . $ newuiTiledWindow#SetOnEndUICB(af93e79073e6e663).(void (*fn)(newuiTiledWindowcxx . . $ newuiTiledWindow# *, void *)) { m_endui_cbcxx . . $ newuiTiledWindow#m_endui_cb. = fn; }
4183
4184 // called before rend_Flip but after ui has drawn. (SetUICallback is before ui has been rendered)
4185 void newuiTiledWindowcxx . . $ newuiTiledWindow#::SetOnDrawCBcxx . . $ newuiTiledWindow#SetOnDrawCB(af93e79073e6e663).(void (*fn)(newuiTiledWindowcxx . . $ newuiTiledWindow# *, void *)) { m_draw_cbcxx . . $ newuiTiledWindow#m_draw_cb. = fn; }
4186
4187 // called after DoUIFrame is called. for immediate results.
4188 void newuiTiledWindowcxx . . $ newuiTiledWindow#::SetOnUIFrameCBcxx . . $ newuiTiledWindow#SetOnUIFrameCB(af93e79073e6e663).(void (*fn)(newuiTiledWindowcxx . . $ newuiTiledWindow# *, void *)) { m_onframe_cbcxx . . $ newuiTiledWindow#m_onframe_cb. = fn; }
4189
4190 #include "newui.h"cxx . . $ `<file>/Descent3/newui.h`/
4191
4192 // Returns the index of the tile bitmap to draw along the top of the window
4193 int newuiTiledWindowcxx . . $ newuiTiledWindow#::GetTopTileIndexcxx . . $ newuiTiledWindow#GetTopTileIndex(9b79fb6aee4c0440).(int tx, int window_width) {
4194 int title_width, left, right;
4195
4196 // Get size of the title
4197 int flags = GetFlagscxx . . $ UIWindow#GetFlags(455f465bc33b4cdf).();
4198 switch (NEWUI_GETTITLEBARcxx . . $ `Descent3/newui.h:203:9`!(flags)) {
4199 case NUWF_TITLENONEcxx . . $ `Descent3/newui.h:197:9`!:
4200 return N_PIECE_IDXcxx . . $ `Descent3/newui_core.h:85:9`!;
4201 case NUWF_TITLESMALLcxx . . $ `Descent3/newui.h:198:9`!:
4202 title_width = 2;
4203 break;
4204 case NUWF_TITLEMEDcxx . . $ `Descent3/newui.h:199:9`!:
4205 title_width = 4;
4206 break;
4207 case NUWF_TITLELARGEcxx . . $ `Descent3/newui.h:200:9`!:
4208 title_width = 6;
4209 break;
4210 }
4211
4212 // If one width is odd and other even, then add an extra tile to the title
4213 if ((window_width ^ title_width) & 1)
4214 title_width++;
4215
4216 // Get positions of left & right edges
4217 left = window_width / 2 - title_width / 2 - 1;
4218 right = left + title_width + 1;
4219
4220 // Clip to edges
4221 if (left < 0)
4222 left = 0;
4223 if (right >= window_width)
4224 right = window_width - 1;
4225
4226 // Bail if no room for title
4227 if (left >= right)
4228 return N_PIECE_IDXcxx . . $ `Descent3/newui_core.h:85:9`!;
4229
4230 if (tx == left)
4231 return TL_PIECE_IDXcxx . . $ `Descent3/newui_core.h:94:9`!;
4232 else if (tx == right)
4233 return TR_PIECE_IDXcxx . . $ `Descent3/newui_core.h:96:9`!;
4234 else if ((tx > left) && (tx < right))
4235 return TC_PIECE_IDXcxx . . $ `Descent3/newui_core.h:95:9`!;
4236 else
4237 return N_PIECE_IDXcxx . . $ `Descent3/newui_core.h:85:9`!;
4238 }
4239
4240 void newuiTiledWindowcxx . . $ newuiTiledWindow#::OnDrawcxx . . $ newuiTiledWindow#OnDraw(49f6e7a06ebc5aa8).() {
4241 // draw tiles.
4242 int tx, ty;
4243 int bk_width = (m_Wcxx . . $ UIObject#m_W. / TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!) + ((m_Wcxx . . $ UIObject#m_W. % TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!) ? 1 : 0);
4244 int bk_height = (m_Hcxx . . $ UIObject#m_H. / TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!) + ((m_Hcxx . . $ UIObject#m_H. % TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!) ? 1 : 0);
4245 int corner_tw = TW_CORNER_WIDTHcxx . . $ `Descent3/newui_core.cpp:366:9`! / TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!;
4246 int corner_th = TW_CORNER_HEIGHTcxx . . $ `Descent3/newui_core.cpp:367:9`! / TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!;
4247
4248 // fill background
4249 for (ty = 1; ty < (bk_height - 1); ty++) {
4250 for (tx = 1; tx < (bk_width - 1); tx++) {
4251 m_piecescxx . . $ newuiTiledWindow#m_pieces.[C_PIECE_IDXcxx . . $ `Descent3/newui_core.h:93:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(tx * TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!, ty * TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!);
4252 }
4253 }
4254
4255 // do sides
4256 for (ty = corner_th; ty < (bk_height - corner_th); ty++) {
4257 m_piecescxx . . $ newuiTiledWindow#m_pieces.[W_PIECE_IDXcxx . . $ `Descent3/newui_core.h:91:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(0, ty * TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!);
4258 m_piecescxx . . $ newuiTiledWindow#m_pieces.[E_PIECE_IDXcxx . . $ `Descent3/newui_core.h:87:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).((bk_width - 1) * TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!, ty * TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!);
4259 }
4260
4261 for (tx = corner_tw; tx < (bk_width - corner_tw); tx++) {
4262
4263 m_piecescxx . . $ newuiTiledWindow#m_pieces.[GetTopTileIndexcxx . . $ newuiTiledWindow#GetTopTileIndex(9b79fb6aee4c0440).(tx - corner_tw, bk_width - 2 * corner_tw)]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(tx * TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!, 0);
4264 m_piecescxx . . $ newuiTiledWindow#m_pieces.[S_PIECE_IDXcxx . . $ `Descent3/newui_core.h:89:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(tx * TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!, (bk_height - 1) * TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!);
4265 }
4266
4267 // do corners.
4268 m_piecescxx . . $ newuiTiledWindow#m_pieces.[NW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:92:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(0, 0);
4269 m_piecescxx . . $ newuiTiledWindow#m_pieces.[NE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:86:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).((bk_width - corner_tw) * TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!, 0);
4270 m_piecescxx . . $ newuiTiledWindow#m_pieces.[SE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:88:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).((bk_width - corner_tw) * TW_PIECE_WIDTHcxx . . $ `Descent3/newui_core.cpp:364:9`!, (bk_height - corner_th) * TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!);
4271 m_piecescxx . . $ newuiTiledWindow#m_pieces.[SW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:90:9`!]->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(0, (bk_height - corner_th) * TW_PIECE_HEIGHTcxx . . $ `Descent3/newui_core.cpp:365:9`!);
4272
4273 // do title
4274 UITextItemcxx . . $ UITextItem# textcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).(MONITOR15_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:116:9`!, m_titlecxx . . $ newuiTiledWindow#m_title., NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!);
4275 text.drawcxx . . $ UITextItem#draw(84329bcd07240ccf).(NEWUI_TILED_TITLE_Xcxx . . $ `Descent3/newui_core.cpp:356:9`!, NEWUI_TILED_TITLE_Ycxx . . $ `Descent3/newui_core.cpp:357:9`!);
4276 }
4277
4278 void newuiTiledWindowcxx . . $ newuiTiledWindow#::OnDestroycxx . . $ newuiTiledWindow#OnDestroy(49f6e7a06ebc5aa8).() {
4279 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[N_PIECE_IDXcxx . . $ `Descent3/newui_core.h:85:9`!]);
4280 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[NE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:86:9`!]);
4281 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[E_PIECE_IDXcxx . . $ `Descent3/newui_core.h:87:9`!]);
4282 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[SE_PIECE_IDXcxx . . $ `Descent3/newui_core.h:88:9`!]);
4283 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[S_PIECE_IDXcxx . . $ `Descent3/newui_core.h:89:9`!]);
4284 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[SW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:90:9`!]);
4285 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[W_PIECE_IDXcxx . . $ `Descent3/newui_core.h:91:9`!]);
4286 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[NW_PIECE_IDXcxx . . $ `Descent3/newui_core.h:92:9`!]);
4287 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[C_PIECE_IDXcxx . . $ `Descent3/newui_core.h:93:9`!]);
4288
4289 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[TL_PIECE_IDXcxx . . $ `Descent3/newui_core.h:94:9`!]);
4290 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[TC_PIECE_IDXcxx . . $ `Descent3/newui_core.h:95:9`!]);
4291 Newui_resourcescxx . . $ Newui_resources..Freecxx . . $ newuiResources#Free(4dc4c37c6aa93e7c).(m_piecescxx . . $ newuiTiledWindow#m_pieces.[TR_PIECE_IDXcxx . . $ `Descent3/newui_core.h:96:9`!]);
4292
4293 m_startui_cbcxx . . $ newuiTiledWindow#m_startui_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4294 m_endui_cbcxx . . $ newuiTiledWindow#m_endui_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4295 m_draw_cbcxx . . $ newuiTiledWindow#m_draw_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4296 m_onframe_cbcxx . . $ newuiTiledWindow#m_onframe_cb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4297 m_datacxx . . $ newuiTiledWindow#m_data. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4298
4299 m_sheetcxx . . $ newuiTiledWindow#m_sheet..Destroycxx . . $ newuiSheet#Destroy(49f6e7a06ebc5aa8).();
4300
4301 UIWindowcxx . . $ UIWindow#::OnDestroycxx . . $ UIWindow#OnDestroy(49f6e7a06ebc5aa8).();
4302 }