/* Generated by wbuild from "OptButton.w"
** (generator version $Revision: 1.4 $ of $Date: 1995/08/29 09:46:13 $)
*/
#include <xite/includes.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#line 81 "OptButton.w"
#include XITE_STDIO_H
#line 82 "OptButton.w"
#include <Xfwf/TextMenu.h>
#include <Xfwf/OptButtonP.h>

static char defaultTranslations[] = "\
<Btn1Down>: prepare() open_menu() \n\
Button1<Enter>: prepare() open_menu() \n\
<Key>Return: prepare() open_menu() \n\
<Btn1Up>: popdown_maybe() \n\
";
static void _resolve_inheritance(
#if NeedFunctionPrototypes
WidgetClass
#endif
);
#line 35 "OptButton.w"
static void initialize(
#if NeedFunctionPrototypes
Widget ,Widget,ArgList ,Cardinal *
#endif
);
#line 44 "OptButton.w"
static Boolean  set_values(
#if NeedFunctionPrototypes
Widget ,Widget ,Widget,ArgList ,Cardinal *
#endif
);
#line 68 "OptButton.w"
static void set_label_cb(
#if NeedFunctionPrototypes
Widget ,XtPointer ,XtPointer 
#endif
);
#line 68 "OptButton.w"
/*ARGSUSED*/static void set_label_cb(menu,client_data,call_data)Widget  menu;XtPointer  client_data;XtPointer  call_data;
{
    Widget self = (Widget) client_data;
    XfwfTextMenuData *data = (XfwfTextMenuData *) call_data;

    if (((XfwfOptionButtonWidget)self)->xfwfLabel.label && strcmp(((XfwfOptionButtonWidget)self)->xfwfLabel.label, data->label) == 0) return;
    XtVaSetValues(self, XtNlabel, data->label, NULL);
}

static XtResource resources[] = {
#line 26 "OptButton.w"
{XtNframeWidth,XtCFrameWidth,XtRDimension,sizeof(((XfwfOptionButtonRec*)NULL)->xfwfFrame.frameWidth),XtOffsetOf(XfwfOptionButtonRec,xfwfFrame.frameWidth),XtRImmediate,(XtPointer)2 },
};

XfwfOptionButtonClassRec xfwfOptionButtonClassRec = {
{ /* core_class part */
(WidgetClass) &xfwfPullDownClassRec,
"XfwfOptionButton",
sizeof(XfwfOptionButtonRec),
NULL,
_resolve_inheritance,
FALSE,
initialize,
NULL,
XtInheritRealize,
NULL,
0,
resources,
1,
NULLQUARK,
True ,
XtExposeCompressMultiple ,
True ,
False ,
NULL,
XtInheritResize,
XtInheritExpose,
set_values,
NULL,
XtInheritSetValuesAlmost,
NULL,
XtInheritAcceptFocus,
XtVersion,
NULL,
defaultTranslations,
XtInheritQueryGeometry,
XtInheritDisplayAccelerator,
NULL 
},
{ /* composite_class part */
XtInheritGeometryManager,
XtInheritChangeManaged,
XtInheritInsertChild,
XtInheritDeleteChild,
NULL
},
{ /* XfwfCommon_class part */
XtInherit_compute_inside,
XtInherit_total_frame_width,
XtInherit_highlight_border,
XtInherit_unhighlight_border,
XtInherit_would_accept_focus,
XtInherit_traverse,
XtInherit_lighter_color,
XtInherit_darker_color,
NULL ,
},
{ /* XfwfFrame_class part */
0
},
{ /* XfwfBoard_class part */
XtInherit_set_abs_location,
},
{ /* XfwfLabel_class part */
XtInherit_set_label,
},
{ /* XfwfButton_class part */
0
},
{ /* XfwfPullDown_class part */
0
},
{ /* XfwfOptionButton_class part */
0
},
};
WidgetClass xfwfOptionButtonWidgetClass = (WidgetClass) &xfwfOptionButtonClassRec;
static void _resolve_inheritance(class)
WidgetClass class;
{
  XfwfOptionButtonWidgetClass c = (XfwfOptionButtonWidgetClass) class;
  XfwfOptionButtonWidgetClass super;
  static CompositeClassExtensionRec extension_rec = {
    NULL, NULLQUARK, XtCompositeExtensionVersion,
    sizeof(CompositeClassExtensionRec), True};
  CompositeClassExtensionRec *ext;
  ext = (CompositeClassExtensionRec *)XtMalloc(sizeof(*ext));
  *ext = extension_rec;
  ext->next_extension = c->composite_class.extension;
  c->composite_class.extension = (XtPointer)ext;
  if (class == xfwfOptionButtonWidgetClass) return;
  super = (XfwfOptionButtonWidgetClass)class->core_class.superclass;
}
#line 35 "OptButton.w"
/*ARGSUSED*/static void initialize(request,self,args,num_args)Widget  request;Widget self;ArgList  args;Cardinal * num_args;
{
    if (((XfwfOptionButtonWidget)self)->xfwfPullDown.own_popup)
	XtAddCallback(((XfwfOptionButtonWidget)self)->xfwfPullDown.popup, XtNactivate, set_label_cb, self);
}
#line 44 "OptButton.w"
/*ARGSUSED*/static Boolean  set_values(old,request,self,args,num_args)Widget  old;Widget  request;Widget self;ArgList  args;Cardinal * num_args;
{
    if (((XfwfOptionButtonWidget)old)->xfwfPullDown.popup != ((XfwfOptionButtonWidget)self)->xfwfPullDown.popup && ((XfwfOptionButtonWidget)self)->xfwfPullDown.own_popup)
	XtAddCallback(((XfwfOptionButtonWidget)self)->xfwfPullDown.popup, XtNactivate, set_label_cb, self);
    return False;
}
