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


#include "uiservers.h"

servers_form_p servers_form = (servers_form_p) NULL;



void servers_form_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 scrolledList1 = (Widget)NULL;
	Widget form1 = (Widget)NULL;
	Widget rowcol1 = (Widget)NULL;
	Widget separator1 = (Widget)NULL;
	Widget button3 = (Widget)NULL;
	Widget rowcol2 = (Widget)NULL;
	Widget label1 = (Widget)NULL;
	Widget label2 = (Widget)NULL;
	Widget label3 = (Widget)NULL;
	Widget separator2 = (Widget)NULL;

	if ( !widget_name )
		widget_name = "Servers";

	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	servers_form = XmCreateForm ( parent, widget_name, al, ac );
	ac = 0;
	_xd_rootwidget = servers_form;
	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	form_ = XmCreateForm ( servers_form, "form_", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNvisibleItemCount, 17); ac++;
	XtSetArg(al[ac], XmNlistSizePolicy, XmCONSTANT); ac++;
	list_ = XmCreateScrolledList ( form_, "list_", al, ac );
	ac = 0;
	scrolledList1 = XtParent ( list_ );

	form1 = XmCreateForm ( form_, "form1", al, ac );
	XtSetArg(al[ac], XmNentryAlignment, XmALIGNMENT_CENTER); ac++;
	rowcol1 = XmCreateRowColumn ( form1, "rowcol1", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNsensitive, FALSE); ac++;
	add_ = XmCreatePushButton ( rowcol1, "Add", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNsensitive, FALSE); ac++;
	update_ = XmCreatePushButton ( rowcol1, "Update", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNsensitive, FALSE); ac++;
	remove_ = XmCreatePushButton ( rowcol1, "Remove", al, ac );
	ac = 0;
	separator1 = XmCreateSeparator ( rowcol1, "separator1", al, ac );

	XtSetArg(al[ac], XmNsensitive, FALSE); ac++;
	button3 = XmCreatePushButton ( rowcol1, "Scan network...", al, ac );
	ac = 0;

	rowcol2 = XmCreateRowColumn ( form1, "rowcol2", al, ac );
	label1 = XmCreateLabel ( rowcol2, "Name:", al, ac );
	name_ = XmCreateTextField ( rowcol2, "name_", al, ac );
	label2 = XmCreateLabel ( rowcol2, "Host:", al, ac );
	host_ = XmCreateTextField ( rowcol2, "host_", al, ac );
	label3 = XmCreateLabel ( rowcol2, "Port:", al, ac );
	number_ = XmCreateTextField ( rowcol2, "number_", al, ac );
	separator2 = XmCreateSeparator ( form1, "separator2", 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 ( form_,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 5); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 5); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightWidget, form1); ac++;
	XtSetValues ( scrolledList1,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 5); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 5); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( form1,al, ac );
	ac = 0;

	XtAddCallback (list_, XmNbrowseSelectionCallback,&servers_form_c:: browseCB, (XtPointer) this);
	XtManageChild(list_);

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 0); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 0); ac++;
	XtSetValues ( rowcol1,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 0); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 0); ac++;
	XtSetValues ( rowcol2,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNtopWidget, rowcol2); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomWidget, rowcol1); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 0); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 0); ac++;
	XtSetValues ( separator2,al, ac );
	ac = 0;
	XtAddCallback (add_, XmNactivateCallback,&servers_form_c:: addCB, (XtPointer) this);
	XtAddCallback (update_, XmNactivateCallback,&servers_form_c:: updateCB, (XtPointer) this);
	XtAddCallback (remove_, XmNactivateCallback,&servers_form_c:: removeCB, (XtPointer) this);
	XtAddCallback (button3, XmNactivateCallback,&servers_form_c:: serversCB, (XtPointer) this);
	children[ac++] = add_;
	children[ac++] = update_;
	children[ac++] = remove_;
	children[ac++] = separator1;
	children[ac++] = button3;
	XtManageChildren(children, ac);
	ac = 0;
	XtAddCallback (name_, XmNvalueChangedCallback,&servers_form_c:: changedCB, (XtPointer) this);
	XtAddCallback (host_, XmNvalueChangedCallback,&servers_form_c:: changedCB, (XtPointer) this);
	XtAddCallback (number_, XmNvalueChangedCallback,&servers_form_c:: changedCB, (XtPointer) this);
	children[ac++] = label1;
	children[ac++] = name_;
	children[ac++] = label2;
	children[ac++] = host_;
	children[ac++] = label3;
	children[ac++] = number_;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = rowcol1;
	children[ac++] = rowcol2;
	children[ac++] = separator2;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = form1;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = form_;
	XtManageChildren(children, ac);
}

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

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

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

void servers_form_c::removeCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	servers_form_p instance = (servers_form_p) client_data;
	instance->removeCB ( widget, call_data );
}

void servers_form_c::addCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	servers_form_p instance = (servers_form_p) client_data;
	instance->addCB ( widget, call_data );
}

void servers_form_c::serversCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	servers_form_p instance = (servers_form_p) client_data;
	instance->serversCB ( widget, call_data );
}

