optimized gwinGetVisible() and gwinGetEnabled()
This commit is contained in:
parent
bad22f5fee
commit
d365232a85
@ -222,11 +222,10 @@ bool_t gwinGetVisible(GHandle gh) {
|
|||||||
#if GWIN_NEED_HIERARCHY
|
#if GWIN_NEED_HIERARCHY
|
||||||
// return TRUE if all widgets (itself + parents) are visble, false otherwise
|
// return TRUE if all widgets (itself + parents) are visble, false otherwise
|
||||||
GHandle e = gh;
|
GHandle e = gh;
|
||||||
while (e) {
|
for(e = gh; e; e = e->parent) {
|
||||||
if (!(e->flags & GWIN_FLG_VISIBLE))
|
if (!(e->flags & GWIN_FLG_VISIBLE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
e = e->parent;
|
}
|
||||||
};
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
#else
|
||||||
return (gh->flags & GWIN_FLG_VISIBLE) ? TRUE : FALSE;
|
return (gh->flags & GWIN_FLG_VISIBLE) ? TRUE : FALSE;
|
||||||
@ -251,11 +250,10 @@ bool_t gwinGetEnabled(GHandle gh) {
|
|||||||
#if GWIN_NEED_HIERARCHY
|
#if GWIN_NEED_HIERARCHY
|
||||||
// return TRUE if all widgets (itself + parents) are enabled, false otherwise
|
// return TRUE if all widgets (itself + parents) are enabled, false otherwise
|
||||||
GHandle e = gh;
|
GHandle e = gh;
|
||||||
while (e) {
|
for(e = gh; e; e = e->parent) {
|
||||||
if (!(e->flags & GWIN_FLG_ENABLED))
|
if (!(e->flags & GWIN_FLG_ENABLED))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
e = e->parent;
|
}
|
||||||
};
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
#else
|
||||||
return (gh->flags & GWIN_FLG_ENABLED) ? TRUE : FALSE;
|
return (gh->flags & GWIN_FLG_ENABLED) ? TRUE : FALSE;
|
||||||
|
Loading…
Reference in New Issue
Block a user