JG ROOT Tools libraries  version 5.0 - august 2014
RGItemTreeSelector.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file RGItemTreeSelector.hh
3  *
4  * Include file for class RGItemTreeSelector
5  */
6 //======================================================================
7 
8 #ifndef RG_TREE_SELECTOR_HH
9 #define RG_TREE_SELECTOR_HH
10 
11 #include "RBaseFunctions.hh"
12 #include "GItemTree.hh"
13 #include "RGItem.hh"
14 
15 #include <TGCanvas.h>
16 #include <TGListTree.h>
17 #include <TGPicture.h>
18 #include <TGFrame.h>
19 #include <TGLabel.h>
20 #include <TGButton.h>
21 #include <TGMenu.h>
22 
23 ///! Default picture name for icons of elemnts of RGItemTreeSelector
24 #define RG_ITL_DEFAULT_TREE_PICT "doc_t.xpm"
25 
26 ///! RGItemTreeSelector widget options
28 {
29  // -- Label options
30  rgITSLabelCenterAligned = 0x00000000, // Centered label (default)
31  rgITSLabelLeftAligned = 0x00000001, // Label left aligned
32  rgITSLabelRightAligned = 0x00000002, // Label right aligned
33 
34  rgITSLabelAboveList = 0x00000000, // Label on top of the tree view (default)
35  rgITSLabelBelowList = 0x00000004, // Label below the tree view
36 
37  // -- Side buttons position options
38  rgITSSideButtonsRight = 0x00000000, // boutons latéraux placés à droite (défaut)
39  rgITSSideButtonsLeft = 0x00000008, // boutons latéraux placés à gauche
40  rgITSSideButtonsCenter = 0x00000000, // boutons latéraux placés au milieu verticalement (défaut)
41  rgITSSideButtonsUp = 0x00000010, // boutons latéraux placés en haut
42  rgITSSideButtonsUpRight = 0x00000010, // boutons latéraux placés en haut à droite
43  rgITSSideButtonsUpLeft = 0x00000018, // boutons latéraux placés en haut à gauche
44  rgITSSideButtonsDown = 0x00000020, // boutons latéraux placés en bas
45  rgITSSideButtonsDownRight = 0x00000020, // boutons latéraux placés en bas à droite
46  rgITSSideButtonsDownLeft = 0x00000028, // boutons latéraux placés en bas à gauche
47 
48  // -- Side buttons definition options
49  rgITSFolderButtons = 0x00000100, // include default all folders open / close buttons
50  rgITSMoveButtons = 0x00000200, // include default in-folder move buttons
51  rgITSEditButtons = 0x00000400, // include default edit buttons
52  rgITSCustomButtons = 0x00008000, // custom side buttons will be added (for derived classes)
53 
54  rgITSDefaultButtons = 0x00000F00, // include all default standard side buttons
55  rgITSSideButtons = 0x00008F00, // flags indicating that there are side buttons
56 
57  // -- Context menu definition options
58  rgITSMenuItem = 0x00040000, // create a context menu for items
59  rgITSMenuItemEdit = 0x00140000, // create a context menu with items edit entries
60  rgITSMenuItemMove = 0x00240000, // create a context menu with items move entries
61 
62  rgITSMenuFolder = 0x00080000, // create a context menu for folders
63  rgITSMenuFolderEdit = 0x01080000, // create a context menu to create a new sub-folder
64  rgITSMenuFolderMove = 0x02080000, // create a context menu with folder move entries
65  rgITSMenuFolderOpen = 0x04080000, // create a context menu with all folder open / close entries
66 
67  rgITSMenuCreate = 0x000C0000, // create a context menu for items and folders
68  rgITSMenuDefault = 0x0FFC0000, // create a context menu with all predefined entries for items and folders
69 
70  // -- Selection options
71  rgITSSingleSelection = 0x00000000, // Only 1 element may be selected
72  rgITSMultipleSelection = 0x10000000, // Multiple elements selections
73 
74  // -- Tree structure options
75  rgITSAutoCreateFolder = 0x20000000, // Automatically create required folders
76 
77 
78  // -- Dummy
79  rgITSDummy = 0x00000000 // just to avoid coma problems
80 };
81 
82 //======================================================================
83 /*! \class RGItemTreeSelector
84  *
85  * This class defines a widget containing a tree of items for selection of
86  * elements.
87  * The elements are pointers on user objects, referred to by GItem
88  * objects.
89  *
90  * In case of a single selection widget, no check-box is associated
91  * to the items in the tree view.
92  *
93  * Objects in the tree are referred to using RGItem objects to refer to
94  * to them (RGItem is the class for the tree structure template).
95  * The user data of the tree nodes is used for the connection between
96  * the tree structure nodes and the tree view elements.
97  *
98  * When selecting or unselecting a folder, all elements in that folder
99  * are selected or unselected.
100  *
101  * The widget also provides also options for pre-defined actions (see
102  * option flags defined in RGItemTreeSelectorOptions) from buttons
103  * and context menu for tree elements.
104  * For these actions, a signal is emitted \b before the corresponding
105  * action is performed, so that, depending on the context, the
106  * calling object (embbeding the RGItemTreeSelector) can cancel the
107  * predefined action in a slot if it calls the CancelAction() function.
108  *
109  * The optional button actions are
110  * - a set of \b move buttons to move elements up and down in their own
111  * folder
112  * - a set of \b move buttons (<b>new folder</b> creation, <b>new item</b>
113  * creation, selected item \b edit or \b delete)
114  * - buttons to open / close all folders (these actions do not check the
115  * action cancellation, since they do not alter the tree structure)
116  *
117  * The optional context menus can be defined for folder elements or
118  * for item elements of the tree structure.
119  * The optional menu actions are:
120  * - menus to open / close all sub-folders
121  * - menus to move current element one level up (to parent folder) in
122  * the tree structure
123  *
124  *
125  * \par Adding custum buttons and menus
126  *
127  * If the \b rgITSCustomButtons option is selected, a frame is added in the
128  * side buttons area to add extra user buttons.
129  * It is possible to add buttons in this frame with the AddSideButton
130  * functions.
131  * Such buttons will then emit the CustomClicked signal.
132  *
133  * If the context menus have been defined for items and/or for folders,
134  * it is possible to add entries to these menus, with the AddMenuItemEntry
135  * and the AddMenuFolderEntry functions.
136  * Note that item and folder menus share the same processing function
137  * (MenuActivated) and signal (CustomMenuActivated), and entries identifiers
138  * should then be different for items and folders menus.
139  * Nevertheless, this does not need to the case if a menu may be defined
140  * for both items and folders (but the entry has to be defined explicitely
141  * for both).
142  * For custom menu entries identifiers, use values \b below 65536, since
143  * values above are used for predefined menus.
144  *
145  *
146  * \note
147  * - the user data of the TGListTreeItem elements of the tree view
148  * contain the pointer to the GItemTreeNote nodes of the tree structure
149  * - the user data of the nodes contain the pointer to the the
150  * TGListTreeItem elements
151  * - the user data of the RGItem (for tree leaves) is supposed to
152  * point on the program objects.
153  *
154  *
155  * \par Options defined in the RGItemTreeSelectorOptions enumeration
156  *
157  * - Label options (related to TGGroupFrame base class)
158  * - \b rgITSLabelCenterAligned: label is centered (default)
159  * - \b rgITSLabelLeftAligned: label at left position
160  * - \b rgITSLabelRightAligned: label at right position
161  * - \b rgITSLabelAboveList: label is located above the list (default)
162  * - \b rgITSLabelBelowList: label is located below the list
163  *
164  * - Side buttons position options
165  * - \b rgITSSideButtonsRight: side buttons on the right side (default)
166  * - \b rgITSSideButtonsLeft: side buttons on the left side
167  * - \b rgITSSideButtonsCenter: side buttons vertically centered (default)
168  * - \b rgITSSideButtonsUp: side buttons vertically placed up
169  * - \b rgITSSideButtonsUpRight: side buttons placed up and right
170  * - \b rgITSSideButtonsUpLeft: side buttons placed up and left
171  * - \b rgITSSideButtonsDown: side buttons vertically placed down
172  * - \b rgITSSideButtonsDownRight: side buttons placed down and right
173  * - \b rgITSSideButtonsDownLeft: side buttons placed down and left
174  *
175  * - Side buttons actions options
176  * - \b rgITSFolderButtons: include buttons for open / close of all folders
177  * - \b rgITSMoveButtons: include default move buttons (move up, down, top, bottom)
178  * - \b rgITSEditButtons: include default edition buttons (new folder, new item, edit and delete)
179  * - \b rgITSCustomButtons: custom side buttons will be added (for derived classes)
180  *
181  * - Context menu options
182  * - \b rgITSMenuItem: create the context menu for items (empty menu)
183  * - \b rgITSMenuItemMove: define items context menu entries to move element top or to another folder
184  * - \b rgITSMenuItemEdit: define items context menu entries to edit elements
185  *
186  * - \b rgITSMenuFolder: create the context menu for folders (empty menu)
187  * - \b rgITSMenuFolderOpen: define folders context menu entries for open / close of all folders (same as corresponding buttons)
188  * - \b rgITSMenuFolderEdit: define folders context menu entries create a new sub-folder
189  * - \b rgITSMenuFolderMove: define folders context menu entries to move element top or to another folder
190  *
191  * - \b rgITSMenuDefault: create all predefined entries for context menus
192  *
193  * - Tree structure and selection options
194  * - \b rgITSSingleSelection: single selection only (default)
195  * - \b rgITSMultipleSelection: multiple selection
196  * - \b rgITSAutoCreateFolder: automatically create folders if needed
197  * when adding elements
198  *
199  * \par Tree structure organisation
200  *
201  *
202  * \image html RGItemTreeSelector.png
203  *
204  */
205 class RGItemTreeSelector : public TGGroupFrame
206 {
207  //------------------------------------------------------------
208  /*! \object_doc{RGItemTreeSelector} */
210  //------------------------------------------------------------
211 
212  public:
213  /*! Values associated to default context menus.
214  * If a menu is defined for both folders and items, the menu identification
215  * value is the same.
216  */
218  {
219  menuFoldersOpen = 0x00010000,
220  menuFoldersOpenAll = 0x00020000,
221  menuFoldersClose = 0x00030000,
222  menuFoldersCloseAll = 0x00040000,
223 
224  menuMoveTop = 0x00100000,
225  menuMoveUp = 0x00200000,
226  menuMoveDown = 0x00300000,
227  menuMoveBottom = 0x00400000,
228  menuMoveToFolder = 0x00500000,
229  menuMoveToParent = 0x00600000,
230 
231  menuFolderCreate = 0x00700000,
232  menuFolderNewItem = 0x00800000,
233  menuItemEdit = 0x00900000,
234  menuItemDelete = 0x00A00000,
235 
236  menuDummy = 0x00000000
237  };
238 
239  protected:
240 
241  string default_element_pic; ///< Default picture name for elements
242 
243  UInt_t tree_w_min; ///< Tree widget minimum width
244  UInt_t tree_h_min; ///< Tree widget minimum height
245 
246  UInt_t options; ///< Widget options
247 
248  GItemTreeBranch * root_node; ///< Root tree node of GItems
249  bool local_tree; ///< Indicates if the tree is created internally and should be deleted with the widget
250 
251  // sub-widgets
252  TGHorizontalFrame * w_widgets_frame; ///< Main frame
253  TGVerticalFrame * w_tree_frame; ///< Tree and side buttons frame
254 
255  TGCanvas * w_tree_canvas; ///< Canvas holding the tree widget
256  TGListTree * w_tree; ///< Tree (list-tree) widget
257 
258  TGHorizontalFrame * w_button_frame; ///< List buttons frame
259  TGTextButton * w_all_button; ///< All elements selection button
260  TGTextButton * w_none_button; ///< None elements selection button
261  TGTextButton * w_invert_button; ///< Invert selection button
262 
263  // - side frame for additional buttons
264  TGVerticalFrame * w_side_frame; ///< Side buttons frame
265 
266  TGVerticalFrame * w_folder_buttons_frame; ///< Frame for folder buttons
267  TGTextButton * w_open_all_button; ///< Open all folders button
268  TGTextButton * w_close_all_button; ///< Close all folders button
269 
270  TGVerticalFrame * w_move_buttons_frame; ///< Frame for move buttons
271  TGTextButton * w_move_up_button; ///< In-folder selected item move button
272  TGTextButton * w_move_down_button; ///< In-folder selected item move button
273  TGTextButton * w_move_top_button; ///< In-folder selected item move button
274  TGTextButton * w_move_bottom_button; ///< In-folder selected item move button
275  TGTextButton * w_move_parent_button; ///< Button to move selected item to its parent folder
276  TGTextButton * w_move_folder_button; ///< Button to move selected item to another folder
277 
278  TGVerticalFrame * w_edit_buttons_frame; ///< Frame for edit buttons
279  TGTextButton * w_new_folder_button; ///< New folder creation button
280  TGTextButton * w_new_item_button; ///< New element definition button
281  TGTextButton * w_edit_item_button; ///< Edit element button
282  TGTextButton * w_delete_button; ///< Delete button
283 
284  TGVerticalFrame * w_custom_buttons_frame; ///< Frame for additional buttons
285 
286  // - contex menus
287  TGPopupMenu * w_menu_item; ///< Define the context menu for item selected
288  TGPopupMenu * w_menu_folder; ///< Define the context menu for folder selected
289 
290  // this is defined to be able to unselect a selected item
291  TGListTreeItem * prev_selected; ///< Previously selected item
292 
293  Bool_t cancel_action; ///< Flag for cancellation of default requested action
294 
295 
296  //------------------------------------------------------------
297  /** @name Constructors, affectation, destructor */
298  //@{
299  public:
300  RGItemTreeSelector ( TGWindow * p,
301  const char * label = NULL,
302  const UInt_t opts = 0,
303  const UInt_t w_min = 160,
304  const UInt_t h_min = 200 );
305 
306  protected:
307  RGItemTreeSelector ( const RGItemTreeSelector &original );
308 
309  public:
310  virtual ~RGItemTreeSelector ( );
311  //@}
312 
313  //------------------------------------------------------------
314  /** @name Sub-widgets functions */
315  //@{
316  virtual TGListTree * GetListTree ( ) const; // inline
317 
318  virtual TGTextButton * GetAllButton ( ) const; // inline
319  virtual TGTextButton * GetNoneButton ( ) const; // inline
320  virtual TGTextButton * GetInvertButton ( ) const; // inline
321 
322  // default standard side buttons
323  virtual TGVerticalFrame * GetSideButtonsFrame ( ) const; // inline
324 
325  virtual TGVerticalFrame * GetFoldersButtonsFrame ( ) const; // inline
326  virtual TGTextButton * GetFoldersOpenButton ( ) const; // inline
327  virtual TGTextButton * GetFoldersCloseButton ( ) const; // inline
328 
329  virtual TGVerticalFrame * GetMoveButtonsFrame ( ) const; // inline
330  virtual TGTextButton * GetMoveUpButton ( ) const; // inline
331  virtual TGTextButton * GetMoveDownButton ( ) const; // inline
332  virtual TGTextButton * GetMoveTopButton ( ) const; // inline
333  virtual TGTextButton * GetMoveBottomButton ( ) const; // inline
334  virtual TGTextButton * GetMoveParentButton ( ) const; // inline
335  virtual TGTextButton * GetMoveFolderButton ( ) const; // inline
336 
337  virtual TGVerticalFrame * GetEditButtonsFrame ( ) const; // inline
338  virtual TGTextButton * GetNewFolderButton ( ) const; // inline
339  virtual TGTextButton * GetNewItemButton ( ) const; // inline
340  virtual TGTextButton * GetEditItemButton ( ) const; // inline
341  virtual TGTextButton * GetDeleteButton ( ) const; // inline
342 
343  virtual TGVerticalFrame * GetCustomButtonsFrame ( ) const; // inline
344 
345  // adding widget capabilities
346  virtual TGButton * AddSideButton ( const char *text, const Int_t id, TGLayoutHints *l, const char *tooltip = NULL );
347  virtual TGButton * AddSideButton ( TGButton *but, const Int_t id, TGLayoutHints *l );
348  virtual TGFrame * AddSideFrame ( TGFrame *f, TGLayoutHints *l = NULL );
349  virtual TGFrame * AddBottomFrame ( TGFrame *f, TGLayoutHints *l = NULL );
350 
351  virtual void AddMenuItemSeparator ( );
352  virtual void AddMenuItemEntry ( const string & title, Int_t id );
353  virtual void AddMenuItemEntry ( const string & title, TGPopupMenu * submenu );
354 
355  virtual void AddMenuFolderSeparator ( );
356  virtual void AddMenuFolderEntry ( const string & title, Int_t id );
357  virtual void AddMenuFolderEntry ( const string & title, TGPopupMenu * submenu );
358  //@}
359 
360  //------------------------------------------------------------
361  /** @name Widget functions */
362  //@{
363  Bool_t MultipleSelection ( ) const; // inline
364 
365  protected:
366  virtual void Construct ( );
367 
368  public:
369  virtual void MapSubwindows ( );
370  virtual void RefreshTreeView ( );
371  //@}
372 
373  //------------------------------------------------------------
374  /** @name Internal functions (no need to be protected) */
375  //@{
376  virtual void UpdateItemSelection ( GItemTreeBranch * branch = NULL );
377 
378  virtual void RecreateTreeDisplay ( );
379  virtual void RecreateTreeSubDisplay ( GItemTreeBranch * branch );
380 
381  virtual void UpdateTreeDisplay ( );
382  virtual void UpdateButtonsState ( );
383  virtual void UpdateMenuItem ( GItemTreeLeaf * leaf );
384  virtual void UpdateMenuFolder ( GItemTreeBranch * branch );
385  //@}
386 
387  //------------------------------------------------------------
388  /** @name Tree structure functions */
389  //@{
390  const GItemTreeBranch * GetTreeRoot ( ) const; // inline
391  void SetDefaultPicture ( const string & pic_name ); // inline
392 
393  GItemTreeBranch * AddFolder ( const string & name );
394  GItemTreeBranch * AddFolder ( GItemTreeBranch * parent, const string & name );
395  GItemTreeLeaf * AddElement ( const string & name, void * data, const TGPicture * pic = NULL );
396  GItemTreeLeaf * AddElement ( GItemTreeBranch * parent, const string & name, void * data, const TGPicture * pic = NULL );
397 
398  GItemTreeBranch * SetRootNode ( GItemTreeBranch * root, bool adopt = false );
399 
400  virtual TGListTreeItem * SelectItem ( GItemTreeNode * node );
401  virtual TGListTreeItem * SelectItem ( TGListTreeItem * elem );
402 
403  GItemTreeNode * GetSelected ( ) const;
404  GItemTreeLeaf * GetSelectedLeaf ( ) const;
405  //@}
406 
407  //------------------------------------------------------------
408  /** @name Buttons / menu related actions */
409 
410  // functions called from buttons and menus
411  virtual void OpenSelectedSubFolders ( );
412  virtual void CloseSelectedSubFolders ( );
413  virtual void OpenSubFolders ( TGListTreeItem * item );
414  virtual void CloseSubFolders ( TGListTreeItem * item );
415 
416  virtual void OpenAllFolders ( );
417  virtual void CloseAllFolders ( );
418 
419  // move buttons / menus
420  virtual void MoveSelectedMoveTop ( Bool_t emit = kTRUE );
421  virtual void MoveSelectedMoveUp ( Bool_t emit = kTRUE );
422  virtual void MoveSelectedMoveDown ( Bool_t emit = kTRUE );
423  virtual void MoveSelectedMoveBottom ( Bool_t emit = kTRUE );
424  virtual void MoveSelectedToParent ( Bool_t emit = kTRUE );
425  virtual void MoveSelectedToFolder ( Bool_t emit = kTRUE );
426 
427  // edit buttons / menus
428  virtual void CreateNewFolder ( );
429  virtual void CreateSubFolder ( GItemTreeBranch * parent );
430  virtual void CreateNewItem ( );
431  virtual void EditSelectedItem ( );
432  virtual void DeleteSelectedItem ( );
433  virtual void DeleteItem ( GItemTreeLeaf * item, bool update = true );
434  virtual void DeleteFolder ( GItemTreeBranch * branch, bool update = true );
435 
436  virtual void CancelAction ( const Bool_t cancel = kTRUE ); // inline
437  virtual Bool_t GetCancelActionState ( ) const; // inline
438 
439  //@}
440 
441  //------------------------------------------------------------
442  /** @name Slots from sub-widgets */
443  //@{
444  public:
445 
446  virtual void SelectAll ( );
447  virtual void SelectNone ( );
448  virtual void SelectInvert ( );
449 
450  virtual void TreeClicked ( TGListTreeItem * item, Int_t btn );
451  virtual void TreeDoubleClicked ( TGListTreeItem * item, Int_t btn );
452  virtual void TreeReturnPressed ( TGListTreeItem * item );
453 
454  virtual void ItemChecked ( TObject * obj, Bool_t check );
455 
456  virtual void ProcessedEvent ( Event_t * event );
457  virtual void MenuActivated ( Int_t id );
458  //@}
459 
460  //------------------------------------------------------------
461  /** @name Signals */
462  //@{
463 
464  // Multiple selection buttons signals
465  virtual void SelectAllClicked ( ); // *SIGNAL*
466  virtual void SelectNoneClicked ( ); // *SIGNAL*
467  virtual void SelectInvertClicked ( ); // *SIGNAL*
468 
469  // Signals from tree-list
470  virtual void SelectionChanged ( ); // *SIGNAL*
471 
472  // Side buttons signals
473  virtual void MoveUpClicked ( ); // *SIGNAL*
474  virtual void MoveDownClicked ( ); // *SIGNAL*
475  virtual void MoveTopClicked ( ); // *SIGNAL*
476  virtual void MoveBottomClicked ( ); // *SIGNAL*
477  virtual void MoveToParentClicked ( ); // *SIGNAL*
478  virtual void MoveToFolderClicked ( ); // *SIGNAL*
479 
480  virtual void SelectionMoved ( ); // *SIGNAL*
481 
482  virtual void NewFolderClicked ( ); // *SIGNAL*
483  virtual void NewItemClicked ( ); // *SIGNAL*
484  virtual void EditItemClicked ( ); // *SIGNAL*
485  virtual void DeleteClicked ( ); // *SIGNAL*
486 
487  virtual void NewFolderCreated ( TGListTreeItem * item ); // *SIGNAL*
488  virtual void CreateItem ( GItemTreeBranch * parent ); // *SIGNAL*
489  virtual void EditItem ( GItemTreeLeaf * item ); // *SIGNAL*
490  virtual void ItemRemoved ( void * data ); // *SIGNAL*
491 
492  virtual void CustomClicked ( Int_t id ); // *SIGNAL*
493  virtual void CustomMenuActivated ( Int_t id ); // *SIGNAL*
494 
495  virtual void SingleSelected ( ULong64_t leaf_ptr ); // *SIGNAL*
496  //@}
497 
498  //------------------------------------------------------------
499  /** @name ROOT related functions */
500  //@{
501  /*! For ROOT dictionary.*/
503  //@}
504 };
505 
506 //----------------------------------------------------------------------
507 // Inline functions
509 
510 //======================================================================
511 #endif
virtual void UpdateTreeDisplay()
Definition: RGItemTreeSelector.cpp:911
TGVerticalFrame * w_custom_buttons_frame
Frame for additional buttons.
Definition: RGItemTreeSelector.hh:284
TGTextButton * w_move_up_button
In-folder selected item move button.
Definition: RGItemTreeSelector.hh:271
virtual void OpenAllFolders()
Definition: RGItemTreeSelector.cpp:1601
virtual void ItemChecked(TObject *obj, Bool_t check)
Definition: RGItemTreeSelector.cpp:2471
string default_element_pic
Default picture name for elements.
Definition: RGItemTreeSelector.hh:241
virtual TGVerticalFrame * GetMoveButtonsFrame() const
Definition: RGItemTreeSelector.icc:39
virtual void SelectionMoved()
Definition: RGItemTreeSelector.icc:213
virtual void AddMenuItemSeparator()
Definition: RGItemTreeSelector.cpp:209
virtual void AddMenuFolderEntry(const string &title, Int_t id)
Definition: RGItemTreeSelector.cpp:268
virtual void EditSelectedItem()
Definition: RGItemTreeSelector.cpp:2157
virtual void MenuActivated(Int_t id)
Definition: RGItemTreeSelector.cpp:2543
virtual Bool_t GetCancelActionState() const
Definition: RGItemTreeSelector.icc:131
virtual void Construct()
Definition: RGItemTreeSelector.cpp:300
virtual TGTextButton * GetDeleteButton() const
Definition: RGItemTreeSelector.icc:98
TGTextButton * w_move_bottom_button
In-folder selected item move button.
Definition: RGItemTreeSelector.hh:274
TGVerticalFrame * w_folder_buttons_frame
Frame for folder buttons.
Definition: RGItemTreeSelector.hh:266
virtual void OpenSubFolders(TGListTreeItem *item)
Definition: RGItemTreeSelector.cpp:1543
virtual TGTextButton * GetInvertButton() const
Definition: RGItemTreeSelector.icc:26
virtual TGListTreeItem * SelectItem(GItemTreeNode *node)
Definition: RGItemTreeSelector.cpp:1463
virtual TGTextButton * GetEditItemButton() const
Definition: RGItemTreeSelector.icc:94
TGListTreeItem * prev_selected
Previously selected item.
Definition: RGItemTreeSelector.hh:291
TGCanvas * w_tree_canvas
Canvas holding the tree widget.
Definition: RGItemTreeSelector.hh:255
virtual void ProcessedEvent(Event_t *event)
Definition: RGItemTreeSelector.cpp:2496
GItemTreeNode * GetSelected() const
Definition: RGItemTreeSelector.cpp:1495
virtual void AddMenuItemEntry(const string &title, Int_t id)
Definition: RGItemTreeSelector.cpp:224
virtual TGTextButton * GetNewItemButton() const
Definition: RGItemTreeSelector.icc:90
GObject(RGItemTreeSelector)
virtual void MoveToParentClicked()
Definition: RGItemTreeSelector.icc:201
virtual void RefreshTreeView()
Definition: RGItemTreeSelector.cpp:778
virtual void UpdateItemSelection(GItemTreeBranch *branch=NULL)
Definition: RGItemTreeSelector.cpp:792
virtual TGButton * AddSideButton(const char *text, const Int_t id, TGLayoutHints *l, const char *tooltip=NULL)
Definition: RGItemTreeSelector.cpp:125
TreeContextMenu
Definition: RGItemTreeSelector.hh:217
GItemTreeBranch * AddFolder(const string &name)
Definition: RGItemTreeSelector.cpp:1215
virtual void CustomMenuActivated(Int_t id)
Definition: RGItemTreeSelector.icc:261
virtual void MoveSelectedMoveDown(Bool_t emit=kTRUE)
Definition: RGItemTreeSelector.cpp:1731
virtual TGTextButton * GetFoldersOpenButton() const
Definition: RGItemTreeSelector.icc:52
TGTextButton * w_edit_item_button
Edit element button.
Definition: RGItemTreeSelector.hh:281
virtual void CancelAction(const Bool_t cancel=kTRUE)
Definition: RGItemTreeSelector.icc:127
TGTextButton * w_close_all_button
Close all folders button.
Definition: RGItemTreeSelector.hh:268
virtual void DeleteClicked()
Definition: RGItemTreeSelector.icc:245
virtual void CloseSelectedSubFolders()
Definition: RGItemTreeSelector.cpp:1535
TGTextButton * w_new_item_button
New element definition button.
Definition: RGItemTreeSelector.hh:280
virtual void SelectAll()
Definition: RGItemTreeSelector.cpp:2298
virtual void CloseSubFolders(TGListTreeItem *item)
Definition: RGItemTreeSelector.cpp:1573
virtual void CreateSubFolder(GItemTreeBranch *parent)
Definition: RGItemTreeSelector.cpp:2051
virtual void CreateItem(GItemTreeBranch *parent)
Definition: RGItemTreeSelector.icc:283
virtual void EditItem(GItemTreeLeaf *item)
Definition: RGItemTreeSelector.icc:289
virtual void OpenSelectedSubFolders()
Definition: RGItemTreeSelector.cpp:1529
TGTextButton * w_move_top_button
In-folder selected item move button.
Definition: RGItemTreeSelector.hh:273
virtual TGTextButton * GetNoneButton() const
Definition: RGItemTreeSelector.icc:22
virtual TGVerticalFrame * GetCustomButtonsFrame() const
Definition: RGItemTreeSelector.icc:47
TGTextButton * w_open_all_button
Open all folders button.
Definition: RGItemTreeSelector.hh:267
virtual void MoveSelectedToParent(Bool_t emit=kTRUE)
Definition: RGItemTreeSelector.cpp:1833
virtual void ItemRemoved(void *data)
Definition: RGItemTreeSelector.icc:297
virtual TGTextButton * GetMoveDownButton() const
Definition: RGItemTreeSelector.icc:65
Definition: RGItemTreeSelector.hh:205
TGTextButton * w_new_folder_button
New folder creation button.
Definition: RGItemTreeSelector.hh:279
const GItemTreeBranch * GetTreeRoot() const
Definition: RGItemTreeSelector.icc:116
virtual TGTextButton * GetMoveParentButton() const
Definition: RGItemTreeSelector.icc:77
virtual void SelectionChanged()
Definition: RGItemTreeSelector.icc:143
virtual TGTextButton * GetMoveFolderButton() const
Definition: RGItemTreeSelector.icc:81
virtual void RecreateTreeSubDisplay(GItemTreeBranch *branch)
Definition: RGItemTreeSelector.cpp:839
virtual void SelectNoneClicked()
Definition: RGItemTreeSelector.icc:154
UInt_t tree_h_min
Tree widget minimum height.
Definition: RGItemTreeSelector.hh:244
TGVerticalFrame * w_move_buttons_frame
Frame for move buttons.
Definition: RGItemTreeSelector.hh:270
virtual void DeleteFolder(GItemTreeBranch *branch, bool update=true)
Definition: RGItemTreeSelector.cpp:2256
ClassDef(RGItemTreeSelector, 0)
virtual void MoveToFolderClicked()
Definition: RGItemTreeSelector.icc:209
GItemTreeBranch * SetRootNode(GItemTreeBranch *root, bool adopt=false)
Definition: RGItemTreeSelector.cpp:1438
virtual void MoveSelectedToFolder(Bool_t emit=kTRUE)
Definition: RGItemTreeSelector.cpp:1890
virtual void SelectAllClicked()
Definition: RGItemTreeSelector.icc:150
virtual TGVerticalFrame * GetEditButtonsFrame() const
Definition: RGItemTreeSelector.icc:43
virtual void UpdateMenuItem(GItemTreeLeaf *leaf)
Definition: RGItemTreeSelector.cpp:1066
UInt_t tree_w_min
Tree widget minimum width.
Definition: RGItemTreeSelector.hh:243
virtual TGFrame * AddSideFrame(TGFrame *f, TGLayoutHints *l=NULL)
Definition: RGItemTreeSelector.cpp:174
TGTextButton * w_move_down_button
In-folder selected item move button.
Definition: RGItemTreeSelector.hh:272
virtual TGTextButton * GetMoveTopButton() const
Definition: RGItemTreeSelector.icc:69
TGTextButton * w_all_button
All elements selection button.
Definition: RGItemTreeSelector.hh:259
TGHorizontalFrame * w_widgets_frame
Main frame.
Definition: RGItemTreeSelector.hh:252
virtual TGTextButton * GetMoveBottomButton() const
Definition: RGItemTreeSelector.icc:73
virtual void TreeReturnPressed(TGListTreeItem *item)
Definition: RGItemTreeSelector.cpp:2443
virtual void DeleteItem(GItemTreeLeaf *item, bool update=true)
Definition: RGItemTreeSelector.cpp:2229
virtual void NewFolderCreated(TGListTreeItem *item)
Definition: RGItemTreeSelector.icc:277
TGVerticalFrame * w_tree_frame
Tree and side buttons frame.
Definition: RGItemTreeSelector.hh:253
void SetDefaultPicture(const string &pic_name)
Definition: RGItemTreeSelector.cpp:1197
virtual void NewFolderClicked()
Definition: RGItemTreeSelector.icc:221
virtual void AddMenuFolderSeparator()
Definition: RGItemTreeSelector.cpp:253
RGItemTreeSelector(TGWindow *p, const char *label=NULL, const UInt_t opts=0, const UInt_t w_min=160, const UInt_t h_min=200)
Definition: RGItemTreeSelector.cpp:28
TGPopupMenu * w_menu_folder
Define the context menu for folder selected.
Definition: RGItemTreeSelector.hh:288
virtual void CreateNewItem()
Definition: RGItemTreeSelector.cpp:2116
virtual TGVerticalFrame * GetFoldersButtonsFrame() const
Definition: RGItemTreeSelector.icc:35
TGTextButton * w_invert_button
Invert selection button.
Definition: RGItemTreeSelector.hh:261
virtual void MoveDownClicked()
Definition: RGItemTreeSelector.icc:177
GItemTreeLeaf * GetSelectedLeaf() const
Definition: RGItemTreeSelector.cpp:1510
TGTextButton * w_none_button
None elements selection button.
Definition: RGItemTreeSelector.hh:260
TGTextButton * w_move_parent_button
Button to move selected item to its parent folder.
Definition: RGItemTreeSelector.hh:275
virtual void NewItemClicked()
Definition: RGItemTreeSelector.icc:229
bool local_tree
Indicates if the tree is created internally and should be deleted with the widget.
Definition: RGItemTreeSelector.hh:249
virtual void CustomClicked(Int_t id)
Definition: RGItemTreeSelector.icc:255
TGVerticalFrame * w_side_frame
Side buttons frame.
Definition: RGItemTreeSelector.hh:264
virtual void MoveSelectedMoveBottom(Bool_t emit=kTRUE)
Definition: RGItemTreeSelector.cpp:1782
TGHorizontalFrame * w_button_frame
List buttons frame.
Definition: RGItemTreeSelector.hh:258
virtual void MoveSelectedMoveUp(Bool_t emit=kTRUE)
Definition: RGItemTreeSelector.cpp:1680
RGItemTreeSelectorOptions
! RGItemTreeSelector widget options
Definition: RGItemTreeSelector.hh:27
virtual TGFrame * AddBottomFrame(TGFrame *f, TGLayoutHints *l=NULL)
Definition: RGItemTreeSelector.cpp:192
TGPopupMenu * w_menu_item
Define the context menu for item selected.
Definition: RGItemTreeSelector.hh:287
virtual void MoveTopClicked()
Definition: RGItemTreeSelector.icc:185
TGTextButton * w_move_folder_button
Button to move selected item to another folder.
Definition: RGItemTreeSelector.hh:276
virtual TGTextButton * GetMoveUpButton() const
Definition: RGItemTreeSelector.icc:61
virtual void UpdateButtonsState()
Definition: RGItemTreeSelector.cpp:982
GItemTreeLeaf * AddElement(const string &name, void *data, const TGPicture *pic=NULL)
Definition: RGItemTreeSelector.cpp:1322
virtual void SelectInvert()
Definition: RGItemTreeSelector.cpp:2346
virtual void CreateNewFolder()
Definition: RGItemTreeSelector.cpp:2019
TGListTree * w_tree
Tree (list-tree) widget.
Definition: RGItemTreeSelector.hh:256
virtual void SelectInvertClicked()
Definition: RGItemTreeSelector.icc:158
UInt_t options
Widget options.
Definition: RGItemTreeSelector.hh:246
virtual void TreeDoubleClicked(TGListTreeItem *item, Int_t btn)
Definition: RGItemTreeSelector.cpp:2403
virtual TGListTree * GetListTree() const
Definition: RGItemTreeSelector.icc:13
virtual void CloseAllFolders()
Definition: RGItemTreeSelector.cpp:1613
virtual void UpdateMenuFolder(GItemTreeBranch *branch)
Definition: RGItemTreeSelector.cpp:1128
virtual void SelectNone()
Definition: RGItemTreeSelector.cpp:2322
virtual ~RGItemTreeSelector()
Definition: RGItemTreeSelector.cpp:103
Bool_t cancel_action
Flag for cancellation of default requested action.
Definition: RGItemTreeSelector.hh:293
virtual TGTextButton * GetAllButton() const
Definition: RGItemTreeSelector.icc:18
virtual void EditItemClicked()
Definition: RGItemTreeSelector.icc:237
virtual TGVerticalFrame * GetSideButtonsFrame() const
Definition: RGItemTreeSelector.icc:31
virtual void SingleSelected(ULong64_t leaf_ptr)
Definition: RGItemTreeSelector.icc:268
TGVerticalFrame * w_edit_buttons_frame
Frame for edit buttons.
Definition: RGItemTreeSelector.hh:278
Bool_t MultipleSelection() const
Definition: RGItemTreeSelector.icc:107
virtual void MoveBottomClicked()
Definition: RGItemTreeSelector.icc:193
virtual void TreeClicked(TGListTreeItem *item, Int_t btn)
Definition: RGItemTreeSelector.cpp:2375
virtual void DeleteSelectedItem()
Definition: RGItemTreeSelector.cpp:2181
GItemTreeBranch * root_node
Root tree node of GItems.
Definition: RGItemTreeSelector.hh:248
virtual TGTextButton * GetFoldersCloseButton() const
Definition: RGItemTreeSelector.icc:56
virtual void MoveSelectedMoveTop(Bool_t emit=kTRUE)
Definition: RGItemTreeSelector.cpp:1632
virtual TGTextButton * GetNewFolderButton() const
Definition: RGItemTreeSelector.icc:86
TGTextButton * w_delete_button
Delete button.
Definition: RGItemTreeSelector.hh:282
virtual void MapSubwindows()
Definition: RGItemTreeSelector.cpp:750
virtual void MoveUpClicked()
Definition: RGItemTreeSelector.icc:169
virtual void RecreateTreeDisplay()
Definition: RGItemTreeSelector.cpp:815