source: trunk/include/helpers/dialog.h@ 196

Last change on this file since 196 was 195, checked in by umoeller, 23 years ago

Misc fixes.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 25.5 KB
Line 
1
2/*
3 *@@sourcefile dialog.h:
4 * header file for dialog.c. See remarks there.
5 *
6 * Note: Version numbering in this file relates to XWorkplace version
7 * numbering.
8 *
9 *@@added V0.9.9 (2001-04-01) [umoeller]
10 *@@include <os2.h>
11 *@@include #include "helpers\linklist.h" // for mnemonic helpers
12 *@@include #include "helpers\dialog.h"
13 */
14
15/* Copyright (C) 2001 Ulrich M”ller.
16 * This file is part of the "XWorkplace helpers" source package.
17 * This is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published
19 * by the Free Software Foundation, in version 2 as it comes in the
20 * "COPYING" file of the XWorkplace main distribution.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 */
26
27#if __cplusplus
28extern "C" {
29#endif
30
31#ifndef DIALOG_HEADER_INCLUDED
32 #define DIALOG_HEADER_INCLUDED
33
34 #ifndef NULL_POINT
35 #define NULL_POINT {0, 0}
36 #endif
37
38 /* ******************************************************************
39 *
40 * Error codes
41 *
42 ********************************************************************/
43
44 #define ERROR_DLG_FIRST 43000
45
46 #define DLGERR_ROW_BEFORE_TABLE (ERROR_DLG_FIRST)
47 #define DLGERR_CONTROL_BEFORE_ROW (ERROR_DLG_FIRST + 1)
48 #define DLGERR_NULL_CTL_DEF (ERROR_DLG_FIRST + 2)
49 #define DLGERR_CANNOT_CREATE_FRAME (ERROR_DLG_FIRST + 3)
50 #define DLGERR_INVALID_CODE (ERROR_DLG_FIRST + 4)
51 #define DLGERR_TABLE_NOT_CLOSED (ERROR_DLG_FIRST + 5)
52 #define DLGERR_TOO_MANY_TABLES_CLOSED (ERROR_DLG_FIRST + 6)
53 #define DLGERR_CANNOT_CREATE_CONTROL (ERROR_DLG_FIRST + 7)
54 #define DLGERR_ARRAY_TOO_SMALL (ERROR_DLG_FIRST + 8)
55 #define DLGERR_INVALID_CONTROL_TITLE (ERROR_DLG_FIRST + 9)
56 #define DLGERR_INVALID_STATIC_BITMAP (ERROR_DLG_FIRST + 10)
57
58 #define ERROR_DLG_LAST (ERROR_DLG_FIRST + 10)
59
60 /* ******************************************************************
61 *
62 * Structures
63 *
64 ********************************************************************/
65
66 #define SZL_AUTOSIZE (-1)
67
68 #define CTL_COMMON_FONT ((PCSZ)-1)
69
70 #define ROW_VALIGN_MASK 0x0003
71 #define ROW_VALIGN_BOTTOM 0x0000
72 #define ROW_VALIGN_CENTER 0x0001
73 #define ROW_VALIGN_TOP 0x0002
74
75 /*
76 *@@ CONTROLDEF:
77 * defines a single control. Used
78 * with the TYPE_CONTROL_DEF type in
79 * DLGHITEM.
80 *
81 *@@changed V0.9.12 (2001-05-31) [umoeller]: added control data
82 */
83
84 typedef struct _CONTROLDEF
85 {
86 const char *pcszClass; // registered PM window class
87 const char *pcszText;
88 // window text (class-specific)
89 // special hacks:
90 // -- For WS_STATIC with SS_BITMAP or SS_ICON set,
91 // you may specify the exact HPOINTER here.
92 // The dlg routine will then subclass the static
93 //
94
95 ULONG flStyle; // standard window styles
96
97 USHORT usID; // dlg item ID
98
99 const char *pcszFont; // font presparam, or NULL for no presparam,
100 // or CTL_COMMON_FONT for standard dialog
101 // font specified on input to dlghCreateDlg
102
103 USHORT usAdjustPosition;
104 // flags for winhAdjustControls; any combination of
105 // XAC_MOVEX, XAC_MOVEY, XAC_SIZEX, XAC_SIZEY
106 // @@todo not implemented yet
107
108 SIZEL szlDlgUnits;
109 // proposed size for the control. Note that starting
110 // with V0.9.19, these are now dialog units to
111 // finally fix the bad alignment problems with
112 // lower resolutions. The dialog formatter applies
113 // an internal factor to these things based on
114 // what WinMapDlgPoints gives us.
115 // A number of special flags are available per
116 // cx and cy field:
117 // -- SZL_AUTOSIZE (-1): determine size automatically.
118 // Works only for statics with SS_TEXT and
119 // SS_BITMAP.
120 // -- Any other _negative_ value is considered a
121 // percentage of the largest row width in the
122 // table. For example, -50 would mean 50% of
123 // the largest row in the table. This is valid
124 // for the CX field only.
125 // If the CONTROLDEF appears with a START_NEW_TABLE
126 // type in _DLGHITEM (to specify a group table)
127 // and they are not SZL_AUTOSIZE, they specify the
128 // size of the inner table of the group (to override
129 // the automatic formatting). Note that the dialog
130 // adds extra spacing to this size:
131 // -- the group control's cx will be
132 // szlControlProposed.cx
133 // + 2 * ulSpacing
134 // + 2 * GROUP_INNER_SPACING_X
135 // -- the group control's cy will be
136 // szlControlProposed.cy
137 // + 2 * ulSpacing
138 // + GROUP_INNER_SPACING_Y
139 // + GROUP_INNER_SPACING_TOP
140
141 ULONG duSpacing;
142 // spacing around control; this is now in dialog
143 // units too V0.9.19 (2002-04-24) [umoeller]
144
145 PVOID pvCtlData; // for WinCreateWindow
146
147 } CONTROLDEF, *PCONTROLDEF;
148
149 typedef const struct _CONTROLDEF *PCCONTROLDEF;
150
151 /*
152 *@@ DLGHITEMTYPE:
153 *
154 */
155
156 typedef enum _DLGHITEMTYPE
157 {
158 TYPE_START_NEW_TABLE, // beginning of a new table; may nest
159 TYPE_START_NEW_ROW, // beginning of a new row in a table
160 TYPE_CONTROL_DEF, // control definition
161 TYPE_END_TABLE // end of a table
162 } DLGHITEMTYPE;
163
164 // a few handy macros for defining templates
165
166 #define START_TABLE { TYPE_START_NEW_TABLE, 0 }
167
168 // this macro is slightly insane, but performs type checking
169 // in case the user gives a pointer which is not of CONTROLDEF
170 #define START_GROUP_TABLE(pDef) { TYPE_START_NEW_TABLE, \
171 ( (ULONG)(&(pDef)->pcszClass) ) }
172
173 #define END_TABLE { TYPE_END_TABLE, 0 }
174
175 #define START_ROW(fl) { TYPE_START_NEW_ROW, fl }
176
177 #define CONTROL_DEF(pDef) { TYPE_CONTROL_DEF, \
178 ( (ULONG)(&(pDef)->pcszClass) ) }
179
180 /*
181 *@@ DLGHITEM:
182 * dialog format array item.
183 *
184 * An array of these must be passed to dlghCreateDlg
185 * to tell it what controls the dialog contains.
186 * See dlghCreateDlg for details.
187 *
188 */
189
190 typedef struct _DLGHITEM
191 {
192 DLGHITEMTYPE Type;
193 // one of:
194 // TYPE_START_NEW_TABLE, // beginning of a new table
195 // TYPE_START_NEW_ROW, // beginning of a new row in a table
196 // TYPE_CONTROL_DEF // control definition
197 // TYPE_END_TABLE // end of table
198
199 ULONG ulData;
200 // -- with TYPE_START_NEW_TABLE: if NULL, this starts
201 // an invisible table (for formatting only).
202 // Otherwise a _CONTROLDEF pointer to specify
203 // a control to be produced around the table.
204 // For example, you can specify a WC_STATIC
205 // with SS_GROUPBOX to create a group around
206 // the table.
207 // -- with TYPE_START_NEW_ROW: ROW_* formatting flags.
208 // -- with TYPE_CONTROL_DEF: _CONTROLDEF pointer to a control definition
209 } DLGHITEM, *PDLGHITEM;
210
211 typedef const struct _DLGHITEM *PCDLGHITEM;
212
213 /* ******************************************************************
214 *
215 * Macros
216 *
217 ********************************************************************/
218
219 #define LOAD_STRING ((PCSZ)-1)
220
221 // if the following is defined, we ignore the Y factor
222 // when scaling dialog units to pixels but use the X
223 // factor twice. This will result in something specified
224 // to be 10x10 units to be square, but will result in
225 // problems because dialog units are based on the
226 // system default fonts and x is different from y then.
227 // #define USE_SQUARE_CORRELATION
228
229 // if you still want something to be vaguely square,
230 // try the following macro to calculate the CY from a CX
231 #ifdef USE_SQUARE_CORRELATION
232 #define MAKE_SQUARE_CY(cx) (cx)
233 #else
234 #define MAKE_SQUARE_CY(cx) (cx * 200 / 250)
235 #endif
236
237 #define DLG_OUTER_SPACING_X 4
238 // outer spacing applied around entire dialog;
239 // we now use 4 to match the spacing in Warp 4
240 // notebook pages V0.9.19 (2002-04-24) [umoeller]
241 #define DLG_OUTER_SPACING_Y 3
242
243 #define COMMON_SPACING 1
244
245 #define GROUP_INNER_SPACING_X 3
246 #define GROUP_OUTER_SPACING_BOTTOM 1
247 #define GROUP_INNER_SPACING_BOTTOM 3
248 #define GROUP_INNER_SPACING_TOP 8
249 #define GROUP_OUTER_SPACING_TOP 0
250
251 #define STD_BUTTON_WIDTH 50
252
253 #ifdef USE_SQUARE_CORRELATION
254 #define STD_BUTTON_HEIGHT 15
255 #define STD_SPIN_HEIGHT 10
256 #else
257 #define STD_BUTTON_HEIGHT 12
258 #define STD_SPIN_HEIGHT 8
259 #endif
260
261 #define DEFAULT_TABLE_WIDTH 150
262
263 #define MSGBOX_TEXTWIDTH 200
264
265 // the following require INCL_WINSTATICS
266
267 #define CONTROLDEF_GROUP(pcsz, id, cx, cy) { WC_STATIC, pcsz, \
268 WS_VISIBLE | SS_GROUPBOX | DT_MNEMONIC, \
269 id, CTL_COMMON_FONT, 0, { cx, cy }, COMMON_SPACING }
270
271 #define LOADDEF_GROUP(id, cx) CONTROLDEF_GROUP(LOAD_STRING, id, cx, SZL_AUTOSIZE)
272
273 #define CONTROLDEF_TEXT(pcsz, id, cx, cy) { WC_STATIC, pcsz, \
274 WS_VISIBLE | SS_TEXT | DT_LEFT | DT_VCENTER | DT_MNEMONIC, \
275 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING }
276
277 #define LOADDEF_TEXT(id) CONTROLDEF_TEXT(LOAD_STRING, id, SZL_AUTOSIZE, SZL_AUTOSIZE)
278
279 #define CONTROLDEF_TEXT_CENTER(pcsz, id, cx, cy) { WC_STATIC, pcsz, \
280 WS_VISIBLE | SS_TEXT | DT_CENTER | DT_VCENTER | DT_MNEMONIC, \
281 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING }
282
283 #define CONTROLDEF_TEXT_RIGHT(pcsz, id, cx, cy) { WC_STATIC, pcsz, \
284 WS_VISIBLE | SS_TEXT | DT_RIGHT | DT_VCENTER | DT_MNEMONIC, \
285 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING }
286
287 #define LOADDEF_TEXT_RIGHT(id) CONTROLDEF_TEXT_RIGHT(LOAD_STRING, id, SZL_AUTOSIZE, SZL_AUTOSIZE)
288
289 #define CONTROLDEF_TEXT_WORDBREAK(pcsz, id, cx) { WC_STATIC, pcsz, \
290 WS_VISIBLE | SS_TEXT | DT_LEFT | DT_TOP | DT_WORDBREAK, \
291 id, CTL_COMMON_FONT, 0, {cx, SZL_AUTOSIZE}, COMMON_SPACING }
292
293 #define LOADDEF_TEXT_WORDBREAK(id, cx) CONTROLDEF_TEXT_WORDBREAK(LOAD_STRING, id, cx)
294
295 #define CONTROLDEF_TEXT_WORDBREAK_MNEMONIC(pcsz, id, cx) { WC_STATIC, pcsz, \
296 WS_VISIBLE | SS_TEXT | DT_LEFT | DT_TOP | DT_WORDBREAK | DT_MNEMONIC, \
297 id, CTL_COMMON_FONT, 0, {cx, SZL_AUTOSIZE}, COMMON_SPACING }
298
299 #define LOADDEF_TEXT_WORDBREAK_MNEMONIC(id, cx) CONTROLDEF_TEXT_WORDBREAK_MNEMONIC(LOAD_STRING, id, cx)
300
301 #define CONTROLDEF_ICON(hptr, id) { WC_STATIC, (PCSZ)(hptr), \
302 WS_VISIBLE | SS_ICON | DT_LEFT | DT_VCENTER, \
303 id, CTL_COMMON_FONT, 0, {SZL_AUTOSIZE, SZL_AUTOSIZE}, COMMON_SPACING }
304
305 #define CONTROLDEF_ICON_WIDER(hptr, id) { WC_STATIC, (PCSZ)(hptr), \
306 WS_VISIBLE | SS_ICON | DT_LEFT | DT_VCENTER, \
307 id, CTL_COMMON_FONT, 0, {SZL_AUTOSIZE, SZL_AUTOSIZE}, 2 * COMMON_SPACING }
308
309 #define CONTROLDEF_BITMAP(hbm, id) { WC_STATIC, (PCSZ)(hbm), \
310 WS_VISIBLE | SS_BITMAP | DT_LEFT | DT_VCENTER, \
311 id, CTL_COMMON_FONT, 0, {SZL_AUTOSIZE, SZL_AUTOSIZE}, COMMON_SPACING }
312
313 // the following require INCL_WINBUTTONS
314
315 #define CONTROLDEF_DEFPUSHBUTTON(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \
316 WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON | BS_DEFAULT, \
317 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING }
318
319 #define LOADDEF_DEFPUSHBUTTON(id) CONTROLDEF_DEFPUSHBUTTON(LOAD_STRING, id, STD_BUTTON_WIDTH, STD_BUTTON_HEIGHT)
320
321 #define CONTROLDEF_PUSHBUTTON(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \
322 WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON, \
323 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING }
324
325 #define LOADDEF_PUSHBUTTON(id) CONTROLDEF_PUSHBUTTON(LOAD_STRING, id, STD_BUTTON_WIDTH, STD_BUTTON_HEIGHT)
326
327 #define CONTROLDEF_DEFNOFOCUSBUTTON(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \
328 WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON | BS_DEFAULT | BS_NOPOINTERFOCUS, \
329 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING }
330
331 #define CONTROLDEF_NOFOCUSBUTTON(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \
332 WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON | BS_NOPOINTERFOCUS, \
333 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING }
334
335 #define LOADDEF_NOFOCUSBUTTON(id) CONTROLDEF_NOFOCUSBUTTON(LOAD_STRING, id, STD_BUTTON_WIDTH, STD_BUTTON_HEIGHT)
336
337 #define CONTROLDEF_HELPPUSHBUTTON(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \
338 WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON | BS_HELP | BS_NOPOINTERFOCUS, \
339 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING }
340
341 #define LOADDEF_HELPPUSHBUTTON(id) CONTROLDEF_HELPPUSHBUTTON(LOAD_STRING, id, STD_BUTTON_WIDTH, STD_BUTTON_HEIGHT)
342
343 #define CONTROLDEF_AUTOCHECKBOX(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \
344 WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX, \
345 id, CTL_COMMON_FONT, 0, { cx, cy }, COMMON_SPACING }
346
347 #define LOADDEF_AUTOCHECKBOX(id) CONTROLDEF_AUTOCHECKBOX(LOAD_STRING, id, SZL_AUTOSIZE, SZL_AUTOSIZE)
348
349 #define CONTROLDEF_FIRST_AUTORADIO(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \
350 WS_VISIBLE | WS_TABSTOP | BS_AUTORADIOBUTTON | WS_GROUP, \
351 id, CTL_COMMON_FONT, 0, { cx, cy }, COMMON_SPACING }
352
353 #define LOADDEF_FIRST_AUTORADIO(id) CONTROLDEF_FIRST_AUTORADIO(LOAD_STRING, id, SZL_AUTOSIZE, SZL_AUTOSIZE)
354
355 #define CONTROLDEF_NEXT_AUTORADIO(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \
356 WS_VISIBLE | WS_TABSTOP | BS_AUTORADIOBUTTON, \
357 id, CTL_COMMON_FONT, 0, { cx, cy }, COMMON_SPACING }
358
359 #define LOADDEF_NEXT_AUTORADIO(id) CONTROLDEF_NEXT_AUTORADIO(LOAD_STRING, id, SZL_AUTOSIZE, SZL_AUTOSIZE)
360
361 // the following require INCL_WINENTRYFIELDS
362
363 #define CONTROLDEF_ENTRYFIELD(pcsz, id, cx, cy) { WC_ENTRYFIELD, pcsz, \
364 WS_VISIBLE | WS_TABSTOP | ES_MARGIN | ES_AUTOSCROLL, \
365 id, CTL_COMMON_FONT, 0, { cx, cy }, COMMON_SPACING }
366
367 #define CONTROLDEF_ENTRYFIELD_RO(pcsz, id, cx, cy) { WC_ENTRYFIELD, pcsz, \
368 WS_VISIBLE | WS_TABSTOP | ES_MARGIN | ES_READONLY | ES_AUTOSCROLL, \
369 id, CTL_COMMON_FONT, 0, { cx, cy }, COMMON_SPACING }
370
371 // the following require INCL_WINMLE
372
373 #define CONTROLDEF_MLE(pcsz, id, cx, cy) { WC_MLE, pcsz, \
374 WS_VISIBLE | WS_TABSTOP | MLS_BORDER | MLS_IGNORETAB | MLS_WORDWRAP, \
375 id, CTL_COMMON_FONT, 0, { cx, cy }, COMMON_SPACING }
376
377 // the following require INCL_WINLISTBOXES
378
379 #define CONTROLDEF_LISTBOX(id, cx, cy) { WC_LISTBOX, NULL, \
380 WS_VISIBLE | WS_TABSTOP | LS_HORZSCROLL | LS_NOADJUSTPOS, \
381 id, CTL_COMMON_FONT, 0, { cx, cy }, COMMON_SPACING }
382
383 // the following require INCL_WINLISTBOXES and INCL_WINENTRYFIELDS
384
385 #define CONTROLDEF_DROPDOWN(id, cx, cy) { WC_COMBOBOX, NULL, \
386 WS_VISIBLE | WS_TABSTOP | LS_HORZSCROLL | CBS_DROPDOWN, \
387 id, CTL_COMMON_FONT, 0, { cx, cy }, COMMON_SPACING }
388
389 #define CONTROLDEF_DROPDOWNLIST(id, cx, cy) { WC_COMBOBOX, NULL, \
390 WS_VISIBLE | WS_TABSTOP | LS_HORZSCROLL | CBS_DROPDOWNLIST, \
391 id, CTL_COMMON_FONT, 0, { cx, cy }, COMMON_SPACING }
392
393 // the following require INCL_WINSTDSPIN
394
395 #define CONTROLDEF_SPINBUTTON(id, cx, cy) { WC_SPINBUTTON, NULL, \
396 WS_VISIBLE | WS_TABSTOP | SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTCENTER | SPBS_FASTSPIN, \
397 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING }
398
399 // the following require INCL_WINSTDCNR
400
401 #define CONTROLDEF_CONTAINER(id, cx, cy) { WC_CONTAINER, NULL, \
402 WS_VISIBLE | WS_TABSTOP | 0, \
403 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING }
404
405 #define CONTROLDEF_CONTAINER_EXTSEL(id, cx, cy) { WC_CONTAINER, NULL, \
406 WS_VISIBLE | WS_TABSTOP | CCS_EXTENDSEL, \
407 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING }
408
409 // the following require INCL_WINSTDSLIDER
410
411 #define CONTROLDEF_SLIDER(id, cx, cy, pctldata) { WC_SLIDER, NULL, \
412 WS_VISIBLE | WS_TABSTOP | WS_GROUP | SLS_HORIZONTAL | SLS_PRIMARYSCALE1 \
413 | SLS_BUTTONSRIGHT | SLS_SNAPTOINCREMENT, \
414 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING, pctldata }
415
416 #define CONTROLDEF_VSLIDER(id, cx, cy, pctldata) { WC_SLIDER, NULL, \
417 WS_VISIBLE | WS_TABSTOP | WS_GROUP | SLS_VERTICAL | SLS_PRIMARYSCALE1 \
418 | SLS_BUTTONSRIGHT | SLS_SNAPTOINCREMENT, \
419 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING, pctldata }
420
421 /* ******************************************************************
422 *
423 * Dialog formatter entry points
424 *
425 ********************************************************************/
426
427 #ifndef FCF_CLOSEBUTTON
428 #define FCF_CLOSEBUTTON 0x04000000L // toolkit 4 only
429 #endif
430
431 #define FCF_FIXED_DLG FCF_TITLEBAR | FCF_SYSMENU | FCF_DLGBORDER | FCF_NOBYTEALIGN | FCF_CLOSEBUTTON
432 #define FCF_SIZEABLE_DLG FCF_TITLEBAR | FCF_SYSMENU | FCF_SIZEBORDER | FCF_NOBYTEALIGN | FCF_CLOSEBUTTON
433
434 APIRET XWPENTRY dlghCreateDlg(HWND *phwndDlg,
435 HWND hwndOwner,
436 ULONG flCreateFlags,
437 PFNWP pfnwpDialogProc,
438 PCSZ pcszDlgTitle,
439 PCDLGHITEM paDlgItems,
440 ULONG cDlgItems,
441 PVOID pCreateParams,
442 PCSZ pcszControlsFont);
443 typedef APIRET XWPENTRY DLGHCREATEDLG(HWND *phwndDlg,
444 HWND hwndOwner,
445 ULONG flCreateFlags,
446 PFNWP pfnwpDialogProc,
447 PCSZ pcszDlgTitle,
448 PCDLGHITEM paDlgItems,
449 ULONG cDlgItems,
450 PVOID pCreateParams,
451 PCSZ pcszControlsFont);
452 typedef DLGHCREATEDLG *PDLGHCREATEDLG;
453
454 #define DFFL_CREATECONTROLS 0x0002
455
456 APIRET dlghFormatDlg(HWND hwndDlg,
457 PCDLGHITEM paDlgItems,
458 ULONG cDlgItems,
459 PCSZ pcszControlsFont,
460 ULONG flFlags,
461 PSIZEL pszlClient,
462 PVOID *ppllControls);
463
464 VOID dlghResizeFrame(HWND hwndDlg,
465 PSIZEL pszlClient);
466
467 /* ******************************************************************
468 *
469 * Dialog arrays
470 *
471 ********************************************************************/
472
473 /*
474 *@@ DLGARRAY:
475 * dialog array structure used with dlghCreateArray.
476 * See remarks there.
477 *
478 *@@added V0.9.16 (2001-10-15) [umoeller]
479 */
480
481 typedef struct _DLGARRAY
482 {
483 DLGHITEM *paDlgItems; // array of DLGHITEM's, allocated once
484 // by dlghCreateArray
485 ULONG cDlgItemsMax, // copied from dlghCreateArray
486 cDlgItemsNow; // initially 0, raised after each
487 // dlghAppendToArray; pass this to the
488 // dialog formatter
489 } DLGARRAY, *PDLGARRAY;
490
491 APIRET dlghCreateArray(ULONG cMaxItems, PDLGARRAY *ppArray);
492 typedef APIRET DLGHCREATEARRAY(ULONG cMaxItems, PDLGARRAY *ppArray);
493 typedef DLGHCREATEARRAY *PDLGHCREATEARRAY;
494
495 APIRET dlghFreeArray(PDLGARRAY *ppArray);
496 typedef APIRET DLGHFREEARRAY(PDLGARRAY *ppArray);
497 typedef DLGHFREEARRAY *PDLGHFREEARRAY;
498
499 APIRET dlghAppendToArray(PDLGARRAY pArray,
500 PCDLGHITEM paItems,
501 ULONG cItems);
502 typedef APIRET DLGHAPPENDTOARRAY(PDLGARRAY pArray,
503 PCDLGHITEM paItems,
504 ULONG cItems);
505 typedef DLGHAPPENDTOARRAY *PDLGHAPPENDTOARRAY;
506
507 /* ******************************************************************
508 *
509 * Standard dialogs
510 *
511 ********************************************************************/
512
513 /*
514 *@@ MSGBOXSTRINGS:
515 *
516 *@@added V0.9.13 (2001-06-21) [umoeller]
517 */
518
519 typedef struct _MSGBOXSTRINGS
520 {
521 const char *pcszYes, // "~Yes"
522 *pcszNo, // "~No"
523 *pcszOK, // "~OK"
524 *pcszCancel, // "~Cancel"
525 *pcszAbort, // "~Abort"
526 *pcszRetry, // "~Retry"
527 *pcszIgnore, // "~Ignore"
528 *pcszEnter, // "~Help"
529 *pcszYesToAll, // "Yes to ~all"
530 *pcszHelp; // "~Help"
531 } MSGBOXSTRINGS, *PMSGBOXSTRINGS;
532
533 /* the following are in os2.h somewhere:
534 #define MB_OK 0x0000
535 #define MB_OKCANCEL 0x0001
536 #define MB_RETRYCANCEL 0x0002
537 #define MB_ABORTRETRYIGNORE 0x0003
538 #define MB_YESNO 0x0004
539 #define MB_YESNOCANCEL 0x0005
540 #define MB_CANCEL 0x0006
541 #define MB_ENTER 0x0007
542 #define MB_ENTERCANCEL 0x0008 */
543 // we add:
544 #define MB_YES_YES2ALL_NO 0x0009
545
546 /* the following are in os2.h somewhere:
547 #define MBID_OK 1
548 #define MBID_CANCEL 2
549 #define MBID_ABORT 3
550 #define MBID_RETRY 4
551 #define MBID_IGNORE 5
552 #define MBID_YES 6
553 #define MBID_NO 7
554 #define MBID_HELP 8
555 #define MBID_ENTER 9 */
556 // we add:
557 #define MBID_YES2ALL 10
558
559 typedef VOID APIENTRY FNHELP(HWND hwndDlg);
560 typedef FNHELP *PFNHELP;
561
562 APIRET dlghCreateMessageBox(HWND *phwndDlg,
563 HWND hwndOwner,
564 HPOINTER hptrIcon,
565 PCSZ pcszTitle,
566 PCSZ pcszMessage,
567 PFNHELP pfnHelp,
568 ULONG flFlags,
569 PCSZ pcszFont,
570 const MSGBOXSTRINGS *pStrings,
571 PULONG pulAlarmFlag);
572
573 ULONG dlghMessageBox(HWND hwndOwner,
574 HPOINTER hptrIcon,
575 PCSZ pcszTitle,
576 PCSZ pcszMessage,
577 PFNHELP pfnHelp,
578 ULONG flFlags,
579 PCSZ pcszFont,
580 const MSGBOXSTRINGS *pStrings);
581
582 #define TEBF_REMOVETILDE 0x0001
583 #define TEBF_REMOVEELLIPSE 0x0002
584 #define TEBF_SELECTALL 0x0004
585
586 PSZ dlghTextEntryBox(HWND hwndOwner,
587 PCSZ pcszTitle,
588 PCSZ pcszDescription,
589 PCSZ pcszDefault,
590 PCSZ pcszOK,
591 PCSZ pcszCancel,
592 ULONG ulMaxLen,
593 ULONG fl,
594 PCSZ pcszFont);
595
596 /* ******************************************************************
597 *
598 * Dialog input handlers
599 *
600 ********************************************************************/
601
602 VOID dlghSetPrevFocus(PVOID pvllWindows);
603
604 VOID dlghSetNextFocus(PVOID pvllWindows);
605
606 HWND dlghProcessMnemonic(PVOID pvllWindows,
607 USHORT usch);
608
609 BOOL dlghEnter(PVOID pvllWindows);
610
611#endif
612
613#if __cplusplus
614}
615#endif
616
Note: See TracBrowser for help on using the repository browser.