summaryrefslogtreecommitdiff
path: root/iup/src/mot/iupmot_frame.c
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2010-06-15 00:59:57 -0700
committerPixel <pixel@nobis-crew.org>2010-06-15 00:59:57 -0700
commiteed0eb6a476d54ce19aeff137984aa981d9e3976 (patch)
tree807891636efd2f87dcbd261e971216269973ae07 /iup/src/mot/iupmot_frame.c
parentccc8261e4d48de89da4ddfe7b55e378ae0cd6f47 (diff)
Upgrading to iup 3.1
Diffstat (limited to 'iup/src/mot/iupmot_frame.c')
-rwxr-xr-xiup/src/mot/iupmot_frame.c58
1 files changed, 36 insertions, 22 deletions
diff --git a/iup/src/mot/iupmot_frame.c b/iup/src/mot/iupmot_frame.c
index 39de5d8..cfda44f 100755
--- a/iup/src/mot/iupmot_frame.c
+++ b/iup/src/mot/iupmot_frame.c
@@ -42,22 +42,33 @@ static int motFrameSetBgColorAttrib(Ihandle* ih, const char* value)
{
Pixel color;
- /* ignore given value, must use only from parent */
- value = iupBaseNativeParentGetBgColor(ih);
+ if (!iupAttribGet(ih, "_IUPFRAME_HAS_BGCOLOR"))
+ {
+ /* ignore given value, must use only from parent */
+ value = iupBaseNativeParentGetBgColor(ih);
+ }
color = iupmotColorGetPixelStr(value);
if (color != (Pixel)-1)
{
Widget title_label, child_manager;
- iupmotSetBgColor(ih->handle, color);
+ if (!iupAttribGet(ih, "_IUPFRAME_HAS_BGCOLOR"))
+ {
+ iupmotSetBgColor(ih->handle, color);
- child_manager = XtNameToWidget(ih->handle, "*child_manager");
- iupmotSetBgColor(child_manager, color);
+ child_manager = XtNameToWidget(ih->handle, "*child_manager");
+ iupmotSetBgColor(child_manager, color);
- title_label = XtNameToWidget(ih->handle, "*title_label");
- if (!title_label) return 1;
- iupmotSetBgColor(title_label, color);
+ title_label = XtNameToWidget(ih->handle, "*title_label");
+ if (!title_label) return 1;
+ iupmotSetBgColor(title_label, color);
+ }
+ else
+ {
+ child_manager = XtNameToWidget(ih->handle, "*child_manager");
+ iupmotSetBgColor(child_manager, color);
+ }
return 1;
}
@@ -171,22 +182,25 @@ static int motFrameMapMethod(Ihandle* ih)
{
char* value = iupAttribGetStr(ih, "SUNKEN");
if (iupStrBoolean(value))
- iupmotSetArg(args, num_args, XmNshadowType, XmSHADOW_IN);
+ iupMOT_SETARG(args, num_args, XmNshadowType, XmSHADOW_IN);
else
- iupmotSetArg(args, num_args, XmNshadowType, XmSHADOW_ETCHED_IN);
+ iupMOT_SETARG(args, num_args, XmNshadowType, XmSHADOW_ETCHED_IN);
+
+ if (iupAttribGet(ih, "BGCOLOR"))
+ iupAttribSetStr(ih, "_IUPFRAME_HAS_BGCOLOR", "1");
}
/* Core */
- iupmotSetArg(args, num_args, XmNmappedWhenManaged, False); /* not visible when managed */
- iupmotSetArg(args, num_args, XmNx, 0); /* x-position */
- iupmotSetArg(args, num_args, XmNy, 0); /* y-position */
- iupmotSetArg(args, num_args, XmNwidth, 10); /* default width to avoid 0 */
- iupmotSetArg(args, num_args, XmNheight, 10); /* default height to avoid 0 */
+ iupMOT_SETARG(args, num_args, XmNmappedWhenManaged, False); /* not visible when managed */
+ iupMOT_SETARG(args, num_args, XmNx, 0); /* x-position */
+ iupMOT_SETARG(args, num_args, XmNy, 0); /* y-position */
+ iupMOT_SETARG(args, num_args, XmNwidth, 10); /* default width to avoid 0 */
+ iupMOT_SETARG(args, num_args, XmNheight, 10); /* default height to avoid 0 */
/* Manager */
- iupmotSetArg(args, num_args, XmNshadowThickness, 2);
+ iupMOT_SETARG(args, num_args, XmNshadowThickness, 2);
/* Frame */
- iupmotSetArg(args, num_args, XmNmarginHeight, 0); /* no shadow margins */
- iupmotSetArg(args, num_args, XmNmarginWidth, 0); /* no shadow margins */
+ iupMOT_SETARG(args, num_args, XmNmarginHeight, 0); /* no shadow margins */
+ iupMOT_SETARG(args, num_args, XmNmarginWidth, 0); /* no shadow margins */
ih->handle = XtCreateManagedWidget(
iupDialogGetChildIdStr(ih), /* child identifier */
@@ -204,11 +218,11 @@ static int motFrameMapMethod(Ihandle* ih)
Widget title_label;
num_args = 0;
/* Label */
- iupmotSetArg(args, num_args, XmNlabelType, XmSTRING);
- iupmotSetArg(args, num_args, XmNmarginHeight, 0); /* default padding */
- iupmotSetArg(args, num_args, XmNmarginWidth, 0);
+ iupMOT_SETARG(args, num_args, XmNlabelType, XmSTRING);
+ iupMOT_SETARG(args, num_args, XmNmarginHeight, 0); /* default padding */
+ iupMOT_SETARG(args, num_args, XmNmarginWidth, 0);
/* Frame Constraint */
- iupmotSetArg(args, num_args, XmNchildType, XmFRAME_TITLE_CHILD);
+ iupMOT_SETARG(args, num_args, XmNchildType, XmFRAME_TITLE_CHILD);
title_label = XtCreateManagedWidget("title_label", xmLabelWidgetClass, ih->handle, args, num_args);
iupmotSetString(title_label, XmNlabelString, title);
}