JG ROOT Tools libraries
version 5.0 - august 2014
|
#include <RGItemTreeSelector.hh>
Public Types | |
enum | TreeContextMenu { menuFoldersOpen = 0x00010000, menuFoldersOpenAll = 0x00020000, menuFoldersClose = 0x00030000, menuFoldersCloseAll = 0x00040000, menuMoveTop = 0x00100000, menuMoveUp = 0x00200000, menuMoveDown = 0x00300000, menuMoveBottom = 0x00400000, menuMoveToFolder = 0x00500000, menuMoveToParent = 0x00600000, menuFolderCreate = 0x00700000, menuFolderNewItem = 0x00800000, menuItemEdit = 0x00900000, menuItemDelete = 0x00A00000, menuDummy = 0x00000000 } |
Public Member Functions | |
Sub-widgets functions | |
virtual TGListTree * | GetListTree () const |
virtual TGTextButton * | GetAllButton () const |
virtual TGTextButton * | GetNoneButton () const |
virtual TGTextButton * | GetInvertButton () const |
virtual TGVerticalFrame * | GetSideButtonsFrame () const |
virtual TGVerticalFrame * | GetFoldersButtonsFrame () const |
virtual TGTextButton * | GetFoldersOpenButton () const |
virtual TGTextButton * | GetFoldersCloseButton () const |
virtual TGVerticalFrame * | GetMoveButtonsFrame () const |
virtual TGTextButton * | GetMoveUpButton () const |
virtual TGTextButton * | GetMoveDownButton () const |
virtual TGTextButton * | GetMoveTopButton () const |
virtual TGTextButton * | GetMoveBottomButton () const |
virtual TGTextButton * | GetMoveParentButton () const |
virtual TGTextButton * | GetMoveFolderButton () const |
virtual TGVerticalFrame * | GetEditButtonsFrame () const |
virtual TGTextButton * | GetNewFolderButton () const |
virtual TGTextButton * | GetNewItemButton () const |
virtual TGTextButton * | GetEditItemButton () const |
virtual TGTextButton * | GetDeleteButton () const |
virtual TGVerticalFrame * | GetCustomButtonsFrame () const |
virtual TGButton * | AddSideButton (const char *text, const Int_t id, TGLayoutHints *l, const char *tooltip=NULL) |
virtual TGButton * | AddSideButton (TGButton *but, const Int_t id, TGLayoutHints *l) |
virtual TGFrame * | AddSideFrame (TGFrame *f, TGLayoutHints *l=NULL) |
virtual TGFrame * | AddBottomFrame (TGFrame *f, TGLayoutHints *l=NULL) |
virtual void | AddMenuItemSeparator () |
virtual void | AddMenuItemEntry (const string &title, Int_t id) |
virtual void | AddMenuItemEntry (const string &title, TGPopupMenu *submenu) |
virtual void | AddMenuFolderSeparator () |
virtual void | AddMenuFolderEntry (const string &title, Int_t id) |
virtual void | AddMenuFolderEntry (const string &title, TGPopupMenu *submenu) |
Internal functions (no need to be protected) | |
virtual void | UpdateItemSelection (GItemTreeBranch *branch=NULL) |
virtual void | RecreateTreeDisplay () |
virtual void | RecreateTreeSubDisplay (GItemTreeBranch *branch) |
virtual void | UpdateTreeDisplay () |
virtual void | UpdateButtonsState () |
virtual void | UpdateMenuItem (GItemTreeLeaf *leaf) |
virtual void | UpdateMenuFolder (GItemTreeBranch *branch) |
Tree structure functions | |
const GItemTreeBranch * | GetTreeRoot () const |
void | SetDefaultPicture (const string &pic_name) |
GItemTreeBranch * | AddFolder (const string &name) |
GItemTreeBranch * | AddFolder (GItemTreeBranch *parent, const string &name) |
GItemTreeLeaf * | AddElement (const string &name, void *data, const TGPicture *pic=NULL) |
GItemTreeLeaf * | AddElement (GItemTreeBranch *parent, const string &name, void *data, const TGPicture *pic=NULL) |
GItemTreeBranch * | SetRootNode (GItemTreeBranch *root, bool adopt=false) |
virtual TGListTreeItem * | SelectItem (GItemTreeNode *node) |
virtual TGListTreeItem * | SelectItem (TGListTreeItem *elem) |
GItemTreeNode * | GetSelected () const |
GItemTreeLeaf * | GetSelectedLeaf () const |
Buttons / menu related actions | |
virtual void | OpenSelectedSubFolders () |
virtual void | CloseSelectedSubFolders () |
virtual void | OpenSubFolders (TGListTreeItem *item) |
virtual void | CloseSubFolders (TGListTreeItem *item) |
virtual void | OpenAllFolders () |
virtual void | CloseAllFolders () |
virtual void | MoveSelectedMoveTop (Bool_t emit=kTRUE) |
virtual void | MoveSelectedMoveUp (Bool_t emit=kTRUE) |
virtual void | MoveSelectedMoveDown (Bool_t emit=kTRUE) |
virtual void | MoveSelectedMoveBottom (Bool_t emit=kTRUE) |
virtual void | MoveSelectedToParent (Bool_t emit=kTRUE) |
virtual void | MoveSelectedToFolder (Bool_t emit=kTRUE) |
virtual void | CreateNewFolder () |
virtual void | CreateSubFolder (GItemTreeBranch *parent) |
virtual void | CreateNewItem () |
virtual void | EditSelectedItem () |
virtual void | DeleteSelectedItem () |
virtual void | DeleteItem (GItemTreeLeaf *item, bool update=true) |
virtual void | DeleteFolder (GItemTreeBranch *branch, bool update=true) |
virtual void | CancelAction (const Bool_t cancel=kTRUE) |
virtual Bool_t | GetCancelActionState () const |
Slots from sub-widgets | |
virtual void | SelectAll () |
virtual void | SelectNone () |
virtual void | SelectInvert () |
virtual void | TreeClicked (TGListTreeItem *item, Int_t btn) |
virtual void | TreeDoubleClicked (TGListTreeItem *item, Int_t btn) |
virtual void | TreeReturnPressed (TGListTreeItem *item) |
virtual void | ItemChecked (TObject *obj, Bool_t check) |
virtual void | ProcessedEvent (Event_t *event) |
virtual void | MenuActivated (Int_t id) |
Signals | |
virtual void | SelectAllClicked () |
virtual void | SelectNoneClicked () |
virtual void | SelectInvertClicked () |
virtual void | SelectionChanged () |
virtual void | MoveUpClicked () |
virtual void | MoveDownClicked () |
virtual void | MoveTopClicked () |
virtual void | MoveBottomClicked () |
virtual void | MoveToParentClicked () |
virtual void | MoveToFolderClicked () |
virtual void | SelectionMoved () |
virtual void | NewFolderClicked () |
virtual void | NewItemClicked () |
virtual void | EditItemClicked () |
virtual void | DeleteClicked () |
virtual void | NewFolderCreated (TGListTreeItem *item) |
virtual void | CreateItem (GItemTreeBranch *parent) |
virtual void | EditItem (GItemTreeLeaf *item) |
virtual void | ItemRemoved (void *data) |
virtual void | CustomClicked (Int_t id) |
virtual void | CustomMenuActivated (Int_t id) |
virtual void | SingleSelected (ULong64_t leaf_ptr) |
ROOT related functions | |
ClassDef (RGItemTreeSelector, 0) | |
Protected Attributes | |
string | default_element_pic |
Default picture name for elements. | |
UInt_t | tree_w_min |
Tree widget minimum width. | |
UInt_t | tree_h_min |
Tree widget minimum height. | |
UInt_t | options |
Widget options. | |
GItemTreeBranch * | root_node |
Root tree node of GItems. | |
bool | local_tree |
Indicates if the tree is created internally and should be deleted with the widget. | |
TGHorizontalFrame * | w_widgets_frame |
Main frame. | |
TGVerticalFrame * | w_tree_frame |
Tree and side buttons frame. | |
TGCanvas * | w_tree_canvas |
Canvas holding the tree widget. | |
TGListTree * | w_tree |
Tree (list-tree) widget. | |
TGHorizontalFrame * | w_button_frame |
List buttons frame. | |
TGTextButton * | w_all_button |
All elements selection button. | |
TGTextButton * | w_none_button |
None elements selection button. | |
TGTextButton * | w_invert_button |
Invert selection button. | |
TGVerticalFrame * | w_side_frame |
Side buttons frame. | |
TGVerticalFrame * | w_folder_buttons_frame |
Frame for folder buttons. | |
TGTextButton * | w_open_all_button |
Open all folders button. | |
TGTextButton * | w_close_all_button |
Close all folders button. | |
TGVerticalFrame * | w_move_buttons_frame |
Frame for move buttons. | |
TGTextButton * | w_move_up_button |
In-folder selected item move button. | |
TGTextButton * | w_move_down_button |
In-folder selected item move button. | |
TGTextButton * | w_move_top_button |
In-folder selected item move button. | |
TGTextButton * | w_move_bottom_button |
In-folder selected item move button. | |
TGTextButton * | w_move_parent_button |
Button to move selected item to its parent folder. | |
TGTextButton * | w_move_folder_button |
Button to move selected item to another folder. | |
TGVerticalFrame * | w_edit_buttons_frame |
Frame for edit buttons. | |
TGTextButton * | w_new_folder_button |
New folder creation button. | |
TGTextButton * | w_new_item_button |
New element definition button. | |
TGTextButton * | w_edit_item_button |
Edit element button. | |
TGTextButton * | w_delete_button |
Delete button. | |
TGVerticalFrame * | w_custom_buttons_frame |
Frame for additional buttons. | |
TGPopupMenu * | w_menu_item |
Define the context menu for item selected. | |
TGPopupMenu * | w_menu_folder |
Define the context menu for folder selected. | |
TGListTreeItem * | prev_selected |
Previously selected item. | |
Bool_t | cancel_action |
Flag for cancellation of default requested action. | |
Private Member Functions | |
GObject (RGItemTreeSelector) | |
Constructors, affectation, destructor | |
RGItemTreeSelector (TGWindow *p, const char *label=NULL, const UInt_t opts=0, const UInt_t w_min=160, const UInt_t h_min=200) | |
virtual | ~RGItemTreeSelector () |
RGItemTreeSelector (const RGItemTreeSelector &original) | |
Widget functions | |
Bool_t | MultipleSelection () const |
virtual void | MapSubwindows () |
virtual void | RefreshTreeView () |
virtual void | Construct () |
This class defines a widget containing a tree of items for selection of elements. The elements are pointers on user objects, referred to by GItem objects.
In case of a single selection widget, no check-box is associated to the items in the tree view.
Objects in the tree are referred to using RGItem objects to refer to to them (RGItem is the class for the tree structure template). The user data of the tree nodes is used for the connection between the tree structure nodes and the tree view elements.
When selecting or unselecting a folder, all elements in that folder are selected or unselected.
The widget also provides also options for pre-defined actions (see option flags defined in RGItemTreeSelectorOptions) from buttons and context menu for tree elements. For these actions, a signal is emitted before the corresponding action is performed, so that, depending on the context, the calling object (embbeding the RGItemTreeSelector) can cancel the predefined action in a slot if it calls the CancelAction() function.
The optional button actions are
The optional context menus can be defined for folder elements or for item elements of the tree structure. The optional menu actions are:
If the rgITSCustomButtons option is selected, a frame is added in the side buttons area to add extra user buttons. It is possible to add buttons in this frame with the AddSideButton functions. Such buttons will then emit the CustomClicked signal.
If the context menus have been defined for items and/or for folders, it is possible to add entries to these menus, with the AddMenuItemEntry and the AddMenuFolderEntry functions. Note that item and folder menus share the same processing function (MenuActivated) and signal (CustomMenuActivated), and entries identifiers should then be different for items and folders menus. Nevertheless, this does not need to the case if a menu may be defined for both items and folders (but the entry has to be defined explicitely for both). For custom menu entries identifiers, use values below 65536, since values above are used for predefined menus.
Values associated to default context menus. If a menu is defined for both folders and items, the menu identification value is the same.
RGItemTreeSelector::RGItemTreeSelector | ( | TGWindow * | p, |
const char * | label = NULL , |
||
const UInt_t | opts = 0 , |
||
const UInt_t | w_min = 160 , |
||
const UInt_t | h_min = 200 |
||
) |
Constructor.
p | parent widget |
label | list label |
opts | options |
w_min | minimum width of list widget |
h_min | minimum height of list widget |
References cancel_action, Construct(), default_element_pic, local_tree, options, prev_selected, RG_ITL_DEFAULT_TREE_PICT, root_node, tree_h_min, tree_w_min, w_all_button, w_button_frame, w_close_all_button, w_custom_buttons_frame, w_delete_button, w_edit_buttons_frame, w_edit_item_button, w_folder_buttons_frame, w_invert_button, w_menu_folder, w_menu_item, w_move_bottom_button, w_move_buttons_frame, w_move_down_button, w_move_folder_button, w_move_parent_button, w_move_top_button, w_move_up_button, w_new_folder_button, w_new_item_button, w_none_button, w_open_all_button, w_side_frame, w_tree, w_tree_canvas, w_tree_frame, and w_widgets_frame.
|
protected |
Copy constructor, not implemented.
original | object to copy |
|
virtual |
Destructor.
References local_tree, root_node, w_menu_folder, and w_menu_item.
|
private |
Macro from GCpp library that defines the following functions:
|
inlinevirtual |
Get TGListBox widget pointer.
References w_tree.
|
inlinevirtual |
Get "All" button pointer.
References w_all_button.
|
inlinevirtual |
Get "None" button pointer.
References w_none_button.
|
inlinevirtual |
Get "Invert" button pointer.
References w_invert_button.
|
inlinevirtual |
Get pointer to move buttons frame.
References w_side_frame.
|
inlinevirtual |
Get pointer to "folders" side buttons frame.
References w_folder_buttons_frame.
|
inlinevirtual |
Get "Open all folders" button pointer.
References w_open_all_button.
|
inlinevirtual |
Get "Close all folders" button pointer.
References w_close_all_button.
|
inlinevirtual |
Get pointer to "move" side buttons frame.
References w_move_buttons_frame.
|
inlinevirtual |
Get "Move up" button pointer.
References w_move_up_button.
|
inlinevirtual |
Get "Move down" button pointer.
References w_move_down_button.
|
inlinevirtual |
Get "Move top" button pointer.
References w_move_top_button.
|
inlinevirtual |
Get "Move bottom" button pointer.
References w_move_bottom_button.
|
inlinevirtual |
Get "Move to parent" button pointer.
References w_move_parent_button.
|
inlinevirtual |
Get "Move to another folder" button pointer.
References w_move_folder_button.
|
inlinevirtual |
Get pointer to "edit" side buttons frame.
References w_edit_buttons_frame.
|
inlinevirtual |
Get "New folder" button pointer.
References w_new_folder_button.
|
inlinevirtual |
Get "New item" button pointer.
References w_new_item_button.
|
inlinevirtual |
Get "Edit item" button pointer.
References w_edit_item_button.
|
inlinevirtual |
Get "Delete" button pointer.
References w_delete_button.
|
inlinevirtual |
Get pointer to "custom" side buttons frame.
References w_custom_buttons_frame.
|
virtual |
Add a button to side buttons. The button emits a signal CustomClicked(Int_t id).
text | button text |
id | button identification number |
l | frame layout |
tooltip | information message |
|
virtual |
Add a button to side buttons. The button emits a signal CustomClicked(Int_t id).
but | button pointer |
id | button identification number |
l | frame layout |
References MapSubwindows(), and w_custom_buttons_frame.
|
virtual |
Add a frame to side panel (buttons list).
f | frame pointer |
l | frame layout |
References MapSubwindows(), and w_side_frame.
|
virtual |
Add a frame below selection list.
f | frame pointer |
l | frame layout |
References MapSubwindows().
|
virtual |
Add a new separator to the items context menu.
References w_menu_item.
|
virtual |
Add a new menu entry to the items context menu.
title | menu title |
id | associated identifier |
References w_menu_item.
|
virtual |
Add a new sub-menu to the items context menu.
title | menu title |
submenu | popup menu to be added |
References w_menu_item.
|
virtual |
Add a new separator to the folders context menu.
References w_menu_folder.
|
virtual |
Add a new menu entry to the folders context menu.
title | menu title |
id | associated identifier |
References w_menu_folder.
|
virtual |
Add a new sub-menu to the folders context menu.
title | menu title |
submenu | popup menu to be added |
References w_menu_folder.
|
inline |
Return true if multiple selection option is set.
References options.
Referenced by AddElement(), AddFolder(), Construct(), RecreateTreeSubDisplay(), SelectAll(), SelectInvert(), SelectNone(), TreeDoubleClicked(), TreeReturnPressed(), UpdateItemSelection(), and UpdateTreeDisplay().
|
protectedvirtual |
Function called by constructor to setup the sub-widgets.
References RDico::its_all, RDico::its_all_tip, RDico::its_close_all, RDico::its_close_all_tip, RDico::its_delete, RDico::its_delete_tip, RDico::its_edit_item, RDico::its_edit_item_tip, RDico::its_folder_close, RDico::its_folder_open, RDico::its_invert, RDico::its_invert_tip, RDico::its_move_bottom, RDico::its_move_bottom_tip, RDico::its_move_down, RDico::its_move_down_tip, RDico::its_move_folder, RDico::its_move_folder_tip, RDico::its_move_parent, RDico::its_move_parent_tip, RDico::its_move_top, RDico::its_move_top_tip, RDico::its_move_up, RDico::its_move_up_tip, RDico::its_new_folder, RDico::its_new_folder_tip, RDico::its_new_item, RDico::its_new_item_tip, RDico::its_none, RDico::its_none_tip, RDico::its_open_all, RDico::its_open_all_tip, MultipleSelection(), options, rDico, tree_h_min, tree_w_min, w_all_button, w_button_frame, w_close_all_button, w_custom_buttons_frame, w_delete_button, w_edit_buttons_frame, w_edit_item_button, w_folder_buttons_frame, w_invert_button, w_menu_folder, w_menu_item, w_move_bottom_button, w_move_buttons_frame, w_move_down_button, w_move_folder_button, w_move_parent_button, w_move_top_button, w_move_up_button, w_new_folder_button, w_new_item_button, w_none_button, w_open_all_button, w_side_frame, w_tree, w_tree_canvas, w_tree_frame, and w_widgets_frame.
Referenced by RGItemTreeSelector().
|
virtual |
Overload of TGFrame function.
References tree_h_min, tree_w_min, UpdateButtonsState(), UpdateTreeDisplay(), w_menu_folder, w_menu_item, and w_tree.
Referenced by AddBottomFrame(), AddSideButton(), and AddSideFrame().
|
virtual |
Refresh the display of the tree view.
References w_tree.
Referenced by CloseAllFolders(), OpenAllFolders(), SelectInvert(), TreeDoubleClicked(), and UpdateTreeDisplay().
|
virtual |
Function that updates the tree structure selection from the tree-list widget.
branch | sub-tree structure to update (root if NULL) |
References MultipleSelection(), and root_node.
Referenced by ItemChecked().
|
virtual |
Function that clears the tree view widget and recreates it from scratch from the items tree structure.
References RecreateTreeSubDisplay(), root_node, UpdateTreeDisplay(), and w_tree.
Referenced by RGTreeRequester::Construct(), CreateSubFolder(), DeleteFolder(), DeleteItem(), MoveSelectedMoveBottom(), MoveSelectedMoveDown(), MoveSelectedMoveTop(), MoveSelectedMoveUp(), MoveSelectedToFolder(), MoveSelectedToParent(), and SetRootNode().
|
virtual |
Function that recreates the tree view elements for the children of the branch given as argument.
branch | tree structure branch for which the children tree view elements have to be recreated |
References default_element_pic, RGItem::GetIcon(), MultipleSelection(), and w_tree.
Referenced by RecreateTreeDisplay().
|
virtual |
Function that updates the tree-list widget from the content of the tree structure.
References MultipleSelection(), RefreshTreeView(), root_node, and w_tree.
Referenced by MapSubwindows(), RecreateTreeDisplay(), SelectAll(), SelectInvert(), SelectNone(), and TreeDoubleClicked().
|
virtual |
Update the buttons activation status according to checked items and selection.
References w_delete_button, w_edit_item_button, w_move_bottom_button, w_move_down_button, w_move_folder_button, w_move_parent_button, w_move_top_button, w_move_up_button, w_new_folder_button, w_new_item_button, and w_tree.
Referenced by MapSubwindows(), MoveSelectedMoveBottom(), MoveSelectedMoveDown(), MoveSelectedMoveTop(), MoveSelectedMoveUp(), MoveSelectedToFolder(), MoveSelectedToParent(), SelectionChanged(), and TreeClicked().
|
virtual |
Update the context menu for items, according to argument leaf.
leaf | selected leaf |
References w_menu_item.
Referenced by ProcessedEvent().
|
virtual |
Update the context menu for folders, according to argument branch.
branch | selected branch |
References w_menu_folder, and w_menu_item.
Referenced by ProcessedEvent().
|
inline |
Return the pointer to the tree root node.
References root_node.
void RGItemTreeSelector::SetDefaultPicture | ( | const string & | pic_name | ) |
Modify the default picture name for tree view elements.
pic_name | picture name |
References default_element_pic, and RG_ITL_DEFAULT_TREE_PICT.
GItemTreeBranch * RGItemTreeSelector::AddFolder | ( | const string & | name | ) |
Add a new folder in the tree structure.
name | folder name |
References options, and root_node.
Referenced by AddElement(), and CreateSubFolder().
GItemTreeBranch * RGItemTreeSelector::AddFolder | ( | GItemTreeBranch * | parent, |
const string & | name | ||
) |
Add a new folder in the tree structure. Since the parent folder is given explicitely, the item name should not contain any subfolder.
parent | parent folder in the tree structure |
name | folder name |
References MultipleSelection(), root_node, and w_tree.
GItemTreeLeaf * RGItemTreeSelector::AddElement | ( | const string & | name, |
void * | data, | ||
const TGPicture * | pic = NULL |
||
) |
Add a new element in the tree structure. The name is given relatively to the tree structure root, and may contain the sub-folder where the element should be placed.
name | element name |
data | pointer to the object referred by the element |
pic | pointer to the picture for the element |
References AddFolder(), options, and root_node.
GItemTreeLeaf * RGItemTreeSelector::AddElement | ( | GItemTreeBranch * | parent, |
const string & | name, | ||
void * | data, | ||
const TGPicture * | pic = NULL |
||
) |
Add a new element in the tree structure. Since the parent folder is given explicitely, the item name should not contain any subfolder.
parent | parent folder in the tree structure |
name | element name |
data | pointer to the object referred by the element |
pic | pointer to the picture for the element |
References default_element_pic, MultipleSelection(), root_node, and w_tree.
GItemTreeBranch * RGItemTreeSelector::SetRootNode | ( | GItemTreeBranch * | root, |
bool | adopt = false |
||
) |
Define the item tree from arguments. This function completely removes the current tree if it is defined: if it is defined locally (adopted), the tree structure is deleted, without any signal emission.
root | new tree root (main branch) |
adopt | whether the tree is defined locally and will be deleted by the widget |
References local_tree, RecreateTreeDisplay(), and root_node.
Referenced by RGTreeRequester::Construct().
|
virtual |
Set the argument node as selected item in the tree.
node | tree structure node to set as selected |
Referenced by CreateSubFolder(), MoveSelectedMoveBottom(), MoveSelectedMoveDown(), MoveSelectedMoveTop(), MoveSelectedMoveUp(), MoveSelectedToFolder(), MoveSelectedToParent(), TreeDoubleClicked(), and TreeReturnPressed().
|
virtual |
Set the argument element as selected item in the tree.
elem | tree view element to set as selected |
References prev_selected, and w_tree.
GItemTreeNode * RGItemTreeSelector::GetSelected | ( | ) | const |
Return a pointer to the currently selected (highlighted) node, or NULL if no element (item or folder) is selected.
References w_tree.
Referenced by GetSelectedLeaf(), and RGTreeRequester::ProcessButton().
GItemTreeLeaf * RGItemTreeSelector::GetSelectedLeaf | ( | ) | const |
Return a pointer to the currently selected (highlighted) item, or NULL if no item is selected or if a folder is selected.
References GetSelected().
Referenced by RGTreeRequester::ProcessButton().
|
virtual |
Open currently selected folder and all its sub-folders.
References OpenSubFolders(), and w_tree.
Referenced by MenuActivated().
|
virtual |
Close currently selected folder and all its sub-folders.
References CloseSubFolders(), and w_tree.
Referenced by MenuActivated().
|
virtual |
Open folder and all its sub-folders.
item | tree item to open |
References w_tree.
Referenced by OpenAllFolders(), and OpenSelectedSubFolders().
|
virtual |
Close folder and all its sub-folders.
item | tree item to open |
References w_tree.
Referenced by CloseAllFolders(), and CloseSelectedSubFolders().
|
virtual |
Open all tree folders.
References OpenSubFolders(), RefreshTreeView(), and w_tree.
Referenced by MenuActivated().
|
virtual |
Close all tree folders.
References CloseSubFolders(), RefreshTreeView(), and w_tree.
Referenced by MenuActivated().
|
virtual |
Move selected elements to top of the list. This function is effective only if the list is not always sorted. If emit is true (which is the default case when called from the move button), the SelectionMoved signal is emitted.
emit | flag for move signal emission |
References cancel_action, RecreateTreeDisplay(), SelectionMoved(), SelectItem(), UpdateButtonsState(), w_tree, and w_tree_canvas.
Referenced by MenuActivated().
|
virtual |
Move selected elements one step up. This function is effective only if the list is not always sorted. If emit is true (which is the default case when called from the move button), the SelectionMoved signal is emitted.
emit | flag for move signal emission |
References cancel_action, RecreateTreeDisplay(), SelectionMoved(), SelectItem(), UpdateButtonsState(), w_tree, and w_tree_canvas.
Referenced by MenuActivated().
|
virtual |
Move selected elements one step down. This function is effective only if the list is not always sorted. If emit is true (which is the default case when called from the move button), the SelectionMoved signal is emitted.
emit | flag for move signal emission |
References cancel_action, RecreateTreeDisplay(), SelectionMoved(), SelectItem(), UpdateButtonsState(), w_tree, and w_tree_canvas.
Referenced by MenuActivated().
|
virtual |
Move selected elements to the bottom of the list. This function is effective only if the list is not always sorted. If emit is true (which is the default case when called from the move button), the SelectionMoved signal is emitted.
emit | flag for move signal emission |
References cancel_action, RecreateTreeDisplay(), SelectionMoved(), SelectItem(), UpdateButtonsState(), w_tree, and w_tree_canvas.
Referenced by MenuActivated().
|
virtual |
Function moving the currently selected item to its parent folder. The element is placed after its current parent in the grand-parent list. If emit is true (which is the default case when called from the move menu), the SelectionMoved signal is emitted.
emit | flag for move signal emission |
References cancel_action, RecreateTreeDisplay(), SelectionMoved(), SelectItem(), UpdateButtonsState(), w_tree, and w_tree_canvas.
Referenced by MenuActivated().
|
virtual |
Function moving the currently selected item to another folder. The folder is selected using a requester. If emit is true (which is the default case when called from the move menu), the SelectionMoved signal is emitted.
emit | flag for move signal emission |
References RDico::brq_continue, RDico::brq_ok_cancel, RDico::brq_warning, cancel_action, RGTreeRequester::GetItemTreeSelector(), RDico::its_existing_warning, RDico::its_folder_itself_warning, RDico::its_move_to_folder_title, rDico, RecreateTreeDisplay(), RGBaseRequester::Request(), root_node, SelectionMoved(), SelectItem(), UpdateButtonsState(), and w_tree.
Referenced by MenuActivated().
|
virtual |
This function is called by the new folder creation button. Create a new folder in currently selected folder (or at tree root if no folder is selected).
References cancel_action, CreateSubFolder(), root_node, and w_tree.
Referenced by MenuActivated().
|
virtual |
This function is called by the new folder creation button, via the CreateNewFolder function. Create a sub-folder of argument branch.
parent | branch in which creating a sub-folder (if NULL, the folder will be created at tree root) |
References AddFolder(), RDico::brq_continue, RDico::brq_ok_cancel, RDico::brq_warning, RDico::its_existing_warning, RDico::its_new_folder_req_message, RDico::its_new_folder_req_root, RDico::its_new_folder_req_title, NewFolderCreated(), rDico, RecreateTreeDisplay(), root_node, and SelectItem().
Referenced by CreateNewFolder().
|
virtual |
This function is called when the "New item" button is clicked (after the emission of NewItemClicked signal, so that the action may be cancelled in a previously called slot). It does not create any item: it just emits a signal (CreateItem(GItemTreeBranch *)) indicating in which folder a new item should be created.
A slot should be connected to this signal for the effective creation of the item. The slot should may add the item using AddElement function, and then update the tree with the UpdateTreeDisplay function.
References cancel_action, CreateItem(), root_node, and w_tree.
Referenced by MenuActivated().
|
virtual |
This function is called when the "Edit item" button is clicked (after the emission of EditItemClicked signal, so that the action may be cancelled in a previously called slot). It does not edit any item: it just emits a signal (EditItem(GItemTreeLeaf *)) indicating in the item that should be edited.
A slot should be connected to this signal for the effective edition of the item. The slot should may update the tree with the UpdateTreeDisplay function if needed after edition.
References cancel_action, EditItem(), and w_tree.
Referenced by MenuActivated().
|
virtual |
This function is called when the "Delete" button is clicked (after the emission of DeleteClicked signal, so that the action may be cancelled in a previously called slot).
If the selected item is a folder, a confirmation that all its content should be deleted is requested.
References RDico::brq_ok_cancel, cancel_action, DeleteFolder(), DeleteItem(), RDico::its_delete_confirm_title, RDico::its_delete_folder_confirm, rDico, and w_tree.
Referenced by MenuActivated().
|
virtual |
Function called to delete an item (leaf) in the tree structure.
item | pointer to the tree leaf |
update | indicates whether the tree display should be updated |
References ItemRemoved(), and RecreateTreeDisplay().
Referenced by DeleteFolder(), and DeleteSelectedItem().
|
virtual |
Function called to delete a folder (branch) in the tree structure. This function recursively removes the content of the folder
branch | pointer to the tree branch |
update | indicates whether the tree display should be updated |
References DeleteItem(), and RecreateTreeDisplay().
Referenced by DeleteSelectedItem().
|
inlinevirtual |
|
inlinevirtual |
Get the move cancellation flag.
References cancel_action.
|
virtual |
Slot called by "select all" button (multiple selection). Select all elements (only valid if multiple selection is set).
References MultipleSelection(), root_node, SelectionChanged(), and UpdateTreeDisplay().
|
virtual |
Slot called by "select non" button (multiple selection). Unselect all elements (only valid if multiple selection is set).
References MultipleSelection(), root_node, SelectionChanged(), and UpdateTreeDisplay().
|
virtual |
Slot called by "select invert" button (multiple selection). Invert elements selection (only valid if multiple selection is set).
References MultipleSelection(), RefreshTreeView(), root_node, SelectionChanged(), and UpdateTreeDisplay().
|
virtual |
Slot called when the tree view is clicked.
item | pointer to the tree item clicked |
btn | button identifier |
References prev_selected, UpdateButtonsState(), and w_tree.
Referenced by TreeReturnPressed().
|
virtual |
Slot called when the tree view is double-clicked.
item | pointer to the tree item clicked |
btn | button identifier |
References MultipleSelection(), RefreshTreeView(), SelectionChanged(), SelectItem(), SingleSelected(), and UpdateTreeDisplay().
|
virtual |
Slot called when the return key is pressed in the tree view.
item | pointer to the tree item |
References MultipleSelection(), SelectItem(), SingleSelected(), and TreeClicked().
|
virtual |
Slot called when the check-button of an item is modified.
obj | user data object (in fact, a GItemTreeNode pointer) |
check | check state of the item |
References SelectionChanged(), and UpdateItemSelection().
|
virtual |
Slot called when an event is processed in the tree view. It is used to check if the context menu must popup.
event | type of event |
References UpdateMenuFolder(), UpdateMenuItem(), w_menu_folder, w_menu_item, and w_tree.
|
virtual |
Slot called when popup menu is acivated.
id | menu identifier |
References CloseAllFolders(), CloseSelectedSubFolders(), CreateNewFolder(), CreateNewItem(), CustomMenuActivated(), DeleteClicked(), DeleteSelectedItem(), EditItemClicked(), EditSelectedItem(), MoveBottomClicked(), MoveDownClicked(), MoveSelectedMoveBottom(), MoveSelectedMoveDown(), MoveSelectedMoveTop(), MoveSelectedMoveUp(), MoveSelectedToFolder(), MoveSelectedToParent(), MoveToFolderClicked(), MoveToParentClicked(), MoveTopClicked(), MoveUpClicked(), NewFolderClicked(), NewItemClicked(), OpenAllFolders(), and OpenSelectedSubFolders().
|
inlinevirtual |
Signal sent when "all" selection button is clicked.
|
inlinevirtual |
Signal sent when "none" selection button is clicked.
|
inlinevirtual |
Signal sent when "invert" selection button is clicked.
|
inlinevirtual |
Signal sent when selection is changed.
References UpdateButtonsState().
Referenced by ItemChecked(), SelectAll(), SelectInvert(), SelectNone(), and TreeDoubleClicked().
|
inlinevirtual |
Signal sent when Move Up button is clicked (or the corresponding context menu selected). The signal is emitted before moving elements, so that the action can be cancelled in a slot if needed, with CancelAction() function.
Referenced by MenuActivated().
|
inlinevirtual |
Signal sent when Move Down button is clicked (or the corresponding context menu selected). The signal is emitted before moving elements, so that the action can be cancelled in a slot if needed, with CancelAction() function.
Referenced by MenuActivated().
|
inlinevirtual |
Signal sent when Move Top button is clicked (or the corresponding context menu selected). The signal is emitted before moving elements, so that the action can be cancelled in a slot if needed, with CancelAction() function.
Referenced by MenuActivated().
|
inlinevirtual |
Signal sent when Move Bottom button is clicked (or the corresponding context menu selected). The signal is emitted before moving elements, so that the action can be cancelled in a slot if needed, with CancelAction() function.
Referenced by MenuActivated().
|
inlinevirtual |
Signal sent when Move to parent button is clicked (or the corresponding context menu selected). The signal is emitted before moving elements, so that the action can be cancelled in a slot if needed, with CancelAction() function.
Referenced by MenuActivated().
|
inlinevirtual |
Signal sent when Move to folder button is clicked (or the corresponding context menu selected). The signal is emitted before moving elements, so that the action can be cancelled in a slot if needed, with CancelAction() function.
Referenced by MenuActivated().
|
inlinevirtual |
Signal sent after elements have been moved, due to the move buttons.
Referenced by MoveSelectedMoveBottom(), MoveSelectedMoveDown(), MoveSelectedMoveTop(), MoveSelectedMoveUp(), MoveSelectedToFolder(), and MoveSelectedToParent().
|
inlinevirtual |
Signal sent when New Folder button is clicked. The signal is emitted before calling the effective editing function, so that the action can be cancelled in a slot if needed, with CancelAction() function.
Referenced by MenuActivated().
|
inlinevirtual |
Signal sent when New (item) button is clicked. The signal is emitted before calling the effective editing function, so that the action can be cancelled in a slot if needed, with CancelAction() function.
Referenced by MenuActivated().
|
inlinevirtual |
Signal sent when Edit (item) button is clicked. The signal is emitted before calling the effective editing function, so that the action can be cancelled in a slot if needed, with CancelAction() function.
Referenced by MenuActivated().
|
inlinevirtual |
Signal sent when New (item) button is clicked. The signal is emitted before calling the effective editing function, so that the action can be cancelled in a slot if needed, with CancelAction() function.
Referenced by MenuActivated().
|
inlinevirtual |
Signal sent after a new folder has been created (from button/ menu action, not from the AddFolder function).
item | pointer to folder item |
Referenced by CreateSubFolder().
|
inlinevirtual |
Signal sent for creation of a new item in selected folder.
parent | pointer to the folder where item should be created |
Referenced by CreateNewItem().
|
inlinevirtual |
Signal sent for edition of selected item.
item | pointer to folder item |
Referenced by EditSelectedItem().
|
inlinevirtual |
Signal sent for when an item (leaf) has been deleted from the tree. The argument pointer refers to the user data associated to the RGItem object of the leaf.
data | pointer item user data |
Referenced by DeleteItem().
|
inlinevirtual |
Signal sent when a user button is clicked.
id | identification number of the button |
|
inlinevirtual |
Signal sent when a user button is clicked.
id | identification number of the button |
Referenced by MenuActivated().
|
inlinevirtual |
Signal sent when an item (leaf, not a folder) is double-clicked or return pressed in single selection mode.
leaf_ptr | pointer to the leaf of selected item |
Referenced by TreeDoubleClicked(), and TreeReturnPressed().
RGItemTreeSelector::ClassDef | ( | RGItemTreeSelector | , |
0 | |||
) |
For ROOT dictionary.