diff options
author | inmarket <andrewh@inmarket.com.au> | 2015-01-25 17:40:34 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2015-01-25 17:40:34 +1000 |
commit | b9f53aa7936686134f19c480346816a3d234f7f7 (patch) | |
tree | 84a51da605c4e3f54320a6ed793e8ffb6ba2aaac /src/gwin/gwin_checkbox.c | |
parent | b316263833c95cf2b8cf14fe890321d5880aa81c (diff) | |
download | uGFX-b9f53aa7936686134f19c480346816a3d234f7f7.tar.gz uGFX-b9f53aa7936686134f19c480346816a3d234f7f7.tar.bz2 uGFX-b9f53aa7936686134f19c480346816a3d234f7f7.zip |
Add the ability to flash a gwin window/widget.
Only the button draws for checkbox's and radio's currently do anything about it.
Widget demo updated to show this on Checkbox 3 (the toggle button).
Diffstat (limited to 'src/gwin/gwin_checkbox.c')
-rw-r--r-- | src/gwin/gwin_checkbox.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gwin/gwin_checkbox.c b/src/gwin/gwin_checkbox.c index ff0507d9..3f1d46bf 100644 --- a/src/gwin/gwin_checkbox.c +++ b/src/gwin/gwin_checkbox.c @@ -216,6 +216,11 @@ void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) { if (gw->g.vmt != (gwinVMT *)&checkboxVMT) return; pcol = getDrawColors(gw); + #if GWIN_NEED_FLASHING + // Flash the on and off state. + pcol = _gwinGetFlashedColor(gw, pcol, TRUE); + #endif + gdispGFillStringBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width-1, gw->g.height-1, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter); gdispGDrawLine(gw->g.display, gw->g.x+gw->g.width-1, gw->g.y, gw->g.x+gw->g.width-1, gw->g.y+gw->g.height-1, pcol->edge); gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gw->g.height-1, gw->g.x+gw->g.width-2, gw->g.y+gw->g.height-1, pcol->edge); @@ -232,6 +237,11 @@ void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) { if (gw->g.vmt != (gwinVMT *)&checkboxVMT) return; pcol = getDrawColors(gw); + #if GWIN_NEED_FLASHING + // Flash the on and off state. + pcol = _gwinGetFlashedColor(gw, pcol, TRUE); + #endif + /* Fill the box blended from variants of the fill color */ tcol = gdispBlendColor(White, pcol->fill, TOP_FADE); bcol = gdispBlendColor(Black, pcol->fill, BOTTOM_FADE); |