From eed0eb6a476d54ce19aeff137984aa981d9e3976 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 15 Jun 2010 00:59:57 -0700 Subject: Upgrading to iup 3.1 --- iup/src/mot/iupmot_toggle.c | 72 +++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 35 deletions(-) (limited to 'iup/src/mot/iupmot_toggle.c') diff --git a/iup/src/mot/iupmot_toggle.c b/iup/src/mot/iupmot_toggle.c index b18f24d..1fda258 100755 --- a/iup/src/mot/iupmot_toggle.c +++ b/iup/src/mot/iupmot_toggle.c @@ -236,8 +236,10 @@ static int motToggleSetPaddingAttrib(Ihandle* ih, const char* value) { XtVaSetValues(ih->handle, XmNmarginHeight, ih->data->vert_padding, XmNmarginWidth, ih->data->horiz_padding, NULL); + return 0; } - return 0; + else + return 1; /* store until not mapped, when mapped will be set again */ } static char* motToggleGetSelectColorAttrib(Ihandle* ih) @@ -336,40 +338,40 @@ static int motToggleMapMethod(Ihandle* ih) if (value) { ih->data->type = IUP_TOGGLE_IMAGE; - iupmotSetArg(args, num_args, XmNlabelType, XmPIXMAP); + iupMOT_SETARG(args, num_args, XmNlabelType, XmPIXMAP); } else { ih->data->type = IUP_TOGGLE_TEXT; - iupmotSetArg(args, num_args, XmNlabelType, XmSTRING); + iupMOT_SETARG(args, num_args, XmNlabelType, XmSTRING); } /* 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 */ /* Primitive */ if (iupAttribGetBoolean(ih, "CANFOCUS")) - iupmotSetArg(args, num_args, XmNtraversalOn, True); + iupMOT_SETARG(args, num_args, XmNtraversalOn, True); else - iupmotSetArg(args, num_args, XmNtraversalOn, False); - iupmotSetArg(args, num_args, XmNhighlightThickness, 2); - iupmotSetArg(args, num_args, XmNnavigationType, XmTAB_GROUP); + iupMOT_SETARG(args, num_args, XmNtraversalOn, False); + iupMOT_SETARG(args, num_args, XmNhighlightThickness, 2); + iupMOT_SETARG(args, num_args, XmNnavigationType, XmTAB_GROUP); /* Label */ - iupmotSetArg(args, num_args, XmNrecomputeSize, False); /* no automatic resize from text */ - iupmotSetArg(args, num_args, XmNmarginHeight, 0); /* default padding */ - iupmotSetArg(args, num_args, XmNmarginWidth, 0); - iupmotSetArg(args, num_args, XmNmarginTop, 0); /* no extra margins */ - iupmotSetArg(args, num_args, XmNmarginLeft, 0); - iupmotSetArg(args, num_args, XmNmarginBottom, 0); - iupmotSetArg(args, num_args, XmNmarginRight, 0); + iupMOT_SETARG(args, num_args, XmNrecomputeSize, False); /* no automatic resize from text */ + iupMOT_SETARG(args, num_args, XmNmarginHeight, 0); /* default padding */ + iupMOT_SETARG(args, num_args, XmNmarginWidth, 0); + iupMOT_SETARG(args, num_args, XmNmarginTop, 0); /* no extra margins */ + iupMOT_SETARG(args, num_args, XmNmarginLeft, 0); + iupMOT_SETARG(args, num_args, XmNmarginBottom, 0); + iupMOT_SETARG(args, num_args, XmNmarginRight, 0); if (radio) { - iupmotSetArg(args, num_args, XmNtoggleMode, XmTOGGLE_BOOLEAN); - iupmotSetArg(args, num_args, XmNindicatorType, XmONE_OF_MANY_ROUND); + iupMOT_SETARG(args, num_args, XmNtoggleMode, XmTOGGLE_BOOLEAN); + iupMOT_SETARG(args, num_args, XmNindicatorType, XmONE_OF_MANY_ROUND); if (!iupAttribGet(radio, "_IUPMOT_LASTTOGGLE")) { @@ -380,33 +382,33 @@ static int motToggleMapMethod(Ihandle* ih) else { if (ih->data->type == IUP_TOGGLE_TEXT && iupAttribGetBoolean(ih, "3STATE")) - iupmotSetArg(args, num_args, XmNtoggleMode, XmTOGGLE_INDETERMINATE); + iupMOT_SETARG(args, num_args, XmNtoggleMode, XmTOGGLE_INDETERMINATE); else - iupmotSetArg(args, num_args, XmNtoggleMode, XmTOGGLE_BOOLEAN); - iupmotSetArg(args, num_args, XmNindicatorType, XmN_OF_MANY); + iupMOT_SETARG(args, num_args, XmNtoggleMode, XmTOGGLE_BOOLEAN); + iupMOT_SETARG(args, num_args, XmNindicatorType, XmN_OF_MANY); } if (ih->data->type == IUP_TOGGLE_IMAGE) { - iupmotSetArg(args, num_args, XmNindicatorOn, XmINDICATOR_NONE); - iupmotSetArg(args, num_args, XmNalignment, XmALIGNMENT_CENTER); - iupmotSetArg(args, num_args, XmNshadowThickness, 2); + iupMOT_SETARG(args, num_args, XmNindicatorOn, XmINDICATOR_NONE); + iupMOT_SETARG(args, num_args, XmNalignment, XmALIGNMENT_CENTER); + iupMOT_SETARG(args, num_args, XmNshadowThickness, 2); } else { - iupmotSetArg(args, num_args, XmNspacing, 3); - iupmotSetArg(args, num_args, XmNindicatorOn, XmINDICATOR_CHECK_BOX); - iupmotSetArg(args, num_args, XmNalignment, XmALIGNMENT_BEGINNING); + iupMOT_SETARG(args, num_args, XmNspacing, 3); + iupMOT_SETARG(args, num_args, XmNindicatorOn, XmINDICATOR_CHECK_BOX); + iupMOT_SETARG(args, num_args, XmNalignment, XmALIGNMENT_BEGINNING); if (radio) { - iupmotSetArg(args, num_args, XmNindicatorSize, 13); - iupmotSetArg(args, num_args, XmNselectColor, iupmotColorGetPixel(0, 0, 0)); + iupMOT_SETARG(args, num_args, XmNindicatorSize, 13); + iupMOT_SETARG(args, num_args, XmNselectColor, iupmotColorGetPixel(0, 0, 0)); } else - iupmotSetArg(args, num_args, XmNindicatorSize, 15); + iupMOT_SETARG(args, num_args, XmNindicatorSize, 15); - iupmotSetArg(args, num_args, XmNshadowThickness, 0); - iupmotSetArg(args, num_args, XmNdetailShadowThickness, 2); + iupMOT_SETARG(args, num_args, XmNshadowThickness, 0); + iupMOT_SETARG(args, num_args, XmNdetailShadowThickness, 2); } ih->handle = XtCreateManagedWidget( -- cgit v1.2.3