/*
** Generated by X-Designer
*/
/*
**LIBS: -lXm -lXt -lX11
*/

#include <stdlib.h>
#include <X11/Xatom.h>
#include <X11/Intrinsic.h>
#include <X11/Shell.h>

#include <Xm/Xm.h>
#include <Xm/CascadeB.h>
#include <Xm/DialogS.h>
#include <Xm/DrawingA.h>
#include <Xm/DrawnB.h>
#include <Xm/Form.h>
#include <Xm/Label.h>
#include <Xm/PushB.h>
#include <Xm/RowColumn.h>
#include <Xm/ScrollBar.h>
#include <Xm/ScrolledW.h>
#include <Xm/Separator.h>
#include <Xm/ToggleB.h>
#include <Xm/ToggleBG.h>

extern "C" {
#include "SimpleGraph.h"
#include "Hyper.h"
}
#define XmCreateDrawnButton CreateHyper
#include <xdclass.h>

class triggers_menu_c: public xd_XmCascadeButton_c {
public:
	virtual void create (Widget parent, char *widget_name = NULL);
protected:
	Widget triggers_menu;
	Widget triggers_button_;
	Widget triggered_button_;
public:
	static void reachCB( Widget, XtPointer, XtPointer );
	virtual void reachCB( Widget, XtPointer ) = 0;
	static void fullCB( Widget, XtPointer, XtPointer );
	virtual void fullCB( Widget, XtPointer ) = 0;
	static void triggeredCB( Widget, XtPointer, XtPointer );
	virtual void triggeredCB( Widget, XtPointer ) = 0;
	static void triggersCB( Widget, XtPointer, XtPointer );
	virtual void triggersCB( Widget, XtPointer ) = 0;
};

typedef triggers_menu_c *triggers_menu_p;

class triggers_form_c: public xd_XmForm_c {
public:
	virtual void create (Widget parent, char *widget_name = NULL);
protected:
	Widget triggers_form;
	Widget tgraph_;
	Widget ttext_;
	Widget dependencies_button_;
	Widget graph_;
	Widget info_menu_;
	Widget link_menu_;
	Widget text_;
public:
	static void linkCB( Widget, XtPointer, XtPointer );
	virtual void linkCB( Widget, XtPointer ) = 0;
	static void hyperCB( Widget, XtPointer, XtPointer );
	virtual void hyperCB( Widget, XtPointer ) = 0;
	static void entryCB( Widget, XtPointer, XtPointer );
	virtual void entryCB( Widget, XtPointer ) = 0;
	static void dependCB( Widget, XtPointer, XtPointer );
	virtual void dependCB( Widget, XtPointer ) = 0;
};

typedef triggers_form_c *triggers_form_p;
class triggers;
typedef triggers *triggers_p;

triggers_menu_p triggers_menu = (triggers_menu_p) NULL;
triggers_p triggers_form = (triggers_p) NULL;



void triggers_menu_c::create (Widget parent, char *widget_name)
{
	Widget children[6];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	Widget menu2 = (Widget)NULL;
	Widget separator1 = (Widget)NULL;
	Widget toggle3 = (Widget)NULL;
	Widget separator2 = (Widget)NULL;
	Widget button1 = (Widget)NULL;

	if ( !widget_name )
		widget_name = "triggers_menu";

	triggers_menu = XmCreateCascadeButton ( parent, widget_name, al, ac );
	_xd_rootwidget = triggers_menu;
	XtSetArg(al[ac], XmNtearOffModel, XmTEAR_OFF_ENABLED); ac++;
	menu2 = XmCreatePulldownMenu ( parent, "menu2", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNset, TRUE); ac++;
	triggers_button_ = XmCreateToggleButton ( menu2, "triggers", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNset, TRUE); ac++;
	triggered_button_ = XmCreateToggleButton ( menu2, "triggered", al, ac );
	ac = 0;
	separator1 = XmCreateSeparator ( menu2, "separator1", al, ac );
	XtSetArg(al[ac], XmNset, TRUE); ac++;
	toggle3 = XmCreateToggleButton ( menu2, "toggle3", al, ac );
	ac = 0;
	separator2 = XmCreateSeparator ( menu2, "separator2", al, ac );
	button1 = XmCreatePushButton ( menu2, "Reach selection", al, ac );
	XtAddCallback (triggers_button_, XmNvalueChangedCallback,&triggers_menu_c:: triggersCB, (XtPointer) this);
	XtAddCallback (triggered_button_, XmNvalueChangedCallback,&triggers_menu_c:: triggeredCB, (XtPointer) this);
	XtAddCallback (toggle3, XmNvalueChangedCallback,&triggers_menu_c:: fullCB, (XtPointer) this);
	XtAddCallback (button1, XmNactivateCallback,&triggers_menu_c:: reachCB, (XtPointer) this);
	children[ac++] = triggers_button_;
	children[ac++] = triggered_button_;
	children[ac++] = separator1;
	children[ac++] = toggle3;
	children[ac++] = separator2;
	children[ac++] = button1;
	XtManageChildren(children, ac);
	ac = 0;
	XtSetArg(al[ac], XmNsubMenuId, menu2); ac++;
	XtSetValues ( triggers_menu, al, ac );
}

void triggers_menu_c::reachCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	triggers_menu_p instance = (triggers_menu_p) client_data;
	instance->reachCB ( widget, call_data );
}

void triggers_menu_c::fullCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	triggers_menu_p instance = (triggers_menu_p) client_data;
	instance->fullCB ( widget, call_data );
}

void triggers_menu_c::triggeredCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	triggers_menu_p instance = (triggers_menu_p) client_data;
	instance->triggeredCB ( widget, call_data );
}

void triggers_menu_c::triggersCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	triggers_menu_p instance = (triggers_menu_p) client_data;
	instance->triggersCB ( widget, call_data );
}


void triggers_form_c::create (Widget parent, char *widget_name)
{
	Widget children[3];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	Widget form2 = (Widget)NULL;
	Widget form1 = (Widget)NULL;
	Widget radioBox1 = (Widget)NULL;
	Widget scrolledWin1 = (Widget)NULL;
	Widget scrollbar1 = (Widget)NULL;
	Widget scrollbar2 = (Widget)NULL;
	Widget rowcol1 = (Widget)NULL;
	Widget label1 = (Widget)NULL;

	if ( !widget_name )
		widget_name = "triggers_form";

	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	triggers_form = XmCreateForm ( parent, widget_name, al, ac );
	ac = 0;
	_xd_rootwidget = triggers_form;
	form2 = XmCreateForm ( triggers_form, "form2", al, ac );
	form1 = XmCreateForm ( form2, "form1", al, ac );
	XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++;
	XtSetArg(al[ac], XmNpacking, XmPACK_TIGHT); ac++;
	radioBox1 = XmCreateRadioBox ( form1, "radioBox1", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNset, TRUE); ac++;
	tgraph_ = XmCreateToggleButtonGadget ( radioBox1, "Graph", al, ac );
	ac = 0;
	ttext_ = XmCreateToggleButtonGadget ( radioBox1, "Text", al, ac );
	dependencies_button_ = XmCreateToggleButton ( form1, "dependencies_button_", al, ac );
	XtSetArg(al[ac], XmNscrollingPolicy, XmAUTOMATIC); ac++;
	scrolledWin1 = XmCreateScrolledWindow ( form2, "scrolledWin1", al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNhorizontalScrollBar, &scrollbar1 ); ac++;
	XtSetArg(al[ac], XmNverticalScrollBar, &scrollbar2 ); ac++;
	XtGetValues(scrolledWin1, al, ac );
	ac = 0;
	rowcol1 = XmCreateRowColumn ( scrolledWin1, "rowcol1", al, ac );
#define XmCreateDrawingArea CreateGraph
	graph_ = XmCreateDrawingArea ( rowcol1, "graph_", al, ac );
	ac = 0;
	info_menu_ = XmCreatePopupMenu ( graph_, "info_menu_", al, ac );
	label1 = XmCreateLabel ( info_menu_, "Click either on a node or on an arrow.", al, ac );
	link_menu_ = XmCreatePopupMenu ( graph_, "link_menu_", al, ac );
	text_ = XmCreateDrawnButton ( rowcol1, "text_", al, ac );

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( form2,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( form1,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopWidget, form1); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( scrolledWin1,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNrightWidget, dependencies_button_); ac++;
	XtSetValues ( radioBox1,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( dependencies_button_,al, ac );
	ac = 0;
	XtAddCallback (radioBox1, XmNentryCallback,&triggers_form_c:: entryCB, (XtPointer) this);
	children[ac++] = tgraph_;
	children[ac++] = ttext_;
	XtManageChildren(children, ac);
	ac = 0;
	XtAddCallback (dependencies_button_, XmNvalueChangedCallback,&triggers_form_c:: dependCB, (XtPointer) this);
	children[ac++] = radioBox1;
	children[ac++] = dependencies_button_;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = label1;
	XtManageChildren(children, ac);
	ac = 0;
	XtAddCallback (link_menu_, XmNentryCallback,&triggers_form_c:: linkCB, (XtPointer) this);
	XtAddCallback (text_, XmNactivateCallback,&triggers_form_c:: hyperCB, (XtPointer) this);
	children[ac++] = graph_;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = rowcol1;
	XtManageChildren(children, ac);
	ac = 0;
	XmScrolledWindowSetAreas(scrolledWin1, scrollbar1, scrollbar2, rowcol1 );
	children[ac++] = form1;
	children[ac++] = scrolledWin1;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = form2;
	XtManageChildren(children, ac);
}

void triggers_form_c::linkCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	triggers_form_p instance = (triggers_form_p) client_data;
	instance->linkCB ( widget, call_data );
}

void triggers_form_c::hyperCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	triggers_form_p instance = (triggers_form_p) client_data;
	instance->hyperCB ( widget, call_data );
}

void triggers_form_c::entryCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	triggers_form_p instance = (triggers_form_p) client_data;
	instance->entryCB ( widget, call_data );
}

void triggers_form_c::dependCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	triggers_form_p instance = (triggers_form_p) client_data;
	instance->dependCB ( widget, call_data );
}

