GWIN checkbox fix

This commit is contained in:
Joel Bodenmann 2013-06-02 18:43:19 +02:00
parent 5b7ac841f3
commit 809b8ccc60
2 changed files with 11 additions and 1 deletions

View File

@ -38,7 +38,6 @@
typedef struct GEventGWinCheckbox_t {
GEventType type; // The type of this event (GEVENT_GWIN_CHECKBOX)
GHandle checkbox; // The checkbox that has been depressed (actually triggered on release)
bool_t state; // The state of the checkbox (selected or unselected)
} GEventGWinCheckbox;
typedef enum GCheckboxShape_e {

View File

@ -74,12 +74,23 @@ static void gwinCheckboxCallback(void *param, GEvent *pe) {
gwinCheckboxDraw((GHandle)param);
}
break;
#endif /* GFX_USE_GINPUT && GINPUT_NEED_MOUSE */
default:
return;
}
// Trigger a GWIN checkbox event
psl = 0;
while ((psl = geventGetSourceListener(gsh, psl))) {
if (!(pe = geventGetEventBuffer(psl)))
continue;
pbe->type = GEVENT_GWIN_CHECKBOX;
pbe->checkbox = gh;
geventSendEvent(psl);
}
#undef gh
#undef pbe
#undef pme