/*
** 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/FileSB.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/SelectioB.h>
#include <Xm/Separator.h>
#include <Xm/Text.h>
#include <Xm/TextF.h>
#include <Xm/LabelG.h>
#include <Xm/PushBG.h>
#include <Xm/SeparatoG.h>


#include "accelerator.h"

extern void OpenCallback(Widget, XtPointer, XtPointer) ;
extern void ReadCallback(Widget, XtPointer, XtPointer) ;
extern void SaveCallback(Widget, XtPointer, XtPointer) ;
extern void SaveAsCallback(Widget, XtPointer, XtPointer) ;
extern void ExitCallback(Widget, XtPointer, XtPointer) ;
extern void AboutCallback(Widget, XtPointer, XtPointer) ;

static Widget xd_links [ 2 ];

void XDmanage_link( Widget w, XtPointer client_data, XtPointer call_data)
{
	if (client_data && *(Widget *) client_data)
		XtManageChild(*(Widget *) client_data);
}

void XDunmanage_link( Widget w, XtPointer client_data, XtPointer call_data)
{
	if (client_data && *(Widget *) client_data)
		XtUnmanageChild(*(Widget *) client_data);
}

void XDpopup_link( Widget w, XtPointer client_data, XtPointer call_data)
{
	if (client_data && *(Widget *) client_data)
		XtPopup(*(Widget *) client_data, XtGrabNone);
}

void XDpopdown_link( Widget w, XtPointer client_data, XtPointer call_data)
{
	if (client_data && *(Widget *) client_data)
		XtPopdown(*(Widget *) client_data);
}

void XDmap_link( Widget w, XtPointer client_data, XtPointer call_data)
{
	if (client_data && *(Widget *) client_data)
		XtMapWidget(*(Widget *) client_data);
}

void XDunmap_link( Widget w, XtPointer client_data, XtPointer call_data)
{
	if (client_data && *(Widget *) client_data)
		XtUnmapWidget(*(Widget *) client_data);
}

void XDenable_link( Widget w, XtPointer client_data, XtPointer call_data)
{
	if (client_data && *(Widget *) client_data)
		XtSetSensitive(*(Widget *) client_data, TRUE);
}

void XDdisable_link( Widget w, XtPointer client_data, XtPointer call_data)
{
	if (client_data && *(Widget *) client_data)
		XtSetSensitive(*(Widget *) client_data, FALSE);
}

Widget main_shell = (Widget) NULL;
Widget main_form = (Widget) NULL;
Widget main_menubar = (Widget) NULL;
Widget main_file_cascade = (Widget) NULL;
Widget main_file_menu = (Widget) NULL;
Widget main_fm_open = (Widget) NULL;
Widget main_fm_read = (Widget) NULL;
Widget main_fm_save = (Widget) NULL;
Widget main_fm_saveas = (Widget) NULL;
Widget main_fm_exit = (Widget) NULL;
Widget main_help_cascade = (Widget) NULL;
Widget main_help_menu = (Widget) NULL;
Widget main_help_about = (Widget) NULL;
Widget dialog_shell = (Widget) NULL;
Widget dialog_form = (Widget) NULL;
Widget about_shell = (Widget) NULL;
Widget about_form = (Widget) NULL;
Widget about_label = (Widget) NULL;
Widget about_cancel = (Widget) NULL;
Widget fsb_shell = (Widget) NULL;
Widget fsb = (Widget) NULL;



void create_main_shell (Display *display, char *app_name, int app_argc, char **app_argv)
{
	Widget children[6];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	XrmValue from_value, to_value; /* For resource conversion */
	XtPointer tmp_value;             /* ditto */
	XmString xmstrings[16];    /* temporary storage for XmStrings */
	Widget separator1 = (Widget)NULL;
	Widget label1 = (Widget)NULL;
	Widget text1 = (Widget)NULL;
	Widget label2 = (Widget)NULL;
	Widget text2 = (Widget)NULL;
	Widget separator5 = (Widget)NULL;

	XtSetArg(al[ac], XmNallowShellResize, TRUE); ac++;
	XtSetArg(al[ac], XmNtitle, "Accelerators Main Dialog"); ac++;
	XtSetArg(al[ac], XmNargc, app_argc); ac++;
	XtSetArg(al[ac], XmNargv, app_argv); ac++;
	main_shell = XtAppCreateShell ( app_name, (char *) "XApplication", applicationShellWidgetClass, display, al, ac );

	ac = 0;
	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	main_form = XmCreateForm ( main_shell, (char *) "main_form", al, ac );
	ac = 0;
	main_menubar = XmCreateMenuBar ( main_form, (char *) "main_menubar", al, ac );
	xmstrings[0] = XmStringCreateLtoR ( "File", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	from_value.addr = "F" ;
	from_value.size = strlen( from_value.addr ) + 1;
	to_value.addr = NULL;
	XtConvertAndStore (main_menubar, XmRString, &from_value, XmRKeySym, &to_value);
	if ( to_value.addr )
	{
		XtSetArg(al[ac], XmNmnemonic, (*((KeySym*) to_value.addr))); ac++;
	}
	main_file_cascade = XmCreateCascadeButton ( main_menubar, (char *) "main_file_cascade", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	main_file_menu = XmCreatePulldownMenu ( main_menubar, (char *) "main_file_menu", al, ac );
	xmstrings[0] = XmStringCreateLtoR ( "Open...", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	from_value.addr = "O" ;
	from_value.size = strlen( from_value.addr ) + 1;
	to_value.addr = NULL;
	XtConvertAndStore (main_file_menu, XmRString, &from_value, XmRKeySym, &to_value);
	if ( to_value.addr )
	{
		XtSetArg(al[ac], XmNmnemonic, (*((KeySym*) to_value.addr))); ac++;
	}
	XtSetArg(al[ac], XmNaccelerator, "Ctrl<Key>O"); ac++;
	xmstrings[1] = XmStringCreateLtoR ( "Ctrl + O", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNacceleratorText, xmstrings[1]); ac++;
	main_fm_open = XmCreatePushButton ( main_file_menu, (char *) "main_fm_open", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XmStringFree ( xmstrings [ 1 ] );
	xmstrings[0] = XmStringCreateLtoR ( "Read...", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	from_value.addr = "R" ;
	from_value.size = strlen( from_value.addr ) + 1;
	to_value.addr = NULL;
	XtConvertAndStore (main_file_menu, XmRString, &from_value, XmRKeySym, &to_value);
	if ( to_value.addr )
	{
		XtSetArg(al[ac], XmNmnemonic, (*((KeySym*) to_value.addr))); ac++;
	}
	XtSetArg(al[ac], XmNaccelerator, "Ctrl<Key>R"); ac++;
	xmstrings[1] = XmStringCreateLtoR ( "Ctrl + R", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNacceleratorText, xmstrings[1]); ac++;
	main_fm_read = XmCreatePushButton ( main_file_menu, (char *) "main_fm_read", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XmStringFree ( xmstrings [ 1 ] );
	xmstrings[0] = XmStringCreateLtoR ( "Save...", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	from_value.addr = "S" ;
	from_value.size = strlen( from_value.addr ) + 1;
	to_value.addr = NULL;
	XtConvertAndStore (main_file_menu, XmRString, &from_value, XmRKeySym, &to_value);
	if ( to_value.addr )
	{
		XtSetArg(al[ac], XmNmnemonic, (*((KeySym*) to_value.addr))); ac++;
	}
	XtSetArg(al[ac], XmNaccelerator, "Ctrl<Key>S"); ac++;
	xmstrings[1] = XmStringCreateLtoR ( "Ctrl + S", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNacceleratorText, xmstrings[1]); ac++;
	main_fm_save = XmCreatePushButton ( main_file_menu, (char *) "main_fm_save", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XmStringFree ( xmstrings [ 1 ] );
	xmstrings[0] = XmStringCreateLtoR ( "Save As...", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	from_value.addr = "A" ;
	from_value.size = strlen( from_value.addr ) + 1;
	to_value.addr = NULL;
	XtConvertAndStore (main_file_menu, XmRString, &from_value, XmRKeySym, &to_value);
	if ( to_value.addr )
	{
		XtSetArg(al[ac], XmNmnemonic, (*((KeySym*) to_value.addr))); ac++;
	}
	XtSetArg(al[ac], XmNaccelerator, "Ctrl<Key>A"); ac++;
	xmstrings[1] = XmStringCreateLtoR ( "Ctrl + A", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNacceleratorText, xmstrings[1]); ac++;
	main_fm_saveas = XmCreatePushButton ( main_file_menu, (char *) "main_fm_saveas", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XmStringFree ( xmstrings [ 1 ] );
	separator1 = XmCreateSeparator ( main_file_menu, (char *) "separator1", al, ac );
	xmstrings[0] = XmStringCreateLtoR ( "Exit", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	from_value.addr = "X" ;
	from_value.size = strlen( from_value.addr ) + 1;
	to_value.addr = NULL;
	XtConvertAndStore (main_file_menu, XmRString, &from_value, XmRKeySym, &to_value);
	if ( to_value.addr )
	{
		XtSetArg(al[ac], XmNmnemonic, (*((KeySym*) to_value.addr))); ac++;
	}
	XtSetArg(al[ac], XmNaccelerator, "Ctrl<Key>X"); ac++;
	xmstrings[1] = XmStringCreateLtoR ( "Ctrl + X", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNacceleratorText, xmstrings[1]); ac++;
	main_fm_exit = XmCreatePushButton ( main_file_menu, (char *) "main_fm_exit", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XmStringFree ( xmstrings [ 1 ] );
	xmstrings[0] = XmStringCreateLtoR ( "Help", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	from_value.addr = "H" ;
	from_value.size = strlen( from_value.addr ) + 1;
	to_value.addr = NULL;
	XtConvertAndStore (main_menubar, XmRString, &from_value, XmRKeySym, &to_value);
	if ( to_value.addr )
	{
		XtSetArg(al[ac], XmNmnemonic, (*((KeySym*) to_value.addr))); ac++;
	}
	main_help_cascade = XmCreateCascadeButton ( main_menubar, (char *) "main_help_cascade", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	main_help_menu = XmCreatePulldownMenu ( main_menubar, (char *) "main_help_menu", al, ac );
	xmstrings[0] = XmStringCreateLtoR ( "Help about Accelerators...", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	from_value.addr = "H" ;
	from_value.size = strlen( from_value.addr ) + 1;
	to_value.addr = NULL;
	XtConvertAndStore (main_help_menu, XmRString, &from_value, XmRKeySym, &to_value);
	if ( to_value.addr )
	{
		XtSetArg(al[ac], XmNmnemonic, (*((KeySym*) to_value.addr))); ac++;
	}
	XtSetArg(al[ac], XmNaccelerator, "Ctrl<Key>H"); ac++;
	xmstrings[1] = XmStringCreateLtoR ( "Ctrl + H", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNacceleratorText, xmstrings[1]); ac++;
	main_help_about = XmCreatePushButton ( main_help_menu, (char *) "main_help_about", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XmStringFree ( xmstrings [ 1 ] );
	label1 = XmCreateLabel ( main_form, (char *) "label1", al, ac );
	text1 = XmCreateTextField ( main_form, (char *) "text1", al, ac );
	label2 = XmCreateLabel ( main_form, (char *) "label2", al, ac );
	text2 = XmCreateTextField ( main_form, (char *) "text2", al, ac );
	XtSetArg(al[ac], XmNseparatorType, XmNO_LINE); ac++;
	separator5 = XmCreateSeparator ( main_form, (char *) "separator5", al, ac );
	ac = 0;


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

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNtopWidget, text1); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomWidget, text1); 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, text1); ac++;
	XtSetValues ( label1,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 5); ac++;
	XtSetArg(al[ac], XmNtopWidget, main_menubar); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 35); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( text1,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNtopWidget, text2); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomWidget, text2); 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, text2); ac++;
	XtSetValues ( label2,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 5); ac++;
	XtSetArg(al[ac], XmNtopWidget, text1); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 35); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( text2,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 5); ac++;
	XtSetArg(al[ac], XmNtopWidget, text2); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( separator5,al, ac );
	ac = 0;
	if (main_fm_open)
		XtAddCallback( main_fm_open, XmNactivateCallback, OpenCallback, (XtPointer) 0 );
	if (main_fm_read)
		XtAddCallback( main_fm_read, XmNactivateCallback, ReadCallback, (XtPointer) 0 );
	if (main_fm_save)
		XtAddCallback( main_fm_save, XmNactivateCallback, SaveCallback, (XtPointer) 0 );
	if (main_fm_saveas)
		XtAddCallback( main_fm_saveas, XmNactivateCallback, SaveAsCallback, (XtPointer) 0 );
	if (main_fm_exit)
		XtAddCallback( main_fm_exit, XmNactivateCallback, ExitCallback, (XtPointer) 0 );
	if ((children[ac] = main_fm_open) != (Widget) 0) { ac++; }
	if ((children[ac] = main_fm_read) != (Widget) 0) { ac++; }
	if ((children[ac] = main_fm_save) != (Widget) 0) { ac++; }
	if ((children[ac] = main_fm_saveas) != (Widget) 0) { ac++; }
	if ((children[ac] = separator1) != (Widget) 0) { ac++; }
	if ((children[ac] = main_fm_exit) != (Widget) 0) { ac++; }
	if (ac > 0) { XtManageChildren(children, ac); }
	ac = 0;
	XtSetArg(al[ac], XmNsubMenuId, main_file_menu); ac++;
	XtSetValues(main_file_cascade, al, ac );
	ac = 0;
	if (main_help_about)
		XtAddCallback( main_help_about, XmNactivateCallback, AboutCallback, (XtPointer) 0 );
	if ((children[ac] = main_help_about) != (Widget) 0) { ac++; }
	if (ac > 0) { XtManageChildren(children, ac); }
	ac = 0;
	XtSetArg(al[ac], XmNsubMenuId, main_help_menu); ac++;
	XtSetValues(main_help_cascade, al, ac );
	ac = 0;
	if ((children[ac] = main_file_cascade) != (Widget) 0) { ac++; }
	if ((children[ac] = main_help_cascade) != (Widget) 0) { ac++; }
	if (ac > 0) { XtManageChildren(children, ac); }
	ac = 0;
	if ((children[ac] = main_menubar) != (Widget) 0) { ac++; }
	if ((children[ac] = label1) != (Widget) 0) { ac++; }
	if ((children[ac] = text1) != (Widget) 0) { ac++; }
	if ((children[ac] = label2) != (Widget) 0) { ac++; }
	if ((children[ac] = text2) != (Widget) 0) { ac++; }
	if ((children[ac] = separator5) != (Widget) 0) { ac++; }
	if (ac > 0) { XtManageChildren(children, ac); }
	ac = 0;
	if (main_form != (Widget) 0) { XtManageChild ( main_form); }
}


void create_dialog_shell (Widget parent)
{
	Widget children[10];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	XtPointer tmp_value;             /* ditto */
	Widget label3 = (Widget)NULL;
	Widget text3 = (Widget)NULL;
	Widget label4 = (Widget)NULL;
	Widget text4 = (Widget)NULL;
	Widget label5 = (Widget)NULL;
	Widget text5 = (Widget)NULL;
	Widget separator2 = (Widget)NULL;
	Widget button7 = (Widget)NULL;
	Widget button8 = (Widget)NULL;
	Widget button9 = (Widget)NULL;

	XtSetArg(al[ac], XmNallowShellResize, TRUE); ac++;
	XtSetArg(al[ac], XmNtitle, "Accelerators Sub-dialog"); ac++;
	dialog_shell = XmCreateDialogShell ( parent, (char *) "dialog_shell", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	XtSetArg(al[ac], XmNfractionBase, 7); ac++;
	dialog_form = XmCreateForm ( dialog_shell, (char *) "dialog_form", al, ac );
	ac = 0;
	label3 = XmCreateLabel ( dialog_form, (char *) "label3", al, ac );
	text3 = XmCreateTextField ( dialog_form, (char *) "text3", al, ac );
	label4 = XmCreateLabel ( dialog_form, (char *) "label4", al, ac );
	text4 = XmCreateTextField ( dialog_form, (char *) "text4", al, ac );
	label5 = XmCreateLabel ( dialog_form, (char *) "label5", al, ac );
	text5 = XmCreateText ( dialog_form, (char *) "text5", al, ac );
	separator2 = XmCreateSeparator ( dialog_form, (char *) "separator2", al, ac );
	button7 = XmCreatePushButton ( dialog_form, (char *) "button7", al, ac );
	button8 = XmCreatePushButton ( dialog_form, (char *) "button8", al, ac );
	button9 = XmCreatePushButton ( dialog_form, (char *) "button9", al, ac );


	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNtopWidget, text3); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomWidget, text3); 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, text3); ac++;
	XtSetValues ( label3,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 5); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 3); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( text3,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNtopWidget, text4); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomWidget, text4); 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, text4); ac++;
	XtSetValues ( label4,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 5); ac++;
	XtSetArg(al[ac], XmNtopWidget, text3); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 3); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( text4,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 5); ac++;
	XtSetArg(al[ac], XmNtopWidget, text4); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 5); ac++;
	XtSetValues ( label5,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNtopWidget, label5); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 5); ac++;
	XtSetArg(al[ac], XmNbottomWidget, separator2); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( text5,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 5); ac++;
	XtSetArg(al[ac], XmNbottomWidget, button7); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( separator2,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 5); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 1); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNrightPosition, 2); ac++;
	XtSetValues ( button7,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNtopWidget, button7); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 3); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNrightPosition, 4); ac++;
	XtSetValues ( button8,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNtopWidget, button8); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 5); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNrightPosition, 6); ac++;
	XtSetValues ( button9,al, ac );
	ac = 0;
	if ((children[ac] = label3) != (Widget) 0) { ac++; }
	if ((children[ac] = text3) != (Widget) 0) { ac++; }
	if ((children[ac] = label4) != (Widget) 0) { ac++; }
	if ((children[ac] = text4) != (Widget) 0) { ac++; }
	if ((children[ac] = label5) != (Widget) 0) { ac++; }
	if ((children[ac] = text5) != (Widget) 0) { ac++; }
	if ((children[ac] = separator2) != (Widget) 0) { ac++; }
	if ((children[ac] = button7) != (Widget) 0) { ac++; }
	if ((children[ac] = button8) != (Widget) 0) { ac++; }
	if ((children[ac] = button9) != (Widget) 0) { ac++; }
	if (ac > 0) { XtManageChildren(children, ac); }
	ac = 0;
}


void create_about_shell (Widget parent)
{
	Widget children[3];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	XtPointer tmp_value;             /* ditto */
	XmString xmstrings[16];    /* temporary storage for XmStrings */
	Widget separator4 = (Widget)NULL;

	XtSetArg(al[ac], XmNallowShellResize, TRUE); ac++;
	XtSetArg(al[ac], XmNtitle, "About Accelerators"); ac++;
	about_shell = XmCreateDialogShell ( parent, (char *) "about_shell", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNautoUnmanage, TRUE); ac++;
	about_form = XmCreateForm ( about_shell, (char *) "about_form", al, ac );
	ac = 0;
	xmstrings[0] = XmStringCreateLtoR ( "Simple Accelerator Transference\nusing Grab and Event Handlers\ninstalled on the target shells.\n\nWritten by A.J.Fountain,\nIST,\nafter code by Mark Riches and Alistair George.", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	about_label = XmCreateLabel ( about_form, (char *) "about_label", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	separator4 = XmCreateSeparator ( about_form, (char *) "separator4", al, ac );
	xmstrings[0] = XmStringCreateLtoR ( "Cancel", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	about_cancel = XmCreatePushButton ( about_form, (char *) "about_cancel", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNcancelButton, about_cancel); ac++;
	XtSetArg(al[ac], XmNdefaultButton, about_cancel); ac++;
	XtSetValues ( about_form, al, ac );
	ac = 0;
	xd_links [0] = about_form;


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

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 5); ac++;
	XtSetArg(al[ac], XmNbottomWidget, about_cancel); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( separator4,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 5); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 40); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNrightPosition, 60); ac++;
	XtSetValues ( about_cancel,al, ac );
	ac = 0;
	XtAddCallback (about_cancel,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[0] );
	if ((children[ac] = about_label) != (Widget) 0) { ac++; }
	if ((children[ac] = separator4) != (Widget) 0) { ac++; }
	if ((children[ac] = about_cancel) != (Widget) 0) { ac++; }
	if (ac > 0) { XtManageChildren(children, ac); }
	ac = 0;
}


void create_fsb_shell (Widget parent)
{
	Widget children[13];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	XtPointer tmp_value;             /* ditto */
	Widget button11 = (Widget)NULL;
	Widget button13 = (Widget)NULL;

	XtSetArg(al[ac], XmNallowShellResize, TRUE); ac++;
	XtSetArg(al[ac], XmNtitle, "File Select"); ac++;
	fsb_shell = XmCreateDialogShell ( parent, (char *) "fsb_shell", al, ac );
	ac = 0;
	fsb = XmCreateFileSelectionBox ( fsb_shell, (char *) "fsb", al, ac );
	button11 = XmSelectionBoxGetChild ( fsb, XmDIALOG_CANCEL_BUTTON );
	button13 = XmSelectionBoxGetChild ( fsb, XmDIALOG_OK_BUTTON );


	xd_links [1] = fsb;

	XtAddCallback (button11,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[1] );
	XtAddCallback (button13,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[1] );
}

