adding missing dx headers
[reactos.git] / rosapps / 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 DF_VERSION
32 #define DF_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 DF_MAXMESSAGES 50
41 #define DF_DELAYTICKS 1
42 #define DF_FIRSTDELAY 7
43 #define DF_DOUBLETICKS 5
44
45 #define DF_MAXTEXTLEN 65000U /* maximum text buffer */
46 #define DF_EDITLEN 1024 /* starting length for multiliner */
47 #define DF_ENTRYLEN 256 /* starting length for one-liner */
48 #define DF_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 DF_PARAM;
60
61 enum DfCondition
62 {
63 DF_SRESTORED, DF_ISMINIMIZED, DF_ISMAXIMIZED, DF_ISCLOSING
64 };
65
66 typedef struct DfWindow
67 {
68 DFCLASS class; /* window class */
69 char *title; /* window title */
70 int (*wndproc)(struct DfWindow *, enum DfMessages, DF_PARAM, DF_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 DfWindow *parent; /* parent window */
82 struct DfWindow *firstchild; /* first child this parent */
83 struct DfWindow *lastchild; /* last child this parent */
84 struct DfWindow *nextsibling; /* next sibling */
85 struct DfWindow *prevsibling; /* previous sibling */
86 struct DfWindow *childfocus; /* child that ha(s/d) focus */
87
88 int attrib; /* Window attributes */
89 PCHAR_INFO videosave; /* video save buffer */
90 enum DfCondition condition; /* Restored, Maximized,
91 Minimized, Closing */
92 enum DfCondition oldcondition;/* previous condition */
93 int restored_attrib; /* attributes when restored */
94 void *extension; /* menus, dialogs, documents, etc */
95 struct DfWindow *PrevMouse;
96 struct DfWindow *PrevKeyboard;
97 struct DfWindow *MenuBarWnd;/* menu bar */
98 struct DfWindow *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 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 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 DF_CTLWINDOW *ct; /* control structure */
137 struct DfWindow *dfocus; /* control window that has focus */
138 /* -------------- popdownmenu fields ------------------ */
139 DF_MENU *mnu; /* points to menu structure */
140 DF_MBAR *holdmenu; /* previous active menu */
141 struct DfWindow *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 DfLogMessages (DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
160 void DfMessageLog(DFWINDOW);
161 /* ------- window methods ----------- */
162 #define DF_ICONHEIGHT 3
163 #define DF_ICONWIDTH 10
164 #define DfWindowHeight(w) ((w)->ht)
165 #define DfWindowWidth(w) ((w)->wd)
166 #define DfBorderAdj(w) (DfTestAttribute(w,DF_HASBORDER)?1:0)
167 #define DfBottomBorderAdj(w) (DfTestAttribute(w,DF_HASSTATUSBAR)?1:DfBorderAdj(w))
168 #define DfTopBorderAdj(w) ((DfTestAttribute(w,DF_HASTITLEBAR) && \
169 DfTestAttribute(w,DF_HASMENUBAR)) ? \
170 2 : (DfTestAttribute(w,DF_HASTITLEBAR | \
171 DF_HASMENUBAR | DF_HASBORDER) ? 1 : 0))
172 #define DfClientWidth(w) (DfWindowWidth(w)-DfBorderAdj(w)*2)
173 #define DfClientHeight(w) (DfWindowHeight(w)-DfTopBorderAdj(w)-\
174 DfBottomBorderAdj(w))
175 #define DfWindowRect(w) ((w)->rc)
176 #define DfGetTop(w) (DfRectTop(DfWindowRect(w)))
177 #define DfGetBottom(w) (DfRectBottom(DfWindowRect(w)))
178 #define DfGetLeft(w) (DfRectLeft(DfWindowRect(w)))
179 #define DfGetRight(w) (DfRectRight(DfWindowRect(w)))
180 #define DfGetClientTop(w) (DfGetTop(w)+DfTopBorderAdj(w))
181 #define DfGetClientBottom(w) (DfGetBottom(w)-DfBottomBorderAdj(w))
182 #define DfGetClientLeft(w) (DfGetLeft(w)+DfBorderAdj(w))
183 #define DfGetClientRight(w) (DfGetRight(w)-DfBorderAdj(w))
184 #define DfGetTitle(w) ((w)->title)
185 #define DfGetParent(w) ((w)->parent)
186 #define DfFirstWindow(w) ((w)->firstchild)
187 #define DfLastWindow(w) ((w)->lastchild)
188 #define DfNextWindow(w) ((w)->nextsibling)
189 #define DfPrevWindow(w) ((w)->prevsibling)
190 #define DfGetClass(w) ((w)->class)
191 #define DfGetAttribute(w) ((w)->attrib)
192 #define DfAddAttribute(w,a) (DfGetAttribute(w) |= a)
193 #define DfClearAttribute(w,a) (DfGetAttribute(w) &= ~(a))
194 #define DfTestAttribute(w,a) (DfGetAttribute(w) & (a))
195 #define isHidden(w) (!(DfGetAttribute(w) & DF_VISIBLE))
196 #define DfSetVisible(w) (DfGetAttribute(w) |= DF_VISIBLE)
197 #define DfClearVisible(w) (DfGetAttribute(w) &= ~DF_VISIBLE)
198 #define DfGotoXY(w,x,y) DfCursor(w->rc.lf+(x)+1,w->rc.tp+(y)+1)
199 BOOL DfIsVisible(DFWINDOW);
200 DFWINDOW DfDfCreateWindow(DFCLASS,char *,int,int,int,int,void*,DFWINDOW,
201 int (*)(struct DfWindow *,enum DfMessages,DF_PARAM,DF_PARAM),int);
202 void DfAddTitle(DFWINDOW, char *);
203 void DfInsertTitle(DFWINDOW, char *);
204 void DfDisplayTitle(DFWINDOW, DFRECT *);
205 void DfRepaintBorder(DFWINDOW, DFRECT *);
206 void DfPaintShadow(DFWINDOW);
207 void DfClearWindow(DFWINDOW, DFRECT *, int);
208 void DfWriteLine(DFWINDOW, char *, int, int, BOOL);
209 void DfInitWindowColors(DFWINDOW);
210
211 void DfSetNextFocus(void);
212 void DfSetPrevFocus(void);
213 void DfRemoveWindow(DFWINDOW);
214 void DfAppendWindow(DFWINDOW);
215 void DfReFocus(DFWINDOW);
216 void DfSkipApplicationControls(void);
217
218 BOOL DfCharInView(DFWINDOW, int, int);
219 void DfCreatePath(char *, char *, int, int);
220 #define DfSwapVideoBuffer(wnd, ish, fh) swapvideo(wnd, wnd->videosave, ish, fh)
221 int DfLineLength(char *);
222 DFRECT DfAdjustRectangle(DFWINDOW, DFRECT);
223 BOOL DfIsDerivedFrom(DFWINDOW, DFCLASS);
224 DFWINDOW DfGetAncestor(DFWINDOW);
225 void DfPutWindowChar(DFWINDOW,char,int,int);
226 void DfPutWindowLine(DFWINDOW, void *,int,int);
227 #define DfBaseWndProc(class,wnd,msg,p1,p2) \
228 (*DfClassDefs[(DfClassDefs[class].base)].wndproc)(wnd,msg,p1,p2)
229 #define DfDefaultWndProc(wnd,msg,p1,p2) \
230 (DfClassDefs[wnd->class].wndproc == NULL) ? \
231 DfBaseWndProc(wnd->class,wnd,msg,p1,p2) : \
232 (*DfClassDefs[wnd->class].wndproc)(wnd,msg,p1,p2)
233 struct DfLinkedList {
234 DFWINDOW DfFirstWindow;
235 DFWINDOW DfLastWindow;
236 };
237 extern DFWINDOW DfApplicationWindow;
238 extern DFWINDOW DfInFocus;
239 extern DFWINDOW DfCaptureMouse;
240 extern DFWINDOW DfCaptureKeyboard;
241 extern int DfForeground, DfBackground;
242 extern BOOL DfWindowMoving;
243 extern BOOL DfWindowSizing;
244 extern BOOL DfVSliding;
245 extern BOOL DfHSliding;
246 extern char DFlatApplication[];
247 extern char *DfClipboard;
248 extern unsigned DfClipboardLength;
249 extern BOOL DfClipString;
250 /* --------- space between menubar labels --------- */
251 #define DF_MSPACE 2
252 /* --------------- border characters ------------- */
253 #define DF_FOCUS_NW '\xc9'
254 #define DF_FOCUS_NE '\xbb'
255 #define DF_FOCUS_SE '\xbc'
256 #define DF_FOCUS_SW '\xc8'
257 #define DF_FOCUS_SIDE '\xba'
258 #define DF_FOCUS_LINE '\xcd'
259 #define DF_NW '\xda'
260 #define DF_NE '\xbf'
261 #define DF_SE '\xd9'
262 #define DF_SW '\xc0'
263 #define DF_SIDE '\xb3'
264 #define DF_LINE '\xc4'
265 #define DF_LEDGE '\xc3'
266 #define DF_REDGE '\xb4'
267 /* ------------- scroll bar characters ------------ */
268 #define DF_UPSCROLLBOX '\x1e'
269 #define DF_DOWNSCROLLBOX '\x1f'
270 #define DF_LEFTSCROLLBOX '\x11'
271 #define DF_RIGHTSCROLLBOX '\x10'
272 #define DF_SCROLLBARCHAR '\xb0'
273 #define DF_SCROLLBOXCHAR '\xb2'
274 /* ------------------ menu characters --------------------- */
275 #define DF_CHECKMARK '\x04' //(DF_SCREENHEIGHT==25?251:4)
276 #define DF_CASCADEPOINTER '\x10'
277 /* ----------------- title bar characters ----------------- */
278 #define DF_CONTROLBOXCHAR '\xf0'
279 #define DF_MAXPOINTER '\x18' /* maximize token */
280 #define DF_MINPOINTER '\x19' /* minimize token */
281 #define DF_RESTOREPOINTER '\x12' /* restore token */
282 /* --------------- text control characters ---------------- */
283 #define DF_APPLCHAR '\xb0' /* fills application window */
284 #define DF_SHORTCUTCHAR '~' /* prefix: shortcut key display */
285 #define DF_CHANGECOLOR '\xae' /* prefix to change colors */
286 #define DF_RESETCOLOR '\xaf' /* reset colors to default */
287 #define DF_LISTSELECTOR 4 /* selected list box entry */
288
289 /* --------- message prototypes ----------- */
290 BOOL DfInitialize (void);
291 void DfTerminate (void);
292 void DfPostMessage (DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
293 int DfSendMessage (DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
294 BOOL DfDispatchMessage (void);
295 void DfHandshake(void);
296 SHORT DfGetScreenHeight (void);
297 SHORT DfGetScreenWidth (void);
298
299 /* ---- standard window message processing prototypes ----- */
300 int DfApplicationProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
301 int DfNormalProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
302 int DfTextBoxProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
303 int DfListBoxProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
304 int DfEditBoxProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
305 int DfPictureProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
306 int DfMenuBarProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
307 int DfPopDownProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
308 int DfButtonProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
309 int DfComboProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
310 int DfTextProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
311 int DfRadioButtonProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
312 int DfCheckBoxProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
313 int DfSpinButtonProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
314 int DfBoxProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
315 int DfDialogProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
316 int DfSystemMenuProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
317 int DfHelpBoxProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
318 int DfMessageBoxProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
319 int DfCancelBoxProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
320 int DfErrorBoxProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
321 int DfYesNoBoxProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
322 int DfStatusBarProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
323 int DfWatchIconProc(DFWINDOW, DFMESSAGE, DF_PARAM, DF_PARAM);
324
325 /* ------------- normal box prototypes ------------- */
326 void DfSetStandardColor(DFWINDOW);
327 void DfSetReverseColor(DFWINDOW);
328 BOOL DfIsAncestor(DFWINDOW, DFWINDOW);
329 #define DfHitControlBox(wnd, p1, p2) \
330 (DfTestAttribute(wnd, DF_CONTROLBOX) && \
331 p1 == 2 && p2 == 0)
332 #define DfWndForeground(wnd) \
333 (wnd->WindowColors [DF_STD_COLOR] [DF_FG])
334 #define DfWndBackground(wnd) \
335 (wnd->WindowColors [DF_STD_COLOR] [DF_BG])
336 #define DfFrameForeground(wnd) \
337 (wnd->WindowColors [DF_FRAME_COLOR] [DF_FG])
338 #define DfFrameBackground(wnd) \
339 (wnd->WindowColors [DF_FRAME_COLOR] [DF_BG])
340 #define DfSelectForeground(wnd) \
341 (wnd->WindowColors [DF_SELECT_COLOR] [DF_FG])
342 #define DfSelectBackground(wnd) \
343 (wnd->WindowColors [DF_SELECT_COLOR] [DF_BG])
344 #define DfHighlightForeground(wnd) \
345 (wnd->WindowColors [DF_HILITE_COLOR] [DF_FG])
346 #define DfHighlightBackground(wnd) \
347 (wnd->WindowColors [DF_HILITE_COLOR] [DF_BG])
348 #define DfWindowClientColor(wnd, fg, bg) \
349 DfWndForeground(wnd) = fg, DfWndBackground(wnd) = bg
350 #define DfWindowReverseColor(wnd, fg, bg) \
351 DfSelectForeground(wnd) = fg, DfSelectBackground(wnd) = bg
352 #define DfWindowFrameColor(wnd, fg, bg) \
353 DfFrameForeground(wnd) = fg, DfFrameBackground(wnd) = bg
354 #define DfWindowHighlightColor(wnd, fg, bg) \
355 DfHighlightForeground(wnd) = fg, DfHighlightBackground(wnd) = bg
356 /* -------- text box prototypes ---------- */
357 #define DfTextLine(wnd, sel) \
358 (wnd->text + *((wnd->TextPointers) + sel))
359 void DfWriteTextLine(DFWINDOW, DFRECT *, int, BOOL);
360 #define DfTextBlockMarked(wnd) ( wnd->BlkBegLine || \
361 wnd->BlkEndLine || \
362 wnd->BlkBegCol || \
363 wnd->BlkEndCol)
364 void DfMarkTextBlock(DFWINDOW, int, int, int, int);
365 #define DfClearTextBlock(wnd) wnd->BlkBegLine = wnd->BlkEndLine = \
366 wnd->BlkBegCol = wnd->BlkEndCol = 0;
367 #define DfGetText(w) ((w)->text)
368 #define DfGetTextLines(w) ((w)->wlines)
369 void DfClearTextPointers(DFWINDOW);
370 void DfBuildTextPointers(DFWINDOW);
371 int DfTextLineNumber(DFWINDOW, char *);
372 /* ------------ DfClipboard prototypes ------------- */
373 void DfCopyTextToClipboard(char *);
374 void DfCopyToClipboard(DFWINDOW);
375 #define DfPasteFromClipboard(wnd) DfPasteText(wnd,DfClipboard,DfClipboardLength)
376 BOOL DfPasteText(DFWINDOW, char *, unsigned);
377 void DfClearClipboard(void);
378 /* --------- menu prototypes ---------- */
379 int DfCopyCommand(char *, char *, int, int);
380 void DfPrepFileMenu(void *, struct DfMenu *);
381 void DfPrepEditMenu(void *, struct DfMenu *);
382 void DfPrepSearchMenu(void *, struct DfMenu *);
383 void DfPrepWindowMenu(void *, struct DfMenu *);
384 void DfBuildSystemMenu(DFWINDOW);
385 BOOL isActive(DF_MBAR *, int);
386 char *DfGetCommandText(DF_MBAR *, int);
387 BOOL DfIsCascadedCommand(DF_MBAR *,int);
388 void DfActivateCommand(DF_MBAR *,int);
389 void DfDeactivateCommand(DF_MBAR *,int);
390 BOOL DfGetCommandToggle(DF_MBAR *,int);
391 void DfSetCommandToggle(DF_MBAR *,int);
392 void DfClearCommandToggle(DF_MBAR *,int);
393 void DfInvertCommandToggle(DF_MBAR *,int);
394 int DfBarSelection(int);
395 /* ------------- list box prototypes -------------- */
396 BOOL DfItemSelected(DFWINDOW, int);
397 /* ------------- edit box prototypes ----------- */
398 #define DfCurrChar (DfTextLine(wnd, wnd->CurrLine)+wnd->CurrCol)
399 #define DfWndCol (wnd->CurrCol-wnd->wleft)
400 #define DfIsMultiLine(wnd) DfTestAttribute(wnd, DF_MULTILINE)
401 void DfSearchText(DFWINDOW);
402 void DfReplaceText(DFWINDOW);
403 void DfSearchNext(DFWINDOW);
404 /* --------- message box prototypes -------- */
405 DFWINDOW DfSliderBox(int, char *, char *);
406 BOOL DfInputBox(DFWINDOW, char *, char *, char *, int);
407 BOOL DfGenericMessage(DFWINDOW, char *, char *, int,
408 int (*)(struct DfWindow *, enum DfMessages, DF_PARAM, DF_PARAM),
409 char *, char *, int, int, int);
410 #define DfTestErrorMessage(msg) \
411 DfGenericMessage(NULL, "Error", msg, 2, DfErrorBoxProc, \
412 DfOk, DfCancel, DF_ID_OK, DF_ID_CANCEL, TRUE)
413 #define DfErrorMessage(msg) \
414 DfGenericMessage(NULL, "Error", msg, 1, DfErrorBoxProc, \
415 DfOk, NULL, DF_ID_OK, 0, TRUE)
416 #define DfMessageBox(ttl, msg) \
417 DfGenericMessage(NULL, ttl, msg, 1, DfMessageBoxProc, \
418 DfOk, NULL, DF_ID_OK, 0, TRUE)
419 #define DfYesNoBox(msg) \
420 DfGenericMessage(NULL, NULL, msg, 2, DfYesNoBoxProc, \
421 DfYes, DfNo, DF_ID_OK, DF_ID_CANCEL, TRUE)
422 #define DfCancelBox(wnd, msg) \
423 DfGenericMessage(wnd, "Wait...", msg, 1, DfCancelBoxProc, \
424 DfCancel, NULL, DF_ID_CANCEL, 0, FALSE)
425 void DfCloseCancelBox(void);
426 DFWINDOW DfMomentaryMessage(char *);
427 int DfMsgHeight(char *);
428 int DfMsgWidth(char *);
429
430 /* ------------- dialog box prototypes -------------- */
431 BOOL DfDialogBox(DFWINDOW, DF_DBOX *, BOOL,
432 int (*)(struct DfWindow *, enum DfMessages, DF_PARAM, DF_PARAM));
433 void DfClearDialogBoxes(void);
434 BOOL DfOpenFileDialogBox(char *, char *);
435 BOOL DfSaveAsDialogBox(char *);
436 void DfGetDlgListText(DFWINDOW, char *, enum DfCommands);
437 BOOL DfDlgDirList(DFWINDOW, char *, enum DfCommands,
438 enum DfCommands, unsigned);
439 BOOL DfRadioButtonSetting(DF_DBOX *, enum DfCommands);
440 void DfPushRadioButton(DF_DBOX *, enum DfCommands);
441 void DfPutItemText(DFWINDOW, enum DfCommands, char *);
442 void DfPutComboListText(DFWINDOW, enum DfCommands, char *);
443 void DfGetItemText(DFWINDOW, enum DfCommands, char *, int);
444 char *DfGetDlgTextString(DF_DBOX *, enum DfCommands, DFCLASS);
445 void DfSetDlgTextString(DF_DBOX *, enum DfCommands, char *, DFCLASS);
446 BOOL DfCheckBoxSetting(DF_DBOX *, enum DfCommands);
447 DF_CTLWINDOW *DfFindCommand(DF_DBOX *, enum DfCommands, int);
448 DFWINDOW DfControlWindow(DF_DBOX *, enum DfCommands);
449 void DfSetScrollBars(DFWINDOW);
450 void DfSetRadioButton(DF_DBOX *, DF_CTLWINDOW *);
451 void DfControlSetting(DF_DBOX *, enum DfCommands, int, int);
452 void DfSetFocusCursor(DFWINDOW);
453
454 #define DfGetControl(wnd) (wnd->ct)
455 #define DfGetDlgText(db, cmd) DfGetDlgTextString(db, cmd, DF_TEXT)
456 #define DfGetDlgTextBox(db, cmd) DfGetDlgTextString(db, cmd, DF_TEXTBOX)
457 #define DfGetEditBoxText(db, cmd) DfGetDlgTextString(db, cmd, DF_EDITBOX)
458 #define DfGetComboBoxText(db, cmd) DfGetDlgTextString(db, cmd, DF_COMBOBOX)
459 #define DfSetDlgText(db, cmd, s) DfSetDlgTextString(db, cmd, s, DF_TEXT)
460 #define DfSetDlgTextBox(db, cmd, s) DfSetDlgTextString(db, cmd, s, DF_TEXTBOX)
461 #define DfSetEditBoxText(db, cmd, s) DfSetDlgTextString(db, cmd, s, DF_EDITBOX)
462 #define DfSetComboBoxText(db, cmd, s) DfSetDlgTextString(db, cmd, s, DF_COMBOBOX)
463 #define DfSetDlgTitle(db, ttl) ((db)->dwnd.title = ttl)
464 #define DfSetCheckBox(db, cmd) DfControlSetting(db, cmd, DF_CHECKBOX, DF_ON)
465 #define DfClearCheckBox(db, cmd) DfControlSetting(db, cmd, DF_CHECKBOX, DF_OFF)
466 #define DfEnableButton(db, cmd) DfControlSetting(db, cmd, DF_BUTTON, DF_ON)
467 #define DfDisableButton(db, cmd) DfControlSetting(db, cmd, DF_BUTTON, DF_OFF)
468
469 /* ---- types of vectors that can be in a picture box ------- */
470 enum DfVectTypes {DF_VECTOR, DF_SOLIDBAR, DF_HEAVYBAR, DF_CROSSBAR, DF_LIGHTBAR};
471
472 /* ------------- picture box prototypes ------------- */
473 void DfDrawVector(DFWINDOW, int, int, int, int);
474 void DfDrawBox(DFWINDOW, int, int, int, int);
475 void DfDrawBar(DFWINDOW, enum DfVectTypes, int, int, int, int);
476 DFWINDOW DfWatchIcon(void);
477
478 /* ------------- help box prototypes ------------- */
479 void DfLoadHelpFile(void);
480 void DfUnLoadHelpFile(void);
481 BOOL DfDisplayHelp(DFWINDOW, char *);
482
483 extern char *DfClassNames[];
484
485 void DfBuildFileName(char *, char *);
486
487 #endif