diff options
Diffstat (limited to 'iup/src/iup_classbase.c')
-rwxr-xr-x | iup/src/iup_classbase.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/iup/src/iup_classbase.c b/iup/src/iup_classbase.c index 9cb9e63..03a98d1 100755 --- a/iup/src/iup_classbase.c +++ b/iup/src/iup_classbase.c @@ -164,8 +164,7 @@ static char* iBaseGetPositionAttrib(Ihandle* ih) static int iBaseSetPositionAttrib(Ihandle* ih, const char* value) { - if (ih->is_floating) - iupStrToIntInt(value, &ih->x, &ih->y, ','); + iupStrToIntInt(value, &ih->x, &ih->y, ','); return 0; } @@ -211,7 +210,7 @@ char* iupBaseGetVisibleAttrib(Ihandle* ih) int iupBaseSetVisibleAttrib(Ihandle* ih, const char* value) { iupdrvSetVisible(ih, iupStrBoolean(value)); - return 0; + return 1; /* must be 1 to mark when set at the element */ } char* iupBaseNativeParentGetBgColorAttrib(Ihandle* ih) @@ -410,15 +409,19 @@ void iupBaseRegisterCommonAttrib(Iclass* ic) iupClassRegisterAttribute(ic, "FLOATING", iBaseGetFloatingAttrib, iBaseSetFloatingAttrib, NULL, NULL, IUPAF_NOT_MAPPED|IUPAF_NO_INHERIT); iupClassRegisterAttribute(ic, "EXPAND", iBaseGetExpandAttrib, iBaseSetExpandAttrib, NULL, NULL, IUPAF_NOT_MAPPED|IUPAF_NO_INHERIT); iupClassRegisterAttribute(ic, "NORMALIZERGROUP", NULL, iBaseSetNormalizerGroupAttrib, NULL, NULL, IUPAF_NOT_MAPPED|IUPAF_NO_INHERIT); + iupClassRegisterAttribute(ic, "EXPANDWEIGTH", NULL, NULL, NULL, NULL, IUPAF_NOT_MAPPED|IUPAF_NO_INHERIT); /* make sure everyone has the correct default value */ - iupClassRegisterAttribute(ic, "VISIBLE", NULL, NULL, IUPAF_SAMEASSYSTEM, "YES", IUPAF_DEFAULT); iupClassRegisterAttribute(ic, "ACTIVE", NULL, NULL, IUPAF_SAMEASSYSTEM, "YES", IUPAF_DEFAULT); if (ic->is_interactive) iupClassRegisterAttribute(ic, "CANFOCUS", NULL, NULL, IUPAF_SAMEASSYSTEM, "YES", IUPAF_NO_INHERIT); else iupClassRegisterAttribute(ic, "CANFOCUS", NULL, NULL, IUPAF_SAMEASSYSTEM, "NO", IUPAF_NO_INHERIT); + /* if not native container, must set at children, + native container will automatically hide its children. */ + iupClassRegisterAttribute(ic, "VISIBLE", NULL, NULL, IUPAF_SAMEASSYSTEM, "YES", IUPAF_DEFAULT); /* let the attribute to be propagated to children */ + iupClassRegisterAttribute(ic, "SIZE", iupBaseGetSizeAttrib, iupBaseSetSizeAttrib, NULL, NULL, IUPAF_NO_DEFAULTVALUE|IUPAF_NOT_MAPPED|IUPAF_NO_INHERIT); iupClassRegisterAttribute(ic, "RASTERSIZE", iupBaseGetRasterSizeAttrib, iupBaseSetRasterSizeAttrib, NULL, NULL, IUPAF_NO_DEFAULTVALUE|IUPAF_NOT_MAPPED|IUPAF_NO_INHERIT); iupClassRegisterAttribute(ic, "CHARSIZE", iupBaseGetCharSizeAttrib, NULL, NULL, NULL, IUPAF_NO_DEFAULTVALUE|IUPAF_READONLY|IUPAF_NOT_MAPPED|IUPAF_NO_INHERIT); @@ -439,7 +442,7 @@ void iupBaseRegisterCommonAttrib(Iclass* ic) void iupBaseRegisterVisualAttrib(Iclass* ic) { - iupClassRegisterAttribute(ic, "VISIBLE", iupBaseGetVisibleAttrib, iupBaseSetVisibleAttrib, IUPAF_SAMEASSYSTEM, "YES", IUPAF_NO_INHERIT); /* VISIBLE inheritance comes from the native system */ + iupClassRegisterAttribute(ic, "VISIBLE", iupBaseGetVisibleAttrib, iupBaseSetVisibleAttrib, "YES", "NO", IUPAF_DEFAULT); iupClassRegisterAttribute(ic, "ACTIVE", iupBaseGetActiveAttrib, iupBaseSetActiveAttrib, IUPAF_SAMEASSYSTEM, "YES", IUPAF_DEFAULT); iupClassRegisterAttribute(ic, "ZORDER", NULL, iupdrvBaseSetZorderAttrib, NULL, NULL, IUPAF_WRITEONLY|IUPAF_NO_INHERIT); |