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

Last change on this file since 200 was 198, checked in by umoeller, 23 years ago

More fixes.

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