/*
** 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/MessageB.h>
#include <Xm/TextF.h>
#include <Xm/LabelG.h>
#include <Xm/PushBG.h>
#include <Xm/SeparatoG.h>


#include "uiask.h"

ask_shell_p ask_shell = (ask_shell_p) NULL;



void ask_shell_c::create (Widget parent, char *widget_name)
{
	Widget children[7];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	// Widget button20 = (Widget)NULL; /* 20150819 */
	Widget button21 = (Widget)NULL;
	// Widget button22 = (Widget)NULL;

	if ( !widget_name )
		widget_name = "ask_shell";

	XtSetArg(al[ac], XmNallowShellResize, TRUE); ac++;
	XtSetArg(al[ac], XmNtransient, TRUE); ac++;
	ask_shell = XmCreateDialogShell ( parent, widget_name, al, ac );
	ac = 0;
	_xd_rootwidget = ask_shell;
	XtSetArg(al[ac], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); ac++;
	XtSetArg(al[ac], XmNdialogType, XmDIALOG_QUESTION); ac++;
	XtSetArg(al[ac], XmNmessageAlignment, XmALIGNMENT_CENTER); ac++;
	XtSetArg(al[ac], XmNdefaultButtonType, XmDIALOG_CANCEL_BUTTON); ac++;
	form_ = XmCreateMessageBox ( ask_shell, "form_", al, ac );
	ac = 0;
	// button20 = 
	XmMessageBoxGetChild ( form_, XmDIALOG_CANCEL_BUTTON );
	button21 = XmMessageBoxGetChild ( form_, XmDIALOG_HELP_BUTTON );
	label_ = XmMessageBoxGetChild ( form_, XmDIALOG_MESSAGE_LABEL );
	// button22 = 
	XmMessageBoxGetChild ( form_, XmDIALOG_OK_BUTTON );
	XtSetArg(al[ac], XmNsensitive, FALSE); ac++;
	XtSetValues ( button21,al, ac );
	ac = 0;
	value_ = XmCreateTextField ( form_, "value_", al, ac );
	XtAddCallback (form_, XmNokCallback,&ask_shell_c:: okCB, (XtPointer) this);
	XtAddCallback (form_, XmNcancelCallback,&ask_shell_c:: cancelCB, (XtPointer) this);
	XtAddCallback (form_, XmNhelpCallback,&ask_shell_c:: helpCB, (XtPointer) this);
	children[ac++] = value_;
	XtManageChildren(children, ac);
}

void ask_shell_c::helpCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	ask_shell_p instance = (ask_shell_p) client_data;
	instance->helpCB ( widget, call_data );
}

void ask_shell_c::cancelCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	ask_shell_p instance = (ask_shell_p) client_data;
	instance->cancelCB ( widget, call_data );
}

void ask_shell_c::okCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	ask_shell_p instance = (ask_shell_p) client_data;
	instance->okCB ( widget, call_data );
}

