]> git.sur5r.net Git - cc65/blob - include/geos/gdlgbox.h
new MessageBox function
[cc65] / include / geos / gdlgbox.h
1 /*
2   GEOS dialog box functions
3
4   by Maciej 'YTM/Elysium' Witkowiak
5   26.12.1999, 10.03.2000, 17.8.2003
6 */
7
8 #ifndef _GDLGBOX_H
9 #define _GDLGBOX_H
10
11 char __fastcall__ DoDlgBox(const char *dboxstring);
12 char __fastcall__ RstrFrmDialogue(void);
13
14 /* These are custom, predefined dialog boxes, I'm sure you'll find them usable
15    Most of them show 2 lines of text                                            */
16
17 char __fastcall__ DlgBoxYesNo(const char *line1, const char *line2);
18 char __fastcall__ DlgBoxOkCancel(const char *line1, const char *line2);
19 void __fastcall__ DlgBoxOk(const char *line1, const char *line2);
20 char __fastcall__ DlgBoxGetString(char *myString, char strLength,
21                                   const char *line1, const char *line2);
22 char __fastcall__ DlgBoxFileSelect(const char *classtxt, char ftype,
23                                    char *fname);
24
25 /* This is a more general dialog box, works like printf in a window */
26 char MessageBox(char mode, const char *format, ...);
27
28 /* mode argument for MessageBox() */
29 enum {
30     MB_EMPTY=0,
31     MB_OK,
32     MB_OKCANCEL,
33     MB_YESNO,
34     MB_LAST };
35
36 /* Now the command string type */
37
38 typedef void dlgBoxStr;
39
40 /* and command string commands - macros */
41
42 #define DB_DEFPOS(pattern) (char)(DEF_DB_POS | (pattern))
43 #define DB_SETPOS(pattern,top,bot,left,right) \
44         (char)(SET_DB_POS | (pattern)), (char)(top), (char)(bot), \
45         (unsigned)(left), (unsigned)(right)
46 #define DB_ICON(i,x,y)  (char)(i), (char)(x), (char)(y)
47 #define DB_TXTSTR(x,y,text) (char)DBTXTSTR, (char)(x), (char)(y), (text)
48 #define DB_VARSTR(x,y,ptr) (char)DBVARSTR, (char)(x), (char)(y), (char)(ptr)
49 #define DB_GETSTR(x,y,ptr,length) (char)DBGETSTRING, (char)(x), (char)(y), (char)(ptr), (char)(length)
50 #define DB_SYSOPV(ptr) (char)DBSYSOPV, (unsigned)(ptr)
51 #define DB_GRPHSTR(ptr) (char)DBGRPHSTR, (unsigned)(ptr)
52 #define DB_GETFILES(x,y) (char)DBGETFILES, (char)(x), (char)(y)
53 #define DB_OPVEC(ptr) (char)DBOPVEC, (unsigned)(ptr)
54 #define DB_USRICON(x,y,ptr) (char)DBUSRICON, (char)(x), (char)(y), (unsigned)(ptr)
55 #define DB_USRROUT(ptr) (char)DB_USR_ROUT, (unsigned)(ptr)
56 #define DB_END (char)NULL
57
58 /*
59   part of constants below is used internally, but some are useful for macros above
60 */
61
62 /* icons for DB_ICON */
63 #define OK              1
64 #define CANCEL          2
65 #define YES             3
66 #define NO              4
67 #define OPEN            5
68 #define DISK            6
69 /* commands - internally used by command macros */
70 #define DBTXTSTR        11
71 #define DBVARSTR        12
72 #define DBGETSTRING     13
73 #define DBSYSOPV        14
74 #define DBGRPHSTR       15
75 #define DBGETFILES      16
76 #define DBOPVEC         17
77 #define DBUSRICON       18
78 #define DB_USR_ROUT     19
79 /* icons tabulation in standard window */
80 #define DBI_X_0         1
81 #define DBI_X_1         9
82 #define DBI_X_2         17
83 #define DBI_Y_0         8
84 #define DBI_Y_1         40
85 #define DBI_Y_2         72
86 /* standard window size defaults */
87 #define SET_DB_POS      0
88 #define DEF_DB_POS      0x80
89 #define DEF_DB_TOP      32
90 #define DEF_DB_BOT      127
91 #define DEF_DB_LEFT     64
92 #define DEF_DB_RIGHT    255
93 /* text tabulation in standard window */
94 #define TXT_LN_1_Y      16
95 #define TXT_LN_2_Y      32
96 #define TXT_LN_3_Y      48
97 #define TXT_LN_4_Y      64
98 #define TXT_LN_5_Y      80
99 #define TXT_LN_X        16
100 /* system icons size */
101 #define SYSDBI_HEIGHT   16
102 #define SYSDBI_WIDTH    6
103 /* dialogbox string offsets */
104 #define OFF_DB_FORM     0
105 #define OFF_DB_TOP      1
106 #define OFF_DB_BOT      2
107 #define OFF_DB_LEFT     3
108 #define OFF_DB_RIGHT    5
109 #define OFF_DB_1STCMD   7
110
111 #endif
112