diff options
author | Joel Bodenmann <joel@unormal.org> | 2014-01-04 16:05:42 +0100 |
---|---|---|
committer | Joel Bodenmann <joel@unormal.org> | 2014-01-04 16:05:42 +0100 |
commit | d365232a8510f82d38f743c703e6b5a058e1b164 (patch) | |
tree | d7002fd53faec5c579acce5ceb98dda7938d2cd0 /src | |
parent | bad22f5feea49a7417237aa70e2f6b9e349d91c2 (diff) | |
download | uGFX-d365232a8510f82d38f743c703e6b5a058e1b164.tar.gz uGFX-d365232a8510f82d38f743c703e6b5a058e1b164.tar.bz2 uGFX-d365232a8510f82d38f743c703e6b5a058e1b164.zip |
optimized gwinGetVisible() and gwinGetEnabled()
Diffstat (limited to 'src')
-rw-r--r-- | src/gwin/gwin.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index 6d47f3b5..a2837d3b 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin.c @@ -222,11 +222,10 @@ bool_t gwinGetVisible(GHandle gh) { #if GWIN_NEED_HIERARCHY // return TRUE if all widgets (itself + parents) are visble, false otherwise GHandle e = gh; - while (e) { + for(e = gh; e; e = e->parent) { if (!(e->flags & GWIN_FLG_VISIBLE)) return FALSE; - e = e->parent; - }; + } return TRUE; #else return (gh->flags & GWIN_FLG_VISIBLE) ? TRUE : FALSE; @@ -251,11 +250,10 @@ bool_t gwinGetEnabled(GHandle gh) { #if GWIN_NEED_HIERARCHY // return TRUE if all widgets (itself + parents) are enabled, false otherwise GHandle e = gh; - while (e) { + for(e = gh; e; e = e->parent) { if (!(e->flags & GWIN_FLG_ENABLED)) return FALSE; - e = e->parent; - }; + } return TRUE; #else return (gh->flags & GWIN_FLG_ENABLED) ? TRUE : FALSE; |