change explorer quick launch icon to use default 'my computer' icon instead of a...
[reactos.git] / rosapps / dflat32 / checkbox.c
1 /* -------------- checkbox.c ------------ */
2
3 #include "dflat.h"
4
5 int DfCheckBoxProc(DFWINDOW wnd, DFMESSAGE msg, DF_PARAM p1, DF_PARAM p2)
6 {
7 int rtn;
8 DF_CTLWINDOW *ct = DfGetControl(wnd);
9 if (ct != NULL) {
10 switch (msg) {
11 case DFM_SETFOCUS:
12 if (!(int)p1)
13 DfSendMessage(NULL, DFM_HIDE_CURSOR, 0, 0);
14 case DFM_MOVE:
15 rtn = DfBaseWndProc(DF_CHECKBOX, wnd, msg, p1, p2);
16 DfSetFocusCursor(wnd);
17 return rtn;
18 case DFM_PAINT: {
19 char cb[] = "[ ]";
20 if (ct->setting)
21 cb[1] = 'X';
22 DfSendMessage(wnd, DFM_CLEARTEXT, 0, 0);
23 DfSendMessage(wnd, DFM_ADDTEXT, (DF_PARAM) cb, 0);
24 DfSetFocusCursor(wnd);
25 break;
26 }
27 case DFM_KEYBOARD:
28 if ((int)p1 != ' ')
29 break;
30 case DFM_LEFT_BUTTON:
31 ct->setting ^= DF_ON;
32 DfSendMessage(wnd, DFM_PAINT, 0, 0);
33 return TRUE;
34 default:
35 break;
36 }
37 }
38 return DfBaseWndProc(DF_CHECKBOX, wnd, msg, p1, p2);
39 }
40
41 BOOL DfCheckBoxSetting(DF_DBOX *db, enum DfCommands cmd)
42 {
43 DF_CTLWINDOW *ct = DfFindCommand(db, cmd, DF_CHECKBOX);
44 if (ct != NULL)
45 return (ct->isetting == DF_ON);
46 return FALSE;
47 }
48
49 /* EOF */