/***************************** LICENSE START ***********************************

 Copyright 2012 ECMWF and INPE. This software is distributed under the terms
 of the Apache License version 2.0. In applying this license, ECMWF does not
 waive the privileges and immunities granted to it by virtue of its status as
 an Intergovernmental Organization or submit itself to any jurisdiction.

 ***************************** LICENSE END *************************************/

/*
** 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/List.h>
#include <Xm/ScrollBar.h>

#include <xdclass.h>

class UIListHelp_c: public xd_XmForm_c {
public:
	virtual void create (Widget parent, char *widget_name = NULL);
protected:
	Widget UIListHelp;
	Widget list_;
public:
	static void extendedCB( Widget, XtPointer, XtPointer );
	virtual void extendedCB( Widget, XtPointer ) = 0;
	static void multipleCB( Widget, XtPointer, XtPointer );
	virtual void multipleCB( Widget, XtPointer ) = 0;
	static void singleCB( Widget, XtPointer, XtPointer );
	virtual void singleCB( Widget, XtPointer ) = 0;
	static void browseCB( Widget, XtPointer, XtPointer );
	virtual void browseCB( Widget, XtPointer ) = 0;
};

typedef UIListHelp_c *UIListHelp_p;

UIListHelp_p UIListHelp = (UIListHelp_p) NULL;



void UIListHelp_c::create (Widget parent, char *widget_name)
{
	Widget children[3];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	Widget scrolledList1 = (Widget)NULL;

	if ( !widget_name )
		widget_name = "UIListHelp";

	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	UIListHelp = XmCreateForm ( parent, widget_name, al, ac );
	ac = 0;
	_xd_rootwidget = UIListHelp;
	XtSetArg(al[ac], XmNvisibleItemCount, 10); ac++;
	XtSetArg(al[ac], XmNlistSizePolicy, XmRESIZE_IF_POSSIBLE); ac++;
	list_ = XmCreateScrolledList ( UIListHelp, "list_", al, ac );
	ac = 0;
	scrolledList1 = XtParent ( list_ );


	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( scrolledList1,al, ac );
	ac = 0;
	XtAddCallback (list_, XmNbrowseSelectionCallback, browseCB, (XtPointer) this);
	XtAddCallback (list_, XmNsingleSelectionCallback, singleCB, (XtPointer) this);
	XtAddCallback (list_, XmNmultipleSelectionCallback, multipleCB, (XtPointer) this);
	XtAddCallback (list_, XmNextendedSelectionCallback, extendedCB, (XtPointer) this);
	XtManageChild(list_);
}

void UIListHelp_c::extendedCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	UIListHelp_p instance = (UIListHelp_p) client_data;
	instance->extendedCB ( widget, call_data );
}

void UIListHelp_c::multipleCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	UIListHelp_p instance = (UIListHelp_p) client_data;
	instance->multipleCB ( widget, call_data );
}

void UIListHelp_c::singleCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	UIListHelp_p instance = (UIListHelp_p) client_data;
	instance->singleCB ( widget, call_data );
}

void UIListHelp_c::browseCB( Widget widget, XtPointer client_data, XtPointer call_data )
{
	UIListHelp_p instance = (UIListHelp_p) client_data;
	instance->browseCB ( widget, call_data );
}

