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