diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-07-04 00:59:12 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-07-04 00:59:12 +1000 |
commit | f9eed6036d7f28ef1ab8f8d3feec6a05e0572405 (patch) | |
tree | 03e4d38b594e5483db377c5023703de3c5bdf7f8 /src/gwin | |
parent | a7198b53ff82a02a86a55823a8be895ec5eca1e4 (diff) | |
download | uGFX-f9eed6036d7f28ef1ab8f8d3feec6a05e0572405.tar.gz uGFX-f9eed6036d7f28ef1ab8f8d3feec6a05e0572405.tar.bz2 uGFX-f9eed6036d7f28ef1ab8f8d3feec6a05e0572405.zip |
Make the enabled state available to all GWIN's - not just widgets.
Diffstat (limited to 'src/gwin')
-rw-r--r-- | src/gwin/gwidget.c | 17 | ||||
-rw-r--r-- | src/gwin/gwin.c | 28 |
2 files changed, 28 insertions, 17 deletions
diff --git a/src/gwin/gwidget.c b/src/gwin/gwidget.c index a2b82f1d..6440f171 100644 --- a/src/gwin/gwidget.c +++ b/src/gwin/gwidget.c @@ -226,23 +226,6 @@ void _gwidgetRedraw(GHandle gh) { gw->fnDraw(gw, gw->fnParam); } -void gwinSetEnabled(GHandle gh, bool_t enabled) { - if (!(gh->flags & GWIN_FLG_WIDGET)) - return; - - if (enabled) { - if (!(gh->flags & GWIN_FLG_ENABLED)) { - gh->flags |= GWIN_FLG_ENABLED; - _gwidgetRedraw(gh); - } - } else { - if ((gh->flags & GWIN_FLG_ENABLED)) { - gh->flags &= ~GWIN_FLG_ENABLED; - _gwidgetRedraw(gh); - } - } -} - void gwinSetText(GHandle gh, const char *txt, bool_t useAlloc) { if (!(gh->flags & GWIN_FLG_WIDGET)) return; diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index e3d81d9c..9e345523 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin.c @@ -223,6 +223,34 @@ bool_t gwinGetVisible(GHandle gh) { return (gh->flags & GWIN_FLG_VISIBLE) ? TRUE : FALSE; } +void gwinSetEnabled(GHandle gh, bool_t enabled) { + if (enabled) { + if (!(gh->flags & GWIN_FLG_ENABLED)) { + gh->flags |= GWIN_FLG_ENABLED; + if (gh->vmt->Redraw) { + #if GDISP_NEED_CLIP + gdispSetClip(gh->x, gh->y, gh->width, gh->height); + #endif + gh->vmt->Redraw(gh); + } + } + } else { + if ((gh->flags & GWIN_FLG_ENABLED)) { + gh->flags &= ~GWIN_FLG_ENABLED; + if (gh->vmt->Redraw) { + #if GDISP_NEED_CLIP + gdispSetClip(gh->x, gh->y, gh->width, gh->height); + #endif + gh->vmt->Redraw(gh); + } + } + } +} + +bool_t gwinGetEnabled(GHandle gh) { + return (gh->flags & GWIN_FLG_ENABLED) ? TRUE : FALSE; +} + void gwinMove(GHandle gh, coord_t x, coord_t y) { #if GWIN_NEED_WINDOWMANAGER cwm->vmt->Redim(gh, x, y, gh->width, gh->height); |