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


#include "uipasswd.h"

passwd_shell_p passwd_shell = (passwd_shell_p) NULL;



void passwd_shell_c::create (Widget parent, char *widget_name)
{
	Widget children[8];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	XmString xmstrings[16];    /* temporary storage for XmStrings */
	Widget form1 = (Widget)NULL;
	Widget label3 = (Widget)NULL;
	Widget separator3 = (Widget)NULL;

	if ( !widget_name )
		widget_name = "passwd_shell";

	XtSetArg(al[ac], XmNallowShellResize, TRUE); ac++;
	passwd_shell = XmCreateDialogShell ( parent, widget_name, al, ac );
	ac = 0;
	_xd_rootwidget = passwd_shell;
	XtSetArg(al[ac], XmNdialogType, XmDIALOG_PROMPT); ac++;
	form_ = XmCreateSelectionBox ( passwd_shell, "form_", al, ac );
	ac = 0;
	password = XmSelectionBoxGetChild ( form_, XmDIALOG_SELECTION_LABEL );
	passwd_ = XmSelectionBoxGetChild ( form_, XmDIALOG_TEXT );
	xmstrings[0] = XmStringCreateLtoR ( "Password:", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	XtSetValues ( password,al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	form1 = XmCreateForm ( form_, "form1", al, ac );
	user_ = XmCreateTextField ( form1, "user_", al, ac );
	XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
	label3 = XmCreateLabel ( form1, "User:", al, ac );
	ac = 0;
	label_ = XmCreateLabel ( form1, "label_", al, ac );
	separator3 = XmCreateSeparator ( form1, "separator3", al, ac );
	XtAddCallback (form_, XmNokCallback,&passwd_shell_c:: okCB, (XtPointer) this);
	XtAddCallback (form_, XmNcancelCallback,&passwd_shell_c:: cancelCB, (XtPointer) this);
	XtAddCallback (form_, XmNhelpCallback,&passwd_shell_c:: helpCB, (XtPointer) this);
	XtAddCallback (passwd_, XmNvalueChangedCallback,&passwd_shell_c:: modifyCB, (XtPointer) this);

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

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

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( label_,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopWidget, label_); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( separator3,al, ac );
	ac = 0;
	XtAddCallback (user_, XmNmodifyVerifyCallback,&passwd_shell_c:: modifyCB, (XtPointer) this);
	children[ac++] = user_;
	children[ac++] = label3;
	children[ac++] = label_;
	children[ac++] = separator3;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = form1;
	XtManageChildren(children, ac);
}

void passwd_shell_c::modifyCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	passwd_shell_p instance = (passwd_shell_p) client_data;
	instance->modifyCB ( widget, call_data );
}

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

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

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

