diff --git a/include/gwin/checkbox.h b/include/gwin/checkbox.h index ba8f3b2f..a5f1e136 100644 --- a/include/gwin/checkbox.h +++ b/include/gwin/checkbox.h @@ -38,7 +38,7 @@ 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 // Is the checkbox currently checked or unchecked? + bool_t isChecked; // Is the checkbox currently checked or unchecked? } GEventGWinCheckbox; typedef enum GCheckboxShape_e { @@ -65,7 +65,7 @@ typedef struct GCheckboxObject_t { GCheckboxDrawFunction fn; GCheckboxColor *colors; - bool_t state; + bool_t isChecked; void *param; } GCheckboxObject; @@ -127,7 +127,7 @@ void gwinCheckboxSetEnabled(GHandle gh, bool_t enabled); * * @api */ -#define gwinCheckboxGetState(gh) (((GCheckboxObject *)(gh))->state) +#define gwinCheckboxGetState(gh) (((GCheckboxObject *)(gh))->isChecked) /** * @brief Get the source handle of a checkbox diff --git a/src/gwin/checkbox.c b/src/gwin/checkbox.c index f12c0ee3..d6b94dfa 100644 --- a/src/gwin/checkbox.c +++ b/src/gwin/checkbox.c @@ -26,7 +26,7 @@ static const GCheckboxColor defaultColors = { }; /* default style drawing routine */ -static void gwinCheckboxDrawDefaultStyle(GHandle gh, bool_t enabled, bool_t state, void* param) { +static void gwinCheckboxDrawDefaultStyle(GHandle gh, bool_t enabled, bool_t isChecked, void* param) { #define gcw ((GCheckboxObject *)gh) (void) enabled; @@ -34,7 +34,7 @@ static void gwinCheckboxDrawDefaultStyle(GHandle gh, bool_t enabled, bool_t stat gdispDrawBox(gh->x, gh->y, gh->width, gh->height, gcw->colors->border); - if (state) + if (isChecked) gdispFillArea(gh->x+2, gh->y+2, gh->width-4, gh->height-4, gcw->colors->checked); else gdispFillArea(gh->x+2, gh->y+2, gh->width-4, gh->height-4, gcw->colors->bg); @@ -70,7 +70,7 @@ static void gwinCheckboxCallback(void *param, GEvent *pe) { && pme->x >= gbw->gwin.x && pme->x < gbw->gwin.x + gbw->gwin.width && pme->y >= gbw->gwin.y && pme->y < gbw->gwin.y + gbw->gwin.height) { - gbw->state = !gbw->state; + gbw->isChecked = !gbw->isChecked; gwinCheckboxDraw((GHandle)param); } @@ -88,7 +88,7 @@ static void gwinCheckboxCallback(void *param, GEvent *pe) { continue; pbe->type = GEVENT_GWIN_CHECKBOX; pbe->checkbox = gh; - pbe->state = gbw->state; + pbe->isChecked = gbw->isChecked; geventSendEvent(psl); } @@ -109,7 +109,7 @@ GHandle gwinCheckboxCreate(GCheckboxObject *gb, coord_t x, coord_t y, coord_t wi gb->fn = gwinCheckboxDrawDefaultStyle; // set the default style drawing routine gb->colors = &defaultColors; // asign the default colors gb->param = 0; // some safe value here - gb->state = GCHBX_UNCHECKED; // checkbox is currently unchecked + gb->isChecked = GCHBX_UNCHECKED; // checkbox is currently unchecked gb->gwin.enabled = TRUE; // checkboxes are enabled by default geventListenerInit(&gb->listener); @@ -140,7 +140,7 @@ void gwinCheckboxDraw(GHandle gh) { gcw->fn(gh, gcw->gwin.enabled, - gcw->state, + gcw->isChecked, gcw->param); #undef gcw