update for HEAD-2003091401
[reactos.git] / include / dflat32 / dflat.h
1 /* ------------- dflat.h ----------- */
2 #ifndef DFLAT_H
3 #define DFLAT_H
4
5 /* #ifdef BUILD_FULL_DFLAT */
6 #define INCLUDE_MULTI_WINDOWS
7 #define INCLUDE_LOGGING
8 #define INCLUDE_SHELLDOS
9 #define INCLUDE_WINDOWOPTIONS
10 #define INCLUDE_PICTUREBOX
11 #define INCLUDE_MINIMIZE
12 #define INCLUDE_MAXIMIZE
13 #define INCLUDE_RESTORE
14 #define INCLUDE_EXTENDEDSELECTIONS
15 /* #endif */
16
17 #include <windows.h>
18 #include <stdio.h>
19 #include <string.h>
20 #include <stdlib.h>
21 #include <dos.h>
22 #include <process.h>
23 #include <conio.h>
24 #include <ctype.h>
25 #include <io.h>
26 #include <sys\types.h>
27 #include <sys\stat.h>
28 #include <time.h>
29 #include <setjmp.h>
30
31 #ifndef VERSION
32 #define VERSION "Beta Version 0.3"
33 #endif
34
35 void *DFcalloc(size_t, size_t);
36 void *DFmalloc(size_t);
37 void *DFrealloc(void *, size_t);
38
39
40 #define MAXMESSAGES 50
41 #define DELAYTICKS 1
42 #define FIRSTDELAY 7
43 #define DOUBLETICKS 5
44
45 #define MAXTEXTLEN 65000U /* maximum text buffer            */
46 #define EDITLEN     1024  /* starting length for multiliner */
47 #define ENTRYLEN     256  /* starting length for one-liner  */
48 #define GROWLENGTH    64  /* buffers grow by this much      */
49
50 #include "system.h"
51 #include "config.h"
52 #include "rect.h"
53 #include "menu.h"
54 #include "keys.h"
55 #include "commands.h"
56 #include "dialbox.h"
57
58 /* ------ integer type for message parameters ----- */
59 typedef long PARAM;
60
61 enum Condition
62 {
63     ISRESTORED, ISMINIMIZED, ISMAXIMIZED, ISCLOSING
64 };
65
66 typedef struct window
67 {
68         DFCLASS class;          /* window class                  */
69         char *title;            /* window title                  */
70         int (*wndproc)(struct window *, enum messages, PARAM, PARAM);
71
72         /* ----------------- window colors -------------------- */
73         char WindowColors[4][2];
74
75         /* ---------------- window dimensions ----------------- */
76         DFRECT rc;              /* window coordinates (0/0 to 79/24) */
77         int ht, wd;             /* window height and width       */
78         DFRECT RestoredRC;      /* restored condition rect       */
79
80         /* -------------- linked list pointers ---------------- */
81         struct window *parent;      /* parent window            */
82         struct window *firstchild;  /* first child this parent  */
83         struct window *lastchild;   /* last child this parent   */
84         struct window *nextsibling; /* next sibling             */
85         struct window *prevsibling; /* previous sibling         */
86         struct window *childfocus;      /* child that ha(s/d) focus */
87
88         int attrib;                 /* Window attributes        */
89         PCHAR_INFO videosave;       /* video save buffer        */
90         enum Condition condition;   /* Restored, Maximized,
91                                        Minimized, Closing       */
92         enum Condition oldcondition;/* previous condition       */
93         int restored_attrib;        /* attributes when restored */
94         void *extension;      /* menus, dialogs, documents, etc */
95         struct window *PrevMouse;
96         struct window *PrevKeyboard;
97         struct window *MenuBarWnd;/* menu bar                   */
98         struct window *StatusBar; /* status bar                 */
99         int isHelping;          /* > 0 when help is being displayed */
100
101         /* ----------------- text box fields ------------------ */
102         int wlines;     /* number of lines of text              */
103         int wtop;       /* text line that is on the top display */
104         unsigned char *text; /* window text                     */
105         unsigned int textlen;  /* text length                   */
106         int wleft;      /* left position in window viewport     */
107         int textwidth;  /* width of longest line in textbox     */
108         int BlkBegLine; /* beginning line of marked block       */
109         int BlkBegCol;  /* beginning column of marked block     */
110         int BlkEndLine; /* ending line of marked block          */
111         int BlkEndCol;  /* ending column of marked block        */
112         int HScrollBox; /* position of horizontal scroll box    */
113         int VScrollBox; /* position of vertical scroll box      */
114         unsigned int *TextPointers; /* -> list of line offsets  */
115
116         /* ----------------- list box fields ------------------ */
117         int selection;  /* current selection                    */
118         BOOL AddMode;   /* adding extended selections mode      */
119         int AnchorPoint;/* anchor point for extended selections */
120         int SelectCount;/* count of selected items              */
121
122         /* ----------------- edit box fields ------------------ */
123         int CurrCol;      /* Current column                     */
124         int CurrLine;     /* Current line                       */
125         int WndRow;       /* Current window row                 */
126         BOOL TextChanged; /* TRUE if text has changed           */
127         unsigned char *DeletedText; /* for undo                 */
128         unsigned DeletedLength; /* Length of deleted field      */
129         BOOL InsertMode;   /* TRUE or FALSE for text insert     */
130         BOOL WordWrapMode; /* TRUE or FALSE for word wrap       */
131         unsigned int MaxTextLength; /* maximum text length      */
132
133         /* ---------------- dialog box fields ----------------- */
134         int ReturnCode;         /* return code from a dialog box */
135         BOOL Modal;             /* True if a modeless dialog box */
136         CTLWINDOW *ct;          /* control structure             */
137         struct window *dfocus;  /* control window that has focus */
138         /* -------------- popdownmenu fields ------------------ */
139         MENU *mnu;              /* points to menu structure             */
140         MBAR *holdmenu;         /* previous active menu                 */
141         struct window *oldFocus;
142
143         /* --------------- help box fields -------------------- */
144         void *firstword; /* -> first in list of key words       */
145         void *lastword;  /* -> last in list of key words        */
146         void *thisword;  /* -> current in list of key words     */
147         /* -------------- status bar fields ------------------- */
148         BOOL TimePosted; /* True if time has been posted        */
149 #ifdef INCLUDE_PICTUREBOX
150         /* ------------- picture box fields ------------------- */
151         int VectorCount;  /* number of vectors in vector list   */
152         void *VectorList; /* list of picture box vectors        */
153 #endif
154 } * DFWINDOW;
155
156 #include "classdef.h"
157 #include "video.h"
158
159 void LogMessages (DFWINDOW, DFMESSAGE, PARAM, PARAM);
160 void MessageLog(DFWINDOW);
161 /* ------- window methods ----------- */
162 #define ICONHEIGHT 3
163 #define ICONWIDTH  10
164 #define WindowHeight(w)      ((w)->ht)
165 #define WindowWidth(w)       ((w)->wd)
166 #define BorderAdj(w)         (TestAttribute(w,HASBORDER)?1:0)
167 #define BottomBorderAdj(w)   (TestAttribute(w,HASSTATUSBAR)?1:BorderAdj(w))
168 #define TopBorderAdj(w)      ((TestAttribute(w,HASTITLEBAR) &&   \
169                               TestAttribute(w,HASMENUBAR)) ?  \
170                               2 : (TestAttribute(w,HASTITLEBAR | \
171                               HASMENUBAR | HASBORDER) ? 1 : 0))
172 #define ClientWidth(w)       (WindowWidth(w)-BorderAdj(w)*2)
173 #define ClientHeight(w)      (WindowHeight(w)-TopBorderAdj(w)-\
174                               BottomBorderAdj(w))
175 #define WindowRect(w)        ((w)->rc)
176 #define GetTop(w)            (RectTop(WindowRect(w)))
177 #define GetBottom(w)         (RectBottom(WindowRect(w)))
178 #define GetLeft(w)           (RectLeft(WindowRect(w)))
179 #define GetRight(w)          (RectRight(WindowRect(w)))
180 #define GetClientTop(w)      (GetTop(w)+TopBorderAdj(w))
181 #define GetClientBottom(w)   (GetBottom(w)-BottomBorderAdj(w))
182 #define GetClientLeft(w)     (GetLeft(w)+BorderAdj(w))
183 #define GetClientRight(w)    (GetRight(w)-BorderAdj(w))
184 #define GetTitle(w)          ((w)->title)
185 #define GetParent(w)         ((w)->parent)
186 #define FirstWindow(w)       ((w)->firstchild)
187 #define LastWindow(w)        ((w)->lastchild)
188 #define NextWindow(w)        ((w)->nextsibling)
189 #define PrevWindow(w)        ((w)->prevsibling)
190 #define GetClass(w)          ((w)->class)
191 #define GetAttribute(w)      ((w)->attrib)
192 #define AddAttribute(w,a)    (GetAttribute(w) |= a)
193 #define ClearAttribute(w,a)  (GetAttribute(w) &= ~(a))
194 #define TestAttribute(w,a)   (GetAttribute(w) & (a))
195 #define isHidden(w)          (!(GetAttribute(w) & VISIBLE))
196 #define SetVisible(w)        (GetAttribute(w) |= VISIBLE)
197 #define ClearVisible(w)      (GetAttribute(w) &= ~VISIBLE)
198 #define gotoxy(w,x,y) cursor(w->rc.lf+(x)+1,w->rc.tp+(y)+1)
199 BOOL isVisible(DFWINDOW);
200 DFWINDOW DfCreateWindow(DFCLASS,char *,int,int,int,int,void*,DFWINDOW,
201        int (*)(struct window *,enum messages,PARAM,PARAM),int);
202 void AddTitle(DFWINDOW, char *);
203 void InsertTitle(DFWINDOW, char *);
204 void DisplayTitle(DFWINDOW, DFRECT *);
205 void RepaintBorder(DFWINDOW, DFRECT *);
206 void PaintShadow(DFWINDOW);
207 void ClearWindow(DFWINDOW, DFRECT *, int);
208 void writeline(DFWINDOW, char *, int, int, BOOL);
209 void InitWindowColors(DFWINDOW);
210
211 void SetNextFocus(void);
212 void SetPrevFocus(void);
213 void RemoveWindow(DFWINDOW);
214 void AppendWindow(DFWINDOW);
215 void ReFocus(DFWINDOW);
216 void SkipApplicationControls(void);
217
218 BOOL CharInView(DFWINDOW, int, int);
219 void CreatePath(char *, char *, int, int);
220 #define SwapVideoBuffer(wnd, ish, fh) swapvideo(wnd, wnd->videosave, ish, fh)
221 int LineLength(char *);
222 DFRECT AdjustRectangle(DFWINDOW, DFRECT);
223 BOOL isDerivedFrom(DFWINDOW, DFCLASS);
224 DFWINDOW GetAncestor(DFWINDOW);
225 void PutWindowChar(DFWINDOW,char,int,int);
226 void PutWindowLine(DFWINDOW, void *,int,int);
227 #define BaseWndProc(class,wnd,msg,p1,p2)    \
228     (*classdefs[(classdefs[class].base)].wndproc)(wnd,msg,p1,p2)
229 #define DefaultWndProc(wnd,msg,p1,p2)         \
230         (classdefs[wnd->class].wndproc == NULL) ? \
231         BaseWndProc(wnd->class,wnd,msg,p1,p2) :   \
232     (*classdefs[wnd->class].wndproc)(wnd,msg,p1,p2)
233 struct LinkedList    {
234     DFWINDOW FirstWindow;
235     DFWINDOW LastWindow;
236 };
237 extern DFWINDOW ApplicationWindow;
238 extern DFWINDOW inFocus;
239 extern DFWINDOW CaptureMouse;
240 extern DFWINDOW CaptureKeyboard;
241 extern int foreground, background;
242 extern BOOL WindowMoving;
243 extern BOOL WindowSizing;
244 extern BOOL VSliding;
245 extern BOOL HSliding;
246 extern char DFlatApplication[];
247 extern char *Clipboard;
248 extern unsigned ClipboardLength;
249 extern BOOL ClipString;
250 /* --------- space between menubar labels --------- */
251 #define MSPACE 2
252 /* --------------- border characters ------------- */
253 #define FOCUS_NW      (unsigned char) '\xc9'
254 #define FOCUS_NE      (unsigned char) '\xbb'
255 #define FOCUS_SE      (unsigned char) '\xbc'
256 #define FOCUS_SW      (unsigned char) '\xc8'
257 #define FOCUS_SIDE    (unsigned char) '\xba'
258 #define FOCUS_LINE    (unsigned char) '\xcd'
259 #define NW            (unsigned char) '\xda'
260 #define NE            (unsigned char) '\xbf'
261 #define SE            (unsigned char) '\xd9'
262 #define SW            (unsigned char) '\xc0'
263 #define SIDE          (unsigned char) '\xb3'
264 #define LINE          (unsigned char) '\xc4'
265 #define LEDGE         (unsigned char) '\xc3'
266 #define REDGE         (unsigned char) '\xb4'
267 /* ------------- scroll bar characters ------------ */
268 #define UPSCROLLBOX    (unsigned char) '\x1e'
269 #define DOWNSCROLLBOX  (unsigned char) '\x1f'
270 #define LEFTSCROLLBOX  (unsigned char) '\x11'
271 #define RIGHTSCROLLBOX (unsigned char) '\x10'
272 #define SCROLLBARCHAR  (unsigned char) 176
273 #define SCROLLBOXCHAR  (unsigned char) 178
274 /* ------------------ menu characters --------------------- */
275 #define CHECKMARK      (unsigned char) '\x04' /* (SCREENHEIGHT==25?251:4) */
276 #define CASCADEPOINTER (unsigned char) '\x10'
277 /* ----------------- title bar characters ----------------- */
278 #define CONTROLBOXCHAR (unsigned char) '\xf0'
279 #define MAXPOINTER     24      /* maximize token            */
280 #define MINPOINTER     25      /* minimize token            */
281 #define RESTOREPOINTER 18      /* restore token             */
282 /* --------------- text control characters ---------------- */
283 #define APPLCHAR     (unsigned char) 176 /* fills application window */
284 #define SHORTCUTCHAR '~'    /* prefix: shortcut key display */
285 #define CHANGECOLOR  (unsigned char) 174 /* prefix to change colors  */
286 #define RESETCOLOR   (unsigned char) 175 /* reset colors to default  */
287 #define LISTSELECTOR   4    /* selected list box entry      */
288
289 /* --------- message prototypes ----------- */
290 BOOL DfInitialize (void);
291 void DfTerminate (void);
292 void DfPostMessage (DFWINDOW, DFMESSAGE, PARAM, PARAM);
293 int DfSendMessage (DFWINDOW, DFMESSAGE, PARAM, PARAM);
294 BOOL DfDispatchMessage (void);
295 void handshake(void);
296 SHORT DfGetScreenHeight (void);
297 SHORT DfGetScreenWidth (void);
298
299 /* ---- standard window message processing prototypes ----- */
300 int ApplicationProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
301 int NormalProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
302 int TextBoxProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
303 int ListBoxProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
304 int EditBoxProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
305 int PictureProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
306 int MenuBarProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
307 int PopDownProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
308 int ButtonProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
309 int ComboProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
310 int TextProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
311 int RadioButtonProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
312 int CheckBoxProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
313 int SpinButtonProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
314 int BoxProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
315 int DialogProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
316 int SystemMenuProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
317 int HelpBoxProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
318 int MessageBoxProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
319 int CancelBoxProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
320 int ErrorBoxProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
321 int YesNoBoxProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
322 int StatusBarProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
323 int WatchIconProc(DFWINDOW, DFMESSAGE, PARAM, PARAM);
324
325 /* ------------- normal box prototypes ------------- */
326 void SetStandardColor(DFWINDOW);
327 void SetReverseColor(DFWINDOW);
328 BOOL isAncestor(DFWINDOW, DFWINDOW);
329 #define HitControlBox(wnd, p1, p2)     \
330      (TestAttribute(wnd, CONTROLBOX) && \
331      p1 == 2 && p2 == 0)
332 #define WndForeground(wnd)              \
333         (wnd->WindowColors [STD_COLOR] [FG])
334 #define WndBackground(wnd)              \
335         (wnd->WindowColors [STD_COLOR] [BG])
336 #define FrameForeground(wnd)    \
337         (wnd->WindowColors [FRAME_COLOR] [FG])
338 #define FrameBackground(wnd)    \
339         (wnd->WindowColors [FRAME_COLOR] [BG])
340 #define SelectForeground(wnd)   \
341         (wnd->WindowColors [SELECT_COLOR] [FG])
342 #define SelectBackground(wnd)   \
343         (wnd->WindowColors [SELECT_COLOR] [BG])
344 #define HighlightForeground(wnd)        \
345         (wnd->WindowColors [HILITE_COLOR] [FG])
346 #define HighlightBackground(wnd)        \
347         (wnd->WindowColors [HILITE_COLOR] [BG])
348 #define WindowClientColor(wnd, fg, bg)  \
349                 WndForeground(wnd) = fg, WndBackground(wnd) = bg
350 #define WindowReverseColor(wnd, fg, bg) \
351                 SelectForeground(wnd) = fg, SelectBackground(wnd) = bg
352 #define WindowFrameColor(wnd, fg, bg) \
353                 FrameForeground(wnd) = fg, FrameBackground(wnd) = bg
354 #define WindowHighlightColor(wnd, fg, bg) \
355                 HighlightForeground(wnd) = fg, HighlightBackground(wnd) = bg
356 /* -------- text box prototypes ---------- */
357 #define TextLine(wnd, sel) \
358       (wnd->text + *((wnd->TextPointers) + sel))
359 void WriteTextLine(DFWINDOW, DFRECT *, int, BOOL);
360 #define TextBlockMarked(wnd) (  wnd->BlkBegLine ||    \
361                                 wnd->BlkEndLine ||    \
362                                 wnd->BlkBegCol  ||    \
363                                 wnd->BlkEndCol)
364 void MarkTextBlock(DFWINDOW, int, int, int, int);
365 #define ClearTextBlock(wnd) wnd->BlkBegLine = wnd->BlkEndLine =  \
366                         wnd->BlkBegCol  = wnd->BlkEndCol = 0;
367 #define GetText(w)        ((w)->text)
368 #define GetTextLines(w)   ((w)->wlines)
369 void ClearTextPointers(DFWINDOW);
370 void BuildTextPointers(DFWINDOW);
371 int TextLineNumber(DFWINDOW, char *);
372 /* ------------ Clipboard prototypes ------------- */
373 void CopyTextToClipboard(char *);
374 void CopyToClipboard(DFWINDOW);
375 #define PasteFromClipboard(wnd) PasteText(wnd,Clipboard,ClipboardLength)
376 BOOL PasteText(DFWINDOW, char *, unsigned);
377 void ClearClipboard(void);
378 /* --------- menu prototypes ---------- */
379 int CopyCommand(unsigned char *, unsigned char *, int, int);
380 void PrepFileMenu(void *, struct Menu *);
381 void PrepEditMenu(void *, struct Menu *);
382 void PrepSearchMenu(void *, struct Menu *);
383 void PrepWindowMenu(void *, struct Menu *);
384 void BuildSystemMenu(DFWINDOW);
385 BOOL isActive(MBAR *, int);
386 char *GetCommandText(MBAR *, int);
387 BOOL isCascadedCommand(MBAR *,int);
388 void ActivateCommand(MBAR *,int);
389 void DeactivateCommand(MBAR *,int);
390 BOOL GetCommandToggle(MBAR *,int);
391 void SetCommandToggle(MBAR *,int);
392 void ClearCommandToggle(MBAR *,int);
393 void InvertCommandToggle(MBAR *,int);
394 int BarSelection(int);
395 /* ------------- list box prototypes -------------- */
396 BOOL ItemSelected(DFWINDOW, int);
397 /* ------------- edit box prototypes ----------- */
398 #define CurrChar (TextLine(wnd, wnd->CurrLine)+wnd->CurrCol)
399 #define WndCol   (wnd->CurrCol-wnd->wleft)
400 #define isMultiLine(wnd) TestAttribute(wnd, MULTILINE)
401 void DfSearchText(DFWINDOW);
402 void DfReplaceText(DFWINDOW);
403 void DfSearchNext(DFWINDOW);
404 /* --------- message box prototypes -------- */
405 DFWINDOW SliderBox(int, char *, char *);
406 BOOL InputBox(DFWINDOW, char *, char *, char *, int);
407 BOOL GenericMessage(DFWINDOW, char *, char *, int,
408         int (*)(struct window *, enum messages, PARAM, PARAM),
409         char *, char *, int, int, int);
410 #define DfTestErrorMessage(msg) \
411         GenericMessage(NULL, "Error", msg, 2, ErrorBoxProc,       \
412                 Ok, Cancel, ID_OK, ID_CANCEL, TRUE)
413 #define DfErrorMessage(msg) \
414         GenericMessage(NULL, "Error", msg, 1, ErrorBoxProc,   \
415                 Ok, NULL, ID_OK, 0, TRUE)
416 #define DfMessageBox(ttl, msg) \
417         GenericMessage(NULL, ttl, msg, 1, MessageBoxProc, \
418                 Ok, NULL, ID_OK, 0, TRUE)
419 #define DfYesNoBox(msg) \
420         GenericMessage(NULL, NULL, msg, 2, YesNoBoxProc,   \
421                 Yes, No, ID_OK, ID_CANCEL, TRUE)
422 #define DfCancelBox(wnd, msg) \
423         GenericMessage(wnd, "Wait...", msg, 1, CancelBoxProc, \
424                 Cancel, NULL, ID_CANCEL, 0, FALSE)
425 void CloseCancelBox(void);
426 DFWINDOW MomentaryMessage(char *);
427 int MsgHeight(char *);
428 int MsgWidth(char *);
429
430 /* ------------- dialog box prototypes -------------- */
431 BOOL DfDialogBox(DFWINDOW, DBOX *, BOOL,
432        int (*)(struct window *, enum messages, PARAM, PARAM));
433 void ClearDialogBoxes(void);
434 BOOL OpenFileDialogBox(char *, char *);
435 BOOL SaveAsDialogBox(char *);
436 void GetDlgListText(DFWINDOW, char *, enum commands);
437 BOOL DfDlgDirList(DFWINDOW, char *, enum commands,
438                             enum commands, unsigned);
439 BOOL RadioButtonSetting(DBOX *, enum commands);
440 void PushRadioButton(DBOX *, enum commands);
441 void PutItemText(DFWINDOW, enum commands, char *);
442 void PutComboListText(DFWINDOW, enum commands, char *);
443 void GetItemText(DFWINDOW, enum commands, char *, int);
444 char *GetDlgTextString(DBOX *, enum commands, DFCLASS);
445 void SetDlgTextString(DBOX *, enum commands, char *, DFCLASS);
446 BOOL CheckBoxSetting(DBOX *, enum commands);
447 CTLWINDOW *FindCommand(DBOX *, enum commands, int);
448 DFWINDOW ControlWindow(DBOX *, enum commands);
449 void SetScrollBars(DFWINDOW);
450 void SetRadioButton(DBOX *, CTLWINDOW *);
451 void ControlSetting(DBOX *, enum commands, int, int);
452 void SetFocusCursor(DFWINDOW);
453
454 #define GetControl(wnd)             (wnd->ct)
455 #define GetDlgText(db, cmd)         GetDlgTextString(db, cmd, TEXT)
456 #define GetDlgTextBox(db, cmd)      GetDlgTextString(db, cmd, TEXTBOX)
457 #define GetEditBoxText(db, cmd)     GetDlgTextString(db, cmd, EDITBOX)
458 #define GetComboBoxText(db, cmd)    GetDlgTextString(db, cmd, COMBOBOX)
459 #define SetDlgText(db, cmd, s)      SetDlgTextString(db, cmd, s, TEXT)
460 #define SetDlgTextBox(db, cmd, s)   SetDlgTextString(db, cmd, s, TEXTBOX)
461 #define SetEditBoxText(db, cmd, s)  SetDlgTextString(db, cmd, s, EDITBOX)
462 #define SetComboBoxText(db, cmd, s) SetDlgTextString(db, cmd, s, COMBOBOX)
463 #define SetDlgTitle(db, ttl)        ((db)->dwnd.title = ttl)
464 #define SetCheckBox(db, cmd)        ControlSetting(db, cmd, CHECKBOX, ON)
465 #define ClearCheckBox(db, cmd)      ControlSetting(db, cmd, CHECKBOX, OFF)
466 #define EnableButton(db, cmd)       ControlSetting(db, cmd, BUTTON, ON)
467 #define DisableButton(db, cmd)      ControlSetting(db, cmd, BUTTON, OFF)
468
469 /* ---- types of vectors that can be in a picture box ------- */
470 enum VectTypes {VECTOR, SOLIDBAR, HEAVYBAR, CROSSBAR, LIGHTBAR};
471
472 /* ------------- picture box prototypes ------------- */
473 void DrawVector(DFWINDOW, int, int, int, int);
474 void DrawBox(DFWINDOW, int, int, int, int);
475 void DrawBar(DFWINDOW, enum VectTypes, int, int, int, int);
476 DFWINDOW WatchIcon(void);
477
478 /* ------------- help box prototypes ------------- */
479 void LoadHelpFile(void);
480 void UnLoadHelpFile(void);
481 BOOL DisplayHelp(DFWINDOW, char *);
482
483 extern char *ClassNames[];
484
485 void BuildFileName(char *, char *);
486
487 #endif