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

#include <RGTreeRequester.hh>

Inheritance diagram for RGTreeRequester:
RGBaseRequester

Public Member Functions

 RGTreeRequester (const TGWindow *parent, const TGWindow *main, GItemTreeBranch *tree_root, int &result, GItemList &sel_list, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), ULong_t opts=0, bool auto_start=true)
 
 RGTreeRequester (const TGWindow *parent, const TGWindow *main, GItemTreeBranch *tree_root, int &result, GItemTreeNode *&sel_item, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), ULong_t opts=0, bool auto_start=true)
 
 RGTreeRequester (const TGWindow *parent, const TGWindow *main, GItemTreeBranch *tree_root, GItemTreeNode *&sel_item, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), ULong_t opts=0, bool auto_start=true)
 
 RGTreeRequester (const TGWindow *parent, const TGWindow *main, GItemTreeBranch *tree_root, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), ULong_t opts=0, bool multi=false, bool auto_start=false)
 
virtual ~RGTreeRequester ()
 
virtual void Construct ()
 
virtual void MapRequester ()
 
RGItemTreeSelectorGetItemTreeSelector ()
 
virtual void SingleSelected (ULong64_t leaf_ptr)
 
virtual void ProcessButton (Int_t n)
 
 ClassDef (RGTreeRequester, 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

bool select_multi
 Multiple selection flag.
 
GItemTreeBranch * items_tree
 Tree structure of GItems (or RGItems)
 
GItemList * selected_list
 Pointer to the list of selected items (multiple selection)
 
GItemTreeNode ** selected_item
 Pointer to the selected item node (single selection)
 
RGItemTreeSelectorw_select_tree
 Selection tree 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.
 

Static Protected Attributes

static UInt_t tree_min_width = 160
 Minimum tree width.
 
static UInt_t tree_min_height = 240
 Minimum tree height.
 
- Static Protected Attributes inherited from RGBaseRequester
static UInt_t max_width = 1200
 Maximum request width.
 
static UInt_t max_height = 800
 Maximum request height.
 

Private Member Functions

 GObject (RGTreeRequester)
 
 RGTreeRequester (const RGTreeRequester &req)
 

Additional Inherited Members

- Protected Member Functions inherited from RGBaseRequester
 RGBaseRequester (const RGBaseRequester &req)
 

Detailed Description

class RGTreeRequester

Request for a selection (single or multiple) in a tree of elements, given by a tree structure of GItems.

Note that the tree structure is not modified by the requester. Only the selection flag of tree items may be changed.

Depending on the constructor, the request returns a single or a multiple selection, and the button result.

Tree structure

The tree structure is described in the RGItemTreeSelector widget documentation.

Multiple selection

For the multiple selection, only items (leaves= can be selected. The folders do not belong to the selection.

Single selection

The single selection allows to select either an item (leaf) or a folder (branch), except if the rgReqNoFolder option is defined (at requester creation).

Constructor & Destructor Documentation

RGTreeRequester::RGTreeRequester ( const TGWindow *  parent,
const TGWindow *  main,
GItemTreeBranch *  tree_root,
int &  result,
GItemList &  sel_list,
const char *  title,
const char *  buttons = rDico.brq_ok_cancel.c_str(),
ULong_t  opts = 0,
bool  auto_start = true 
)

Constructor for a request with button return value and a list of selected items (multiple selection).

The result argument receives the button value. The sel_list argument receives a list of the selected items (copies). The selection flags of items in the tree structure (given by tree_root argument) are modified by the user selections.

Parameters
parentparent window
mainmain application window
tree_rootitems (GItem or RGItem objects) tree structure
resultreturn value
sel_listresulting list of selected items
titletitle
buttonsbuttons texts
optsoptions
auto_startflag for execution at construction

References Construct(), items_tree, RGBaseRequester::Request(), select_multi, selected_item, selected_list, and w_select_tree.

RGTreeRequester::RGTreeRequester ( const TGWindow *  parent,
const TGWindow *  main,
GItemTreeBranch *  tree_root,
int &  result,
GItemTreeNode *&  sel_item,
const char *  title,
const char *  buttons = rDico.brq_ok_cancel.c_str(),
ULong_t  opts = 0,
bool  auto_start = true 
)

Constructor for a request with button return value and a single selected item (single selection).

The result argument receives the button value. The sel_item argument receives a pointer to the selected item (the pointer refers to an item existing in the tree, or NULL).

Parameters
parentparent window
mainmain application window
tree_rootitems (GItem or RGItem objects) tree structure
resultreturn value
sel_itempointer to resulting selected (single) item node
titletitle
buttonsbuttons texts
optsoptions
auto_startflag for execution at construction

References Construct(), items_tree, RGBaseRequester::Request(), select_multi, selected_item, selected_list, and w_select_tree.

RGTreeRequester::RGTreeRequester ( const TGWindow *  parent,
const TGWindow *  main,
GItemTreeBranch *  tree_root,
GItemTreeNode *&  sel_item,
const char *  title,
const char *  buttons = rDico.brq_ok_cancel.c_str(),
ULong_t  opts = 0,
bool  auto_start = true 
)

Constructor for a request with return of a single selected item (single selection). There is no button return value: in case of cancellation (button value 0), a NULL pointer is returned for the selected item. For all other buttons value, the item pointer is returned if an item is selected.

Parameters
parentparent window
mainmain application window
tree_rootitems (GItem or RGItem objects) tree structure
sel_itempointer to resulting selected (single) item node
titletitle
buttonsbuttons texts
optsoptions
auto_startflag for execution at construction

References Construct(), items_tree, RGBaseRequester::Request(), select_multi, selected_item, selected_list, and w_select_tree.

RGTreeRequester::RGTreeRequester ( const TGWindow *  parent,
const TGWindow *  main,
GItemTreeBranch *  tree_root,
const char *  title,
const char *  buttons = rDico.brq_ok_cancel.c_str(),
ULong_t  opts = 0,
bool  multi = false,
bool  auto_start = false 
)

Constructor for a request without return value. This constructor may be used in derived classes. It may also be used to define a multiple selection requester since the selected items can be found using selection flag of the items (this is not the case for single selection, that does not change the selection flag of tree items).

Parameters
parentparent window
mainmain application window
tree_rootitems (GItem or RGItem objects) tree structure
titletitle
buttonsbuttons texts
optsoptions
multiflag for allowed multiple selection
auto_startflag for execution at construction

References Construct(), items_tree, RGBaseRequester::Request(), select_multi, selected_item, selected_list, and w_select_tree.

RGTreeRequester::RGTreeRequester ( const RGTreeRequester req)
private

Copy constructor, not implemented.

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

Destructor.

Member Function Documentation

RGTreeRequester::GObject ( RGTreeRequester  )
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 RGTreeRequester::Construct ( )
virtual
void RGTreeRequester::MapRequester ( )
virtual

Function displaying the request.

Reimplemented from RGBaseRequester.

References RGBaseRequester::req_title.

RGItemTreeSelector * RGTreeRequester::GetItemTreeSelector ( )
inline

Return the pointer to the RGItemTreeSelector widget.

References w_select_tree.

Referenced by RGItemTreeSelector::MoveSelectedToFolder().

void RGTreeRequester::SingleSelected ( ULong64_t  leaf_ptr)
virtual

Slot used in single selection mode for validation from return key or double-click.

Parameters
leaf_ptrpointer of selected leaf in the tree (converted to ULong64_t)

References RGBaseRequester::cancel_close, RGBaseRequester::CloseFromButton(), ProcessButton(), and w_select_tree.

void RGTreeRequester::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(), RGItemTreeSelector::GetSelected(), RGItemTreeSelector::GetSelectedLeaf(), items_tree, RGBaseRequester::options, RGBaseRequester::result_adr, select_multi, selected_item, selected_list, and w_select_tree.

Referenced by SingleSelected().

RGTreeRequester::ClassDef ( RGTreeRequester  ,
 
)

For ROOT dictionary.


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