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


#include "uioutput.h"

output_panel_p output_form = (output_panel_p) NULL;



void output_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 scrolledText3 = (Widget)NULL;
	Widget scrolledList11 = (Widget)NULL;
	Widget button2 = (Widget)NULL;
	Widget button3 = (Widget)NULL;
	Widget button1 = (Widget)NULL;

	if ( !widget_name )
		widget_name = "output_form";

	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	output_form = XmCreateForm ( parent, widget_name, al, ac );
	ac = 0;
	_xd_rootwidget = output_form;
	form1 = XmCreateForm ( output_form, "form1", al, ac );
	XtSetArg(al[ac], XmNhighlightThickness, 1); ac++;
	XtSetArg(al[ac], XmNshadowThickness, 1); ac++;
	XtSetArg(al[ac], XmNeditable, FALSE); ac++;
	XtSetArg(al[ac], XmNcursorPositionVisible, FALSE); ac++;
	name_ = XmCreateTextField ( form1, "name_", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNeditable, FALSE); ac++;
	XtSetArg(al[ac], XmNcursorPositionVisible, FALSE); ac++;
	XtSetArg(al[ac], XmNeditMode, XmMULTI_LINE_EDIT); ac++;
	text_ = XmCreateScrolledText ( form1, "text_", al, ac );
	ac = 0;
	scrolledText3 = XtParent ( text_ );

	XtSetArg(al[ac], XmNvisibleItemCount, 6); ac++;
	XtSetArg(al[ac], XmNlistSizePolicy, XmRESIZE_IF_POSSIBLE); ac++;
	list_ = XmCreateScrolledList ( form1, "list_", al, ac );
	ac = 0;
	scrolledList11 = XtParent ( list_ );

	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++;
	button2 = XmCreatePushButton ( tools_, "Use external viewer", al, ac );
	ac = 0;
	button3 = XmCreatePushButton ( tools_, "Search", al, ac );
	XtSetArg(al[ac], XmNmarginWidth, 0); ac++;
	XtSetArg(al[ac], XmNmarginHeight, 2); ac++;
	XtSetArg(al[ac], XmNdefaultButtonShadowThickness, 0); ac++;
	button1 = XmCreatePushButton ( tools_, "Update", 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_FORM); ac++;
	XtSetValues ( form1,al, ac );
	ac = 0;

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

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopWidget, name_); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomWidget, scrolledList11); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( scrolledText3,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( scrolledList11,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_FORM); ac++;
	XtSetValues ( tools_,al, ac );
	ac = 0;
	XtManageChild(text_);
	XtAddCallback (list_, XmNbrowseSelectionCallback,&output_form_c:: browseCB, (XtPointer) this);
	XtManageChild(list_);
	XtAddCallback (button2, XmNactivateCallback,&output_form_c:: externalCB, (XtPointer) this);
	XtAddCallback (button3, XmNactivateCallback,&output_form_c:: searchCB, (XtPointer) this);
	XtAddCallback (button1, XmNactivateCallback,&output_form_c:: updateCB, (XtPointer) this);
	children[ac++] = button2;
	children[ac++] = button3;
	children[ac++] = button1;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = name_;
	children[ac++] = tools_;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = form1;
	XtManageChildren(children, ac);
}

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

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

void output_form_c::updateCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	output_form_p instance = (output_form_p) client_data;
	instance->updateCB ( widget, call_data );
}

void output_form_c::browseCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	output_form_p instance = (output_form_p) client_data;
	instance->browseCB ( widget, call_data );
}

