/*
** 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/DialogS.h>
#include <Xm/DrawingA.h>
#include <Xm/Form.h>
#include <Xm/PushB.h>
#include <Xm/RowColumn.h>
#include <Xm/ScrollBar.h>
#include <Xm/Text.h>
#include <Xm/ToggleB.h>


#include "uiedit.h"

edit_p edit_form = (edit_p) NULL;



void edit_form_c::create (Widget parent, char *widget_name)
{
	Widget children[4];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	Widget form1 = (Widget)NULL;
	Widget scrolledText5 = (Widget)NULL;
	Widget button3 = (Widget)NULL;
	Widget drawingArea1 = (Widget)NULL;
	Widget button1 = (Widget)NULL;

	if ( !widget_name )
		widget_name = "edit_form";

	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	edit_form = XmCreateForm ( parent, widget_name, al, ac );
	ac = 0;
	_xd_rootwidget = edit_form;
	form1 = XmCreateForm ( edit_form, "form1", al, ac );
	XtSetArg(al[ac], XmNeditMode, XmMULTI_LINE_EDIT); ac++;
	text_ = XmCreateScrolledText ( form1, "text_", al, ac );
	ac = 0;
	scrolledText5 = XtParent ( text_ );

	XtSetArg(al[ac], XmNspacing, 0); ac++;
	XtSetArg(al[ac], XmNmarginWidth, 0); ac++;
	XtSetArg(al[ac], XmNmarginHeight, 0); ac++;
	XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++;
	tools_ = XmCreateRowColumn ( form1, "tools_", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNmarginWidth, 0); ac++;
	XtSetArg(al[ac], XmNmarginHeight, 2); ac++;
	XtSetArg(al[ac], XmNdefaultButtonShadowThickness, 0); ac++;
	external_ = XmCreatePushButton ( tools_, "Use external editor", al, ac );
	ac = 0;
	button3 = XmCreatePushButton ( tools_, "Search", al, ac );
	drawingArea1 = XmCreateDrawingArea ( tools_, "drawingArea1", al, ac );
	XtSetArg(al[ac], XmNmarginWidth, 0); ac++;
	XtSetArg(al[ac], XmNmarginHeight, 2); ac++;
	XtSetArg(al[ac], XmNdefaultButtonShadowThickness, 0); ac++;
	button1 = XmCreatePushButton ( tools_, "Submit", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++;
	tools2_ = XmCreateRowColumn ( form1, "tools2_", al, ac );
	ac = 0;
	alias_ = XmCreateToggleButton ( tools2_, "alias_", al, ac );
	preprocess_ = XmCreateToggleButton ( tools2_, "preprocess_", 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 ( form1,al, ac );
	ac = 0;

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

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

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNrightWidget, tools_); ac++;
	XtSetValues ( tools2_,al, ac );
	ac = 0;
	XtAddCallback (text_, XmNvalueChangedCallback,&edit_form_c:: changedCB, (XtPointer) this);
	XtManageChild(text_);
	XtAddCallback (external_, XmNactivateCallback,&edit_form_c:: externalCB, (XtPointer) this);
	XtAddCallback (button3, XmNactivateCallback,&edit_form_c:: searchCB, (XtPointer) this);
	XtAddCallback (button1, XmNactivateCallback,&edit_form_c:: submitCB, (XtPointer) this);
	children[ac++] = external_;
	children[ac++] = button3;
	children[ac++] = drawingArea1;
	children[ac++] = button1;
	XtManageChildren(children, ac);
	ac = 0;
	XtAddCallback (preprocess_, XmNvalueChangedCallback,&edit_form_c:: preprocCB, (XtPointer) this);
	children[ac++] = alias_;
	children[ac++] = preprocess_;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = tools_;
	children[ac++] = tools2_;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = form1;
	XtManageChildren(children, ac);
}

void edit_form_c::searchCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	edit_form_p instance = (edit_form_p) client_data;
	instance->searchCB ( widget, call_data );
}

void edit_form_c::preprocCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	edit_form_p instance = (edit_form_p) client_data;
	instance->preprocCB ( widget, call_data );
}

void edit_form_c::submitCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	edit_form_p instance = (edit_form_p) client_data;
	instance->submitCB ( widget, call_data );
}

void edit_form_c::externalCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	edit_form_p instance = (edit_form_p) client_data;
	instance->externalCB ( widget, call_data );
}

void edit_form_c::changedCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	edit_form_p instance = (edit_form_p) client_data;
	instance->changedCB ( widget, call_data );
}

