static Boolean set_values(Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args) { Boolean need_refresh = False; DEBUGOUT(_LtDebug(__FILE__, new_w, "XmGadget set_values\n")); /* Force the borderWidth to 0 */ new_w->core.border_width = 0; if (!XmRepTypeValidValue(XmRepTypeGetId(XmRUnitType), G_UnitType(new_w), new_w)) { G_UnitType(new_w) = G_UnitType(current); } if (!XmRepTypeValidValue(XmRepTypeGetId(XmRNavigationType), G_NavigationType(new_w), new_w)) { G_NavigationType(new_w) = G_NavigationType(current); } _XmGadgetImportArgs(new_w, args, num_args); need_refresh = _XmNavigSetValues(current, request, new_w, args, num_args); return need_refresh; }
/************************************************************************ * * SetValues * Perform and updating necessary for a set values call. * ************************************************************************/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmGadget cur = (XmGadget) cw ; XmGadget req = (XmGadget) rw ; XmGadget new_w = (XmGadget) nw ; Boolean returnFlag; if (XtIsSensitive(cw) != XtIsSensitive(nw)) { if (!XtIsSensitive(nw)) { _XmToolTipLeave(nw, NULL, NULL, NULL); } } if (XmGetToolTipString(nw) != XmGetToolTipString(cw)) { XmSetToolTipString(cw, XmGetToolTipString(nw)); } /* CR 7124: XmNlayoutDirection is a CG resource. */ if (cur->gadget.layout_direction != new_w->gadget.layout_direction) { XmeWarning((Widget) new_w, MESSAGE1); new_w->gadget.layout_direction = cur->gadget.layout_direction; } if( cur->gadget.navigation_type != new_w->gadget.navigation_type ) { if( !XmRepTypeValidValue( XmRID_NAVIGATION_TYPE, new_w->gadget.navigation_type, (Widget) new_w) ) { new_w->gadget.navigation_type = cur->gadget.navigation_type ; } } returnFlag = _XmNavigSetValues ((Widget) cur, (Widget) req, (Widget) new_w, args, num_args); /* Validate changed data. */ if( !XmRepTypeValidValue( XmRID_UNIT_TYPE, new_w->gadget.unit_type, (Widget) new_w) ) { new_w->gadget.unit_type = cur->gadget.unit_type; } /* Convert the necessary fields from unit values to pixel values */ _XmGadgetImportArgs((Widget) new_w, args, num_args); /* Check for resize conditions */ if (cur->gadget.shadow_thickness != new_w->gadget.shadow_thickness || cur->gadget.highlight_thickness != new_w->gadget.highlight_thickness) returnFlag = True; /* Force the border width to 0 */ new_w->rectangle.border_width = 0; if( new_w->gadget.highlight_drawn && ( !XtIsSensitive( (Widget) new_w) || ( cur->gadget.highlight_on_enter && !(new_w->gadget.highlight_on_enter) && (_XmGetFocusPolicy( (Widget) new_w) == XmPOINTER))) ) { if( ((XmGadgetClass) XtClass( new_w)) ->gadget_class.border_unhighlight ) { (*(((XmGadgetClass) XtClass( new_w)) ->gadget_class.border_unhighlight))( (Widget) new_w) ; } } /* Return a flag which may indicate that a redraw needs to occur. */ return (returnFlag); }