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_radio.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_radio.c')
-rw-r--r-- | src/gwin/gwin_radio.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gwin/gwin_radio.c b/src/gwin/gwin_radio.c index 0bafa7cc..b9076109 100644 --- a/src/gwin/gwin_radio.c +++ b/src/gwin/gwin_radio.c @@ -203,7 +203,12 @@ void gwinRadioDraw_Radio(GWidgetObject *gw, void *param) { if (gw->g.vmt != (gwinVMT *)&radioVMT) return; pcol = getDrawColors(gw); - + + #if GWIN_NEED_FLASHING + // Flash only the on state. + pcol = _gwinGetFlashedColor(gw, pcol, FALSE); + #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); @@ -215,6 +220,11 @@ void gwinRadioDraw_Radio(GWidgetObject *gw, void *param) { if (gw->g.vmt != (gwinVMT *)&radioVMT) return; pcol = getDrawColors(gw); + #if GWIN_NEED_FLASHING + // Flash only the on state. + pcol = _gwinGetFlashedColor(gw, pcol, FALSE); + #endif + if ((gw->g.flags & GRADIO_FLG_PRESSED)) { gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); gdispGFillStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-1, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter); |