Fix enabled bug
This commit is contained in:
parent
184f1e0d9b
commit
6b70d3a63f
1 changed files with 6 additions and 1 deletions
|
@ -311,7 +311,7 @@ static void gwidgetEvent(void *param, GEvent *pe) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _gwidgetDrawFocusRect(GWidgetObject *gx, coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
void _gwidgetDrawFocusRect(GWidgetObject *gx, coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||||
uint16_t i = 0;
|
uint16_t i;
|
||||||
|
|
||||||
// Don't do anything if we don't have the focus
|
// Don't do anything if we don't have the focus
|
||||||
if (&gx->g != _widgetInFocus)
|
if (&gx->g != _widgetInFocus)
|
||||||
|
@ -381,6 +381,11 @@ GHandle _gwidgetCreate(GDisplay *g, GWidgetObject *pgw, const GWidgetInit *pInit
|
||||||
if (!(pgw = (GWidgetObject *)_gwindowCreate(g, &pgw->g, &pInit->g, &vmt->g, GWIN_FLG_WIDGET|GWIN_FLG_ENABLED|GWIN_FLG_SYSENABLED)))
|
if (!(pgw = (GWidgetObject *)_gwindowCreate(g, &pgw->g, &pInit->g, &vmt->g, GWIN_FLG_WIDGET|GWIN_FLG_ENABLED|GWIN_FLG_SYSENABLED)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#if GWIN_NEED_CONTAINERS
|
||||||
|
// This window can't be system enabled if the parent is not enabled
|
||||||
|
if (pgw->g.parent && !(pgw->g.parent->flags & GWIN_FLG_SYSENABLED))
|
||||||
|
pgw->g.flags &= ~GWIN_FLG_SYSENABLED;
|
||||||
|
#endif
|
||||||
pgw->text = pInit->text ? pInit->text : "";
|
pgw->text = pInit->text ? pInit->text : "";
|
||||||
pgw->fnDraw = pInit->customDraw ? pInit->customDraw : vmt->DefaultDraw;
|
pgw->fnDraw = pInit->customDraw ? pInit->customDraw : vmt->DefaultDraw;
|
||||||
pgw->fnParam = pInit->customParam;
|
pgw->fnParam = pInit->customParam;
|
||||||
|
|
Loading…
Add table
Reference in a new issue