mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 00:23:10 +00:00
Still working on making dflat32 a dll. Alot of this will be cleaned up in the
next few weeks. I'm going through the DFLAT api doc and fixing the export names and then going to try to build a simple hello dflat application. svn path=/trunk/; revision=2844
This commit is contained in:
parent
531d8f275d
commit
81345fd691
37 changed files with 7650 additions and 132 deletions
49
rosapps/lib/dflat32/checkbox.c
Normal file
49
rosapps/lib/dflat32/checkbox.c
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* -------------- checkbox.c ------------ */
|
||||
|
||||
#include "dflat32/dflat.h"
|
||||
|
||||
int CheckBoxProc(DFWINDOW wnd, DFMESSAGE msg, PARAM p1, PARAM p2)
|
||||
{
|
||||
int rtn;
|
||||
CTLWINDOW *ct = GetControl(wnd);
|
||||
if (ct != NULL) {
|
||||
switch (msg) {
|
||||
case SETFOCUS:
|
||||
if (!(int)p1)
|
||||
DfSendMessage(NULL, HIDE_CURSOR, 0, 0);
|
||||
case MOVE:
|
||||
rtn = BaseWndProc(CHECKBOX, wnd, msg, p1, p2);
|
||||
SetFocusCursor(wnd);
|
||||
return rtn;
|
||||
case PAINT: {
|
||||
char cb[] = "[ ]";
|
||||
if (ct->setting)
|
||||
cb[1] = 'X';
|
||||
DfSendMessage(wnd, CLEARTEXT, 0, 0);
|
||||
DfSendMessage(wnd, ADDTEXT, (PARAM) cb, 0);
|
||||
SetFocusCursor(wnd);
|
||||
break;
|
||||
}
|
||||
case KEYBOARD:
|
||||
if ((int)p1 != ' ')
|
||||
break;
|
||||
case LEFT_BUTTON:
|
||||
ct->setting ^= ON;
|
||||
DfSendMessage(wnd, PAINT, 0, 0);
|
||||
return TRUE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return BaseWndProc(CHECKBOX, wnd, msg, p1, p2);
|
||||
}
|
||||
|
||||
BOOL CheckBoxSetting(DBOX *db, enum commands cmd)
|
||||
{
|
||||
CTLWINDOW *ct = FindCommand(db, cmd, CHECKBOX);
|
||||
if (ct != NULL)
|
||||
return (ct->isetting == ON);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* EOF */
|
Loading…
Add table
Add a link
Reference in a new issue