00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _ADVDIALOGS_H
00025 #define _ADVDIALOGS_H
00026
00027
00037
00038 #include <alloc.h>
00039 #include <asmtypes.h>
00040 #include <compat.h>
00041 #include <ctype.h>
00042 #include <graph.h>
00043 #include <intr.h>
00044 #include <kbd.h>
00045 #include <string.h>
00046 #include <system.h>
00047
00048
00049
00050 #define TXTSTART 35
00051
00052 #define NEXTTAB -2
00053
00055 #define GRAYPLANES GrayGetPlane(DARK_PLANE), GrayGetPlane(LIGHT_PLANE)
00056
00057
00058
00059
00060
00061
00063 enum _inputModes
00064 {
00066 INPUT_STR,
00068 INPUT_INT
00069 };
00070
00072 enum _textAttributes
00073 {
00075 TXT_STANDARD,
00077 TXT_ALIGNRIGHT,
00079 TXT_CENTERED
00080 };
00081
00083 enum _buttonTypes
00084 {
00086 B_NONE = 0,
00088 B_OK,
00090 B_ESC,
00092 B_YES,
00094 B_NO,
00095 };
00096
00097
00098
00099
00101 typedef unsigned char uchar;
00102
00103
00104
00105
00106
00108 typedef struct
00109 {
00111 uchar element;
00113 char text[50];
00115 uchar color;
00117 char *inputbuffer;
00119 const char **itemlist;
00121 short *selected;
00123 short inputsize;
00125 uchar flag;
00126 }
00127 ADVEL;
00128
00130 typedef struct
00131 {
00133 short x;
00135 short y;
00137 BITMAP *data;
00138 }
00139 ADVBITMAP;
00140
00142 typedef struct
00143 {
00145 ADVEL elements[6];
00147 ADVBITMAP *bitmaps[6];
00149 uchar numbitmaps;
00151 uchar numelements;
00153 char title[40];
00154 }
00155 ADVTAB;
00156
00158 typedef struct
00159 {
00161 ADVTAB tabs[6];
00163 uchar numtabs;
00165 char title[50];
00167 short left_x;
00169 short top_y;
00171 short right_x;
00173 short bottom_y;
00175 uchar buttons[2];
00177 BOOL savescreen;
00179 INT_HANDLER inthandler;
00180 }
00181 ADVDIALOG;
00182
00183
00184
00185
00186
00188 extern BOOL AD_CHECKED[6][6];
00189
00190
00191
00192
00193
00205 ADVDIALOG *AdvDlgNew(short width, short height, const char *title, BOOL savescreen);
00206
00213 void AdvDlgAddTab(ADVDIALOG *dialog, uchar tab, const char *title);
00214
00225 void AdvDlgAddText(ADVDIALOG *dialog, uchar tab, uchar line, const char *text, uchar attr, uchar color);
00226
00239 void AdvDlgAddInputBox(ADVDIALOG *dialog, uchar tab, uchar line, const char *text, char *buffer, short maxsize, uchar mode, uchar color);
00240
00250 void AdvDlgAddCheckBox(ADVDIALOG *dialog, uchar tab, uchar line, const char *text, BOOL checked, uchar color);
00251
00263 void AdvDlgAddDropDown(ADVDIALOG *dialog, uchar tab, uchar line, const char *text, const char **itemlist, short numitems, short *selected, uchar color);
00264
00272 void AdvDlgAddButton(ADVDIALOG *dialog, uchar pos, uchar button);
00273
00285 char AdvDlgAddBitmap(ADVDIALOG *dialog, uchar tab, short x, short y, ADVBITMAP *bitmap);
00286
00294 ADVBITMAP *AdvDlgBitmapNew(short width, short height, const unsigned char *lpdata, const unsigned char *dpdata);
00295
00302 BOOL AdvDlgDo(ADVDIALOG *dialog, INT_HANDLER tempint1);
00303
00310 void AdvDlgFree(ADVDIALOG *dialog);
00311
00312
00324 short AdvDlgMessageBox(const char *title, const char *msg, uchar textcolor, uchar button, INT_HANDLER tempint1);
00325
00326
00327
00328
00329
00337 void AdvDlgProgressBar(const char *title, const char *msg, short steps);
00338
00346 void AdvDlgProgressUp(void);
00347
00348
00349
00350
00351
00359 void SaveScreen(void);
00360
00370 void GrayDrawColorString(short x, short y, const char *str, uchar color, uchar mode);
00371
00379 void RestoreScreen(void);
00380
00385 void ClearKbdQueue(void);
00386
00391 void GetKey(void *kbq, short *key);
00392
00393
00394
00395
00396
00398 #define ADVDLG_VERSION_STR "1.0.7"
00399
00400
00401 #endif
00402
00403
00404