1 /* ---------------- statbar.c -------------- */
5 int DfStatusBarProc(DFWINDOW wnd
, DFMESSAGE msg
, DF_PARAM p1
, DF_PARAM p2
)
9 case DFM_CREATE_WINDOW
:
11 DfSendMessage(wnd
, DFM_CAPTURE_CLOCK
, 0, 0);
14 if ((int)p1
== DF_CTRL_F4
)
18 if (!DfIsVisible(wnd
))
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);
25 int len
= min((int)strlen(wnd
->text
), (int)(DfWindowWidth(wnd
)-17));
27 int off
=(DfWindowWidth(wnd
)-len
)/2;
28 strncpy(statusbar
+off
, wnd
->text
, len
);
32 *(statusbar
+DfWindowWidth(wnd
)-8) = '\0';
33 DfSetStandardColor(wnd
);
34 DfPutWindowLine(wnd
, statusbar
, 0, 0);
40 DfSetStandardColor(wnd
);
41 DfPutWindowLine(wnd
, (char *)p1
, DfWindowWidth(wnd
)-8, 0);
42 wnd
->TimePosted
= TRUE
;
44 case DFM_CLOSE_WINDOW
:
45 DfSendMessage(NULL
, DFM_RELEASE_CLOCK
, 0, 0);
50 return DfBaseWndProc(DF_STATUSBAR
, wnd
, msg
, p1
, p2
);