aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2013-06-02 18:59:51 +0200
committerJoel Bodenmann <joel@unormal.org>2013-06-02 18:59:51 +0200
commit48b4c6f6baab6439c8060535e0c8205e347018b7 (patch)
tree093f4f61db085458a7457da9e42f01e79e0918c8
parent446f41297d914c6e624e2095264fb67edc0b9d69 (diff)
downloaduGFX-48b4c6f6baab6439c8060535e0c8205e347018b7.tar.gz
uGFX-48b4c6f6baab6439c8060535e0c8205e347018b7.tar.bz2
uGFX-48b4c6f6baab6439c8060535e0c8205e347018b7.zip
member state of checkbox is now called isChecked
-rw-r--r--include/gwin/checkbox.h6
-rw-r--r--src/gwin/checkbox.c12
2 files changed, 9 insertions, 9 deletions
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