-
Notifications
You must be signed in to change notification settings - Fork 15
/
dialbox.h
55 lines (44 loc) · 1.44 KB
/
dialbox.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* ----------------- dialbox.h ---------------- */
#ifndef DIALOG_H
#define DIALOG_H
#include <stdio.h>
#define MAXCONTROLS 30
#define MAXRADIOS 20
#define OFF FALSE
#define ON TRUE
/* -------- dialog box and control window structure ------- */
typedef struct {
char *title; /* window title */
int x, y; /* relative coordinates */
int h, w; /* size */
} DIALOGWINDOW;
/* ------ one of these for each control window ------- */
typedef struct {
DIALOGWINDOW dwnd;
CLASS Class; /* LISTBOX, BUTTON, etc */
char *itext; /* initialized text */
int command; /* command code */
char *help; /* help mnemonic */
BOOL isetting; /* initially ON or OFF */
BOOL setting; /* ON or OFF */
void *wnd; /* window handle */
} CTLWINDOW;
/* --------- one of these for each dialog box ------- */
typedef struct {
char *HelpName;
DIALOGWINDOW dwnd;
CTLWINDOW ctl[MAXCONTROLS+1];
} DBOX;
/* -------- macros for dialog box resource compile -------- */
#define DIALOGBOX(db) DBOX db={ #db,
#define DB_TITLE(ttl,x,y,h,w) {ttl,x,y,h,w},{
#define CONTROL(ty,tx,x,y,h,w,c) \
{{NULL,x,y,h,w},ty, \
(ty==EDITBOX||ty==COMBOBOX?NULL:tx), \
c,#c,(ty==BUTTON?ON:OFF),OFF,NULL},
#define ENDDB {{NULL}} }};
#define Cancel " Cancel "
#define Ok " OK "
#define Yes " Yes "
#define No " No "
#endif