/*
** 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/PushB.h>
#include <Xm/RowColumn.h>
#include <Xm/TextF.h>


#include "uiedit_meter.h"

edit_meter_p edit_meter_form = (edit_meter_p) NULL;



void edit_meter_form_c::create (Widget parent, char *widget_name)
{
	Widget children[8];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	Widget rowcol1 = (Widget)NULL;
	Widget label1 = (Widget)NULL;
	Widget label2 = (Widget)NULL;
	Widget label3 = (Widget)NULL;
	Widget label4 = (Widget)NULL;
	Widget button1 = (Widget)NULL;

	if ( !widget_name )
		widget_name = "edit_meter_form";

	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	edit_meter_form = XmCreateForm ( parent, widget_name, al, ac );
	ac = 0;
	_xd_rootwidget = edit_meter_form;
	XtSetArg(al[ac], XmNnumColumns, 2); ac++;
	XtSetArg(al[ac], XmNpacking, XmPACK_COLUMN); ac++;
	rowcol1 = XmCreateRowColumn ( edit_meter_form, "rowcol1", al, ac );
	ac = 0;
	label1 = XmCreateLabel ( rowcol1, "Minimum", al, ac );
	label2 = XmCreateLabel ( rowcol1, "Value", al, ac );
	label3 = XmCreateLabel ( rowcol1, "Maximum", al, ac );
	label4 = XmCreateLabel ( rowcol1, "Threshold", al, ac );
	XtSetArg(al[ac], XmNsensitive, FALSE); ac++;
	XtSetArg(al[ac], XmNeditable, FALSE); ac++;
	min_ = XmCreateTextField ( rowcol1, "min_", al, ac );
	ac = 0;
	value_ = XmCreateTextField ( rowcol1, "value_", al, ac );
	XtSetArg(al[ac], XmNsensitive, FALSE); ac++;
	XtSetArg(al[ac], XmNeditable, FALSE); ac++;
	max_ = XmCreateTextField ( rowcol1, "max_", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNsensitive, FALSE); ac++;
	XtSetArg(al[ac], XmNeditable, FALSE); ac++;
	threshold_ = XmCreateTextField ( rowcol1, "threshold_", al, ac );
	ac = 0;
	tools_ = XmCreateRowColumn ( edit_meter_form, "tools_", al, ac );
	button1 = XmCreatePushButton ( tools_, "Apply", al, ac );

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopWidget, tools_); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( rowcol1,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( tools_,al, ac );
	ac = 0;
	XtAddCallback (min_, XmNvalueChangedCallback,&edit_meter_form_c:: changedCB, (XtPointer) this);
	XtAddCallback (value_, XmNvalueChangedCallback,&edit_meter_form_c:: changedCB, (XtPointer) this);
	XtAddCallback (max_, XmNvalueChangedCallback,&edit_meter_form_c:: changedCB, (XtPointer) this);
	XtAddCallback (threshold_, XmNvalueChangedCallback,&edit_meter_form_c:: changedCB, (XtPointer) this);
	children[ac++] = label1;
	children[ac++] = label2;
	children[ac++] = label3;
	children[ac++] = label4;
	children[ac++] = min_;
	children[ac++] = value_;
	children[ac++] = max_;
	children[ac++] = threshold_;
	XtManageChildren(children, ac);
	ac = 0;
	XtAddCallback (button1, XmNactivateCallback,&edit_meter_form_c:: applyCB, (XtPointer) this);
	children[ac++] = button1;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = rowcol1;
	children[ac++] = tools_;
	XtManageChildren(children, ac);
}

void edit_meter_form_c::changedCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	edit_meter_form_p instance = (edit_meter_form_p) client_data;
	instance->changedCB ( widget, call_data );
}

void edit_meter_form_c::applyCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	edit_meter_form_p instance = (edit_meter_form_p) client_data;
	instance->applyCB ( widget, call_data );
}

