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

#include "Tab.h"
#include <Xm/Protocols.h>

#include "uipanel.h"

panel_window_p panel_top = (panel_window_p) NULL;



void panel_top_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 menu1 = (Widget)NULL;
	Widget button1 = (Widget)NULL;
	Widget separator1 = (Widget)NULL;
	Widget separator3 = (Widget)NULL;
	Widget button2 = (Widget)NULL;
	Widget menu2 = (Widget)NULL;
	Widget separator2 = (Widget)NULL;
	Widget menu3 = (Widget)NULL;
	Widget button3 = (Widget)NULL;

	if ( !widget_name )
		widget_name = "panel_top";

	XtSetArg(al[ac], XmNallowShellResize, FALSE); ac++;
	XtSetArg(al[ac], XmNtransient, FALSE); ac++;
	panel_top = XtCreatePopupShell ( widget_name, topLevelShellWidgetClass, parent, al, ac );
	ac = 0;
	_xd_rootwidget = panel_top;
	XmAddWMProtocolCallback( panel_top, XmInternAtom(XtDisplay(panel_top), "WM_DELETE_WINDOW", False),&panel_top_c:: unmapCB, (XtPointer) this);
	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	form_ = XmCreateForm ( panel_top, "form_", al, ac );
	ac = 0;
#define XmCreateDrawingArea CreateTab
	tab_ = XmCreateDrawingArea ( form_, "tab_", al, ac );
	ac = 0;
	menubar_ = XmCreateMenuBar ( form_, "menubar_", al, ac );
	file_menu = XmCreateCascadeButton ( menubar_, "file_menu", al, ac );
	XtSetArg(al[ac], XmNtearOffModel, XmTEAR_OFF_ENABLED); ac++;
	menu1 = XmCreatePulldownMenu ( menubar_, "menu1", al, ac );
	ac = 0;
	button1 = XmCreatePushButton ( menu1, "new_window", al, ac );
	separator1 = XmCreateSeparator ( menu1, "separator1", al, ac );
	save_ = XmCreatePushButton ( menu1, "Save...", al, ac );
	print_ = XmCreatePushButton ( menu1, "Print...", al, ac );
	separator3 = XmCreateSeparator ( menu1, "separator3", al, ac );
	button2 = XmCreatePushButton ( menu1, "close", al, ac );
	options_menu = XmCreateCascadeButton ( menubar_, "options_menu", al, ac );
	XtSetArg(al[ac], XmNtearOffModel, XmTEAR_OFF_ENABLED); ac++;
	menu2 = XmCreatePulldownMenu ( menubar_, "menu2", al, ac );
	ac = 0;
	detached_ = XmCreateToggleButton ( menu2, "detached_", al, ac );
	frozen_ = XmCreateToggleButton ( menu2, "current_node", al, ac );
	separator2 = XmCreateSeparator ( menu2, "separator2", al, ac );
	XtSetArg(al[ac], XmNset, TRUE); ac++;
	close_on_apply_ = XmCreateToggleButton ( menu2, "close_on_apply_", al, ac );
	ac = 0;
	help_menu = XmCreateCascadeButton ( menubar_, "help_menu", al, ac );
	XtSetArg(al[ac], XmNtearOffModel, XmTEAR_OFF_ENABLED); ac++;
	menu3 = XmCreatePulldownMenu ( menubar_, "menu3", al, ac );
	ac = 0;
	button3 = XmCreatePushButton ( menu3, "button3", al, ac );
	XtSetArg(al[ac], XmNmenuHelpWidget, help_menu); ac++;
	XtSetValues ( menubar_,al, ac );
	ac = 0;

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

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( menubar_,al, ac );
	ac = 0;
	XtAddCallback (form_, XmNunmapCallback,&panel_top_c:: unmapCB, (XtPointer) this);
	XtAddCallback (form_, XmNmapCallback,&panel_top_c:: mapCB, (XtPointer) this);
	XtAddCallback (tab_, XmNresizeCallback,&panel_top_c:: resizeCB, (XtPointer) this);
	XtAddCallback (button1, XmNactivateCallback,&panel_top_c:: cloneCB, (XtPointer) this);
	XtAddCallback (save_, XmNactivateCallback,&panel_top_c:: saveCB, (XtPointer) this);
	XtAddCallback (print_, XmNactivateCallback,&panel_top_c:: printCB, (XtPointer) this);
	XtAddCallback (button2, XmNactivateCallback,&panel_top_c:: unmapCB, (XtPointer) this);
	children[ac++] = button1;
	children[ac++] = separator1;
	children[ac++] = save_;
	children[ac++] = print_;
	children[ac++] = separator3;
	children[ac++] = button2;
	XtManageChildren(children, ac);
	ac = 0;
	XtSetArg(al[ac], XmNsubMenuId, menu1); ac++;
	XtSetValues ( file_menu, al, ac );
	ac = 0;
	XtAddCallback (detached_, XmNvalueChangedCallback,&panel_top_c:: freezeCB, (XtPointer) this);
	XtAddCallback (frozen_, XmNvalueChangedCallback,&panel_top_c:: nodeCB, (XtPointer) this);
	children[ac++] = detached_;
	children[ac++] = frozen_;
	children[ac++] = separator2;
	children[ac++] = close_on_apply_;
	XtManageChildren(children, ac);
	ac = 0;
	XtSetArg(al[ac], XmNsubMenuId, menu2); ac++;
	XtSetValues ( options_menu, al, ac );
	ac = 0;
	children[ac++] = button3;
	XtManageChildren(children, ac);
	ac = 0;
	XtSetArg(al[ac], XmNsubMenuId, menu3); ac++;
	XtSetValues ( help_menu, al, ac );
	ac = 0;
	children[ac++] = file_menu;
	children[ac++] = options_menu;
	children[ac++] = help_menu;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = tab_;
	children[ac++] = menubar_;
	XtManageChildren(children, ac);
	XtManageChild ( form_);
}

void panel_top_c::printCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	panel_top_p instance = (panel_top_p) client_data;
	instance->printCB ( widget, call_data );
}

void panel_top_c::saveCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	panel_top_p instance = (panel_top_p) client_data;
	instance->saveCB ( widget, call_data );
}

void panel_top_c::resizeCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	panel_top_p instance = (panel_top_p) client_data;
	instance->resizeCB ( widget, call_data );
}

void panel_top_c::freezeCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	panel_top_p instance = (panel_top_p) client_data;
	instance->freezeCB ( widget, call_data );
}

void panel_top_c::nodeCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	panel_top_p instance = (panel_top_p) client_data;
	instance->nodeCB ( widget, call_data );
}

void panel_top_c::cloneCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	panel_top_p instance = (panel_top_p) client_data;
	instance->cloneCB ( widget, call_data );
}

void panel_top_c::unmapCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	panel_top_p instance = (panel_top_p) client_data;
	instance->unmapCB ( widget, call_data );
}

void panel_top_c::mapCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	panel_top_p instance = (panel_top_p) client_data;
	instance->mapCB ( widget, call_data );
}

