1 /* ---------------- statbar.c -------------- */
3 #include "dflat32/dflat.h"
5 int StatusBarProc(DFWINDOW wnd
, DFMESSAGE msg
, PARAM p1
, PARAM p2
)
11 DfSendMessage(wnd
, CAPTURE_CLOCK
, 0, 0);
14 if ((int)p1
== CTRL_F4
)
20 statusbar
= DFcalloc(1, WindowWidth(wnd
)+1);
21 memset(statusbar
, ' ', WindowWidth(wnd
));
22 *(statusbar
+WindowWidth(wnd
)) = '\0';
23 strncpy(statusbar
+1, "F1=Help Ý FreeDos Edit", 22);
25 int len
= min((int)strlen(wnd
->text
), (int)(WindowWidth(wnd
)-17));
27 int off
=(WindowWidth(wnd
)-len
)/2;
28 strncpy(statusbar
+off
, wnd
->text
, len
);
32 *(statusbar
+WindowWidth(wnd
)-8) = '\0';
33 SetStandardColor(wnd
);
34 PutWindowLine(wnd
, statusbar
, 0, 0);
40 SetStandardColor(wnd
);
41 PutWindowLine(wnd
, (char *)p1
, WindowWidth(wnd
)-8, 0);
42 wnd
->TimePosted
= TRUE
;
45 DfSendMessage(NULL
, RELEASE_CLOCK
, 0, 0);
50 return BaseWndProc(STATUSBAR
, wnd
, msg
, p1
, p2
);