/*
** 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/Command.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/SelectioB.h>
#include <Xm/Separator.h>
#include <Xm/Text.h>
#include <Xm/LabelG.h>


#include "uicollector.h"

collector_shell_p collector_shell = (collector_shell_p) NULL;



void collector_shell_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 scrolledList1 = (Widget)NULL;
	Widget menuBar1 = (Widget)NULL;
	Widget cascade1 = (Widget)NULL;
	Widget menu1 = (Widget)NULL;
	Widget separator1 = (Widget)NULL;
	Widget button1 = (Widget)NULL;
	Widget cascade3 = (Widget)NULL;
	Widget menu3 = (Widget)NULL;
	Widget cascade2 = (Widget)NULL;

	if ( !widget_name )
		widget_name = "collector_shell";

	XtSetArg(al[ac], XmNallowShellResize, FALSE); ac++;
	collector_shell = XmCreateDialogShell ( parent, widget_name, al, ac );
	ac = 0;
	_xd_rootwidget = collector_shell;
	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	form_ = XmCreateForm ( collector_shell, "form_", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNchildPlacement, XmPLACE_BELOW_SELECTION); ac++;
	XtSetArg(al[ac], XmNhistoryVisibleItemCount, 6); ac++;
	command_ = XmCreateCommand ( form_, "command_", al, ac );
	ac = 0;
	text_ = XmCommandGetChild ( command_, XmDIALOG_COMMAND_TEXT );

	XtSetArg(al[ac], XmNvisibleItemCount, 11); ac++;
	XtSetArg(al[ac], XmNselectionPolicy, XmMULTIPLE_SELECT); ac++;
	XtSetArg(al[ac], XmNlistSizePolicy, XmRESIZE_IF_POSSIBLE); ac++;
	list_ = XmCreateScrolledList ( form_, "list_", al, ac );
	ac = 0;
	scrolledList1 = XtParent ( list_ );

	menuBar1 = XmCreateMenuBar ( form_, "menuBar1", al, ac );
	cascade1 = XmCreateCascadeButton ( menuBar1, "File", al, ac );
	XtSetArg(al[ac], XmNtearOffModel, XmTEAR_OFF_ENABLED); ac++;
	menu1 = XmCreatePulldownMenu ( menuBar1, "menu1", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNsensitive, FALSE); ac++;
	stop_ = XmCreatePushButton ( menu1, "Stop", al, ac );
	ac = 0;
	separator1 = XmCreateSeparator ( menu1, "separator1", al, ac );
	button1 = XmCreatePushButton ( menu1, "Close", al, ac );
	cascade3 = XmCreateCascadeButton ( menuBar1, "Selection", al, ac );
	XtSetArg(al[ac], XmNtearOffModel, XmTEAR_OFF_ENABLED); ac++;
	menu3 = XmCreatePulldownMenu ( menuBar1, "menu3", al, ac );
	ac = 0;
	remove_ = XmCreatePushButton ( menu3, "Remove", al, ac );
	all_ = XmCreatePushButton ( menu3, "Select All", al, ac );
	none_ = XmCreatePushButton ( menu3, "Select None", al, ac );
	cascade2 = XmCreateCascadeButton ( menuBar1, "Commands", al, ac );
	XtSetArg(al[ac], XmNtearOffModel, XmTEAR_OFF_ENABLED); ac++;
	blocks_ = XmCreatePulldownMenu ( menuBar1, "blocks_", al, ac );
	ac = 0;

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

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopWidget, menuBar1); 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, command_); ac++;
	XtSetValues ( scrolledList1,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 1); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( menuBar1,al, ac );
	ac = 0;
	XtAddCallback (command_, XmNcommandEnteredCallback,&collector_shell_c:: applyCB, (XtPointer) this);
	XtAddCallback (list_, XmNmultipleSelectionCallback,&collector_shell_c:: selectCB, (XtPointer) this);
	XtManageChild(list_);
	XtAddCallback (stop_, XmNactivateCallback,&collector_shell_c:: stopCB, (XtPointer) this);
	XtAddCallback (button1, XmNactivateCallback,&collector_shell_c:: closeCB, (XtPointer) this);
	children[ac++] = stop_;
	children[ac++] = separator1;
	children[ac++] = button1;
	XtManageChildren(children, ac);
	ac = 0;
	XtSetArg(al[ac], XmNsubMenuId, menu1); ac++;
	XtSetValues ( cascade1, al, ac );
	ac = 0;
	XtAddCallback (remove_, XmNactivateCallback,&collector_shell_c:: removeCB, (XtPointer) this);
	XtAddCallback (all_, XmNactivateCallback,&collector_shell_c:: allCB, (XtPointer) this);
	XtAddCallback (none_, XmNactivateCallback,&collector_shell_c:: noneCB, (XtPointer) this);
	children[ac++] = remove_;
	children[ac++] = all_;
	children[ac++] = none_;
	XtManageChildren(children, ac);
	ac = 0;
	XtSetArg(al[ac], XmNsubMenuId, menu3); ac++;
	XtSetValues ( cascade3, al, ac );
	ac = 0;
	XtAddCallback (blocks_, XmNentryCallback,&collector_shell_c:: entryCB, (XtPointer) this);
	XtSetArg(al[ac], XmNsubMenuId, blocks_); ac++;
	XtSetValues ( cascade2, al, ac );
	ac = 0;
	children[ac++] = cascade1;
	children[ac++] = cascade3;
	children[ac++] = cascade2;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = command_;
	children[ac++] = menuBar1;
	XtManageChildren(children, ac);
}

void collector_shell_c::stopCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	collector_shell_p instance = (collector_shell_p) client_data;
	instance->stopCB ( widget, call_data );
}

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

void collector_shell_c::closeCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	collector_shell_p instance = (collector_shell_p) client_data;
	instance->closeCB ( widget, call_data );
}

void collector_shell_c::selectCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	collector_shell_p instance = (collector_shell_p) client_data;
	instance->selectCB ( widget, call_data );
}

void collector_shell_c::applyCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	collector_shell_p instance = (collector_shell_p) client_data;
	instance->applyCB ( widget, call_data );
}

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

void collector_shell_c::noneCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	collector_shell_p instance = (collector_shell_p) client_data;
	instance->noneCB ( widget, call_data );
}

void collector_shell_c::allCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	collector_shell_p instance = (collector_shell_p) client_data;
	instance->allCB ( widget, call_data );
}

