remove empty dir
[reactos.git] / rosapps / dflat32 / statbar.c
1 /* ---------------- statbar.c -------------- */
2
3 #include "dflat.h"
4
5 int DfStatusBarProc(DFWINDOW wnd, DFMESSAGE msg, DF_PARAM p1, DF_PARAM p2)
6 {
7 char *statusbar;
8 switch (msg) {
9 case DFM_CREATE_WINDOW:
10 case DFM_MOVE:
11 DfSendMessage(wnd, DFM_CAPTURE_CLOCK, 0, 0);
12 break;
13 case DFM_KEYBOARD:
14 if ((int)p1 == DF_CTRL_F4)
15 return TRUE;
16 break;
17 case DFM_PAINT:
18 if (!DfIsVisible(wnd))
19 break;
20 statusbar = DfCalloc(1, DfWindowWidth(wnd)+1);
21 memset(statusbar, ' ', DfWindowWidth(wnd));
22 *(statusbar+DfWindowWidth(wnd)) = '\0';
23 strncpy(statusbar+1, "DF_F1=Help Ý FreeDos Edit", 22);
24 if (wnd->text) {
25 int len = min((int)strlen(wnd->text), (int)(DfWindowWidth(wnd)-17));
26 if (len > 0) {
27 int off=(DfWindowWidth(wnd)-len)/2;
28 strncpy(statusbar+off, wnd->text, len);
29 }
30 }
31 if (wnd->TimePosted)
32 *(statusbar+DfWindowWidth(wnd)-8) = '\0';
33 DfSetStandardColor(wnd);
34 DfPutWindowLine(wnd, statusbar, 0, 0);
35 free(statusbar);
36 return TRUE;
37 case DFM_BORDER:
38 return TRUE;
39 case DFM_CLOCKTICK:
40 DfSetStandardColor(wnd);
41 DfPutWindowLine(wnd, (char *)p1, DfWindowWidth(wnd)-8, 0);
42 wnd->TimePosted = TRUE;
43 return TRUE;
44 case DFM_CLOSE_WINDOW:
45 DfSendMessage(NULL, DFM_RELEASE_CLOCK, 0, 0);
46 break;
47 default:
48 break;
49 }
50 return DfBaseWndProc(DF_STATUSBAR, wnd, msg, p1, p2);
51 }
52
53 /* EOF */