/*
** Generated Code
*/
/*
**LIBS: -lXm -lXt -lX11
*/

#include <X11/Xatom.h>
#include <X11/Intrinsic.h>
#include <X11/Shell.h>

#include <Xm/Xm.h>
#include <Xm/DialogS.h>
#include <Xm/DrawingA.h>
#include <Xm/PushB.h>
#include <Xm/RowColumn.h>
#include <Xm/TextF.h>

#include <xdclass.h>

class textf_popup_c: public xd_XmPopupMenu_c {
public:
	virtual void create (Widget parent, char *widget_name = NULL);
protected:
	Widget textf_popup;
	Widget cut_b;
	Widget copy_b;
	Widget paste_b;
};

typedef textf_popup_c *textf_popup_p;

class textf_base_c: public xd_XmTextField_c {
public:
	virtual void create (Widget parent, char *widget_name = NULL);
protected:
	Widget textf_base;
};

typedef textf_base_c *textf_base_p;
class textf_c;
typedef textf_c *textf_p;

Widget widget1 = (Widget) NULL;
textf_popup_p textf_popup = (textf_popup_p) NULL;



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

	if ( !widget_name )
		widget_name = "textf_popup";

	XtSetArg(al[ac], XmNmenuPost, "<Button3>"); ac++;
	textf_popup = XmCreatePopupMenu ( parent, widget_name, al, ac );
	ac = 0;
	_xd_rootwidget = textf_popup;
	xmstrings[0] = XmStringCreateLtoR("Cut", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	cut_b = XmCreatePushButton ( textf_popup, "cut_b", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR("Copy", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	copy_b = XmCreatePushButton ( textf_popup, "copy_b", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR("Paste", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG);
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	paste_b = XmCreatePushButton ( textf_popup, "paste_b", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	children[ac++] = cut_b;
	children[ac++] = copy_b;
	children[ac++] = paste_b;
	XtManageChildren(children, ac);
	ac = 0;
}


void textf_base_c::create (Widget parent, char *widget_name)
{
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */

	if ( !widget_name )
		widget_name = "textf_base";

	textf_base = XmCreateTextField ( parent, widget_name, al, ac );
	_xd_rootwidget = textf_base;
}

