JG ROOT Tools libraries  version 5.0 - august 2014
RGListRequester Class Reference

#include <RGListRequester.hh>

Inheritance diagram for RGListRequester:
RGBaseRequester

Public Member Functions

 RGListRequester (const TGWindow *parent, const TGWindow *main, const string items[], const u_int items_num, int &result, bool *&table, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), const ULong_t opts=0, const int &display=0, const bool auto_start=true)
 
 RGListRequester (const TGWindow *parent, const TGWindow *main, const string items[], const u_int items_num, int &result, int &selection, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), const ULong_t opts=0, const int &display=0, const bool auto_start=true)
 
 RGListRequester (const TGWindow *parent, const TGWindow *main, const string items[], const u_int items_num, int &selection, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), const ULong_t opts=0, const int &display=0, const bool auto_start=true)
 
 RGListRequester (const TGWindow *parent, const TGWindow *main, const string *items, const u_int items_num, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), const ULong_t opts=0, const int &display=0, const bool multi=false)
 
virtual ~RGListRequester ()
 
virtual void Construct ()
 
virtual void MapRequester ()
 
virtual void ItemSelected (Int_t n)
 
virtual void DoubleClicked (Int_t n)
 
virtual void ProcessButton (Int_t n)
 
 ClassDef (RGListRequester, 0)
 
- Public Member Functions inherited from RGBaseRequester
 RGBaseRequester (const TGWindow *parent, const TGWindow *main, int &result, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), const ULong_t opts=0, const bool auto_start=true)
 
 RGBaseRequester (const TGWindow *parent, const TGWindow *main, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), const ULong_t opts=0, const bool auto_start=false)
 
virtual ~RGBaseRequester ()
 
virtual void Request ()
 
virtual TGCompositeFrame * GetFrame () const
 
virtual TGHorizontalFrame * GetHFrame () const
 
virtual TGVerticalFrame * GetVFrame () const
 
virtual void AddFrame (TGFrame *f, TGLayoutHints *l=0)
 
virtual void CloseFromButton ()
 
virtual void CancelClose (const Bool_t b=kTRUE)
 
virtual void ReqButtonClicked (Int_t n)
 
virtual void ProcessedEvent (Event_t *event)
 
virtual void Button (Int_t n)
 
virtual void Quit ()
 
 ClassDef (RGBaseRequester, 0)
 

Protected Attributes

int * select_adr
 Pointer on selection result (single selection)
 
bool * select_table
 Array of selection values (multiple selection)
 
int selected
 Selected element (last)
 
bool select_multi
 Multiple selection flag.
 
const string * items_list
 Array of list elements names.
 
int items_number
 Number of elements.
 
int max_visible
 Display: number of visible elements.
 
UInt_t list_width
 List width.
 
UInt_t list_height
 List height.
 
RGItemListBoxw_select_list
 Selection list widget.
 
- Protected Attributes inherited from RGBaseRequester
int * result_adr
 Request resul pointer.
 
string req_title
 Request title.
 
const char * req_buttons
 Buttons texts.
 
UInt_t options
 Request options.
 
ULong_t req_button_layout
 Buttons layout.
 
TGCompositeFrame * w_widget_frame
 Frame for widgets.
 
TGCompositeFrame * w_buttons_frame
 Frame for buttons.
 
TList buttons_list
 List of created buttons.
 
Bool_t cancel_close
 Check for close cancellation.
 

Private Member Functions

 GObject (RGListRequester)
 
 RGListRequester (const RGListRequester &req)
 

Additional Inherited Members

- Protected Member Functions inherited from RGBaseRequester
 RGBaseRequester (const RGBaseRequester &req)
 
- Static Protected Attributes inherited from RGBaseRequester
static UInt_t max_width = 1200
 Maximum request width.
 
static UInt_t max_height = 800
 Maximum request height.
 

Detailed Description

class RGListRequester

Request for a selection in a list of elements, presented with a text name.

Depending on the constructor, the request returns (N beeing the number of entries):

  • the close button and an array of N logic values indicating whether elements are selected or not (multiple selection);
  • the close button and a result between 0 and N-1 of the selected element (single selection), or -1 if no element is selected;
  • a result between 0 and N-1 of the selected element (single selection), or -1 if no element is selected.

According to the case, the returned value in case of cancellation may be modified.

Specific options:

  • rgReqNoDoubleClick inhibits the single selection double-click
Note
a double-click causes the first button click.

Constructor & Destructor Documentation

RGListRequester::RGListRequester ( const TGWindow *  parent,
const TGWindow *  main,
const string  items[],
const u_int  items_num,
int &  result,
bool *&  table,
const char *  title,
const char *  buttons = rDico.brq_ok_cancel.c_str(),
const ULong_t  opts = 0,
const int &  display = 0,
const bool  auto_start = true 
)

Constructor for a request with button number return and an array of logical values corresponding to selection state of the elements (multiple selection).

If array pointer table is NULL, the array is allocated and the calling program is responsible for deleting it. Else, the allocated array must be at least the number of elements.

The result argument receives the button value.

Parameters
parentparent window
mainmain application window
itemsarray of element names
items_numnumber of elements
resultreturn value
tablearray of selection results
titletitle
buttonsbuttons texts
optsoptions
displaymaximum numbe
auto_startflag for execution at construction

References Construct(), items_list, items_number, max_visible, RGBaseRequester::Request(), select_adr, select_multi, select_table, and selected.

RGListRequester::RGListRequester ( const TGWindow *  parent,
const TGWindow *  main,
const string  items[],
const u_int  items_num,
int &  result,
int &  selection,
const char *  title,
const char *  buttons = rDico.brq_ok_cancel.c_str(),
const ULong_t  opts = 0,
const int &  display = 0,
const bool  auto_start = true 
)

Constructor for a request with button number return and the selected item number (single selection) in selection argument. The selection value ranges from 0 to number of elements minus one, or -1 if no element is selected.

In case of cancellation, the initial value of result is not modified.

Parameters
parentparent window
mainmain application window
itemsarray of element names
items_numnumber of elements
resultreturn value
selectionselection result
titletitle
buttonsbuttons texts
optsoptions
displaymaximum numbe
auto_startflag for execution at construction

References Construct(), items_list, items_number, max_visible, RGBaseRequester::Request(), select_adr, select_multi, select_table, and selected.

RGListRequester::RGListRequester ( const TGWindow *  parent,
const TGWindow *  main,
const string  items[],
const u_int  items_num,
int &  selection,
const char *  title,
const char *  buttons = rDico.brq_ok_cancel.c_str(),
const ULong_t  opts = 0,
const int &  display = 0,
const bool  auto_start = true 
)

Constructor for a request with return of the selected item number (single selection) in selection argument. The selection value ranges from 0 to number of elements minus one, or -1 if no element is selected.

In case of cancellation, the initial value of result is not modified.

Parameters
parentparent window
mainmain application window
itemsarray of element names
items_numnumber of elements
selectionselection result
titletitle
buttonsbuttons texts
optsoptions
displaymaximum numbe
auto_startflag for execution at construction

References Construct(), items_list, items_number, max_visible, RGBaseRequester::Request(), RGBaseRequester::result_adr, select_adr, select_multi, select_table, and selected.

RGListRequester::RGListRequester ( const TGWindow *  parent,
const TGWindow *  main,
const string *  items,
const u_int  items_num,
const char *  title,
const char *  buttons = rDico.brq_ok_cancel.c_str(),
const ULong_t  opts = 0,
const int &  display = 0,
const bool  multi = false 
)

Constructor for a request without return value, for use in derived classes.

Parameters
parentparent window
mainmain application window
itemsarray of element names
items_numnumber of elements
titletitle
buttonsbuttons texts
optsoptions
displaymaximum numbe
multiflag for allowed multiple selection

References items_list, items_number, max_visible, RGBaseRequester::result_adr, select_adr, select_multi, select_table, and selected.

RGListRequester::RGListRequester ( const RGListRequester req)
private

Copy constructor, not implemented.

Parameters
reqrequest to copy
RGListRequester::~RGListRequester ( )
virtual

Destructor.

Member Function Documentation

RGListRequester::GObject ( RGListRequester  )
private

Macro from GCpp library that defines the following functions:

  • ClassName(): return the real class name of the object
  • StaticClassName(): return the used class name of the object (that may be a base class of the real object).
  • IsInstanceOf<T>(): return true if the current object is an instance of the template class name argument
  • Clone(): return an allocated copy of the object.
void RGListRequester::MapRequester ( )
virtual
void RGListRequester::ItemSelected ( Int_t  n)
virtual

Slot called when an element is selected (single selection).

Parameters
nselected element number

References RGItemListBox::GetSelection(), selected, and w_select_list.

void RGListRequester::DoubleClicked ( Int_t  n)
virtual

Slot called when an element is double-clicked (single selection).

Parameters
nselected element number

References RGBaseRequester::CloseFromButton(), RGBaseRequester::options, ProcessButton(), and selected.

void RGListRequester::ProcessButton ( Int_t  n)
virtual

Slot used to get the button clicked (from base requester signal), and adapt actions to the type of request.

Parameters
nrequester button identifier

References RGBaseRequester::CancelClose(), RGItemListBox::GetSelection(), items_number, RGBaseRequester::result_adr, select_adr, select_table, selected, and w_select_list.

Referenced by DoubleClicked().

RGListRequester::ClassDef ( RGListRequester  ,
 
)

For ROOT dictionary.


The documentation for this class was generated from the following files: