JG ROOT Tools libraries
version 5.0 - august 2014
|
#include <RGItemListBox.hh>
Public Member Functions | |
Pointers to sub-widgets | |
virtual TGListBox * | GetListBox () const |
virtual TGVerticalFrame * | GetSideFrame () const |
virtual TGTextButton * | GetAllButton () const |
virtual TGTextButton * | GetNoneButton () const |
virtual TGTextButton * | GetInvertButton () const |
virtual TGVerticalFrame * | GetSideButtonsFrame () const |
virtual TGTextButton * | GetMoveUpButton () const |
virtual TGTextButton * | GetMoveDownButton () const |
virtual TGTextButton * | GetMoveTopButton () const |
virtual TGTextButton * | GetMoveBottomButton () const |
Widgets functions | |
virtual void | MapSubwindows () |
virtual void | ListBoxLayout () |
virtual TGButton * | AddSideButton (const char *text, const Int_t id, const char *tooltip=NULL) |
virtual TGButton * | AddSideButton (TGButton *but, const Int_t id) |
virtual TGFrame * | AddSideFrame (TGFrame *f, TGLayoutHints *l=NULL) |
virtual TGFrame * | AddBottomFrame (TGFrame *f, TGLayoutHints *l=NULL) |
List of elements functions | |
virtual GItemListIter | Begin () const |
virtual GItemListIter | End () const |
virtual GItemListIter | Null () const |
virtual Int_t | GetSize () const |
Running functions | |
virtual const GItem * | Select (const Int_t n, const Bool_t b=kTRUE) |
virtual void | SetItemVisible (const Int_t n) |
virtual Int_t | GetSelectedFirst () const |
virtual Int_t | GetSelectedLast () const |
virtual Int_t | GetSelectedNumber () const |
virtual GItem * | GetItem (Int_t id) const |
virtual Int_t | GetSelected () const |
virtual Bool_t | GetSelection (Int_t id) const |
virtual Int_t | GetItemNumber () const |
virtual Int_t | AddItem (const string &s, void *ptr=NULL, const Bool_t update=true) |
virtual Int_t | AddItem (const GItem &item, const Bool_t update=true) |
virtual Int_t | AddItem (GItem *item, const Bool_t update=true) |
virtual void | RemoveItem (const Int_t n, const Bool_t update=true) |
virtual void | Sort (const bool invert=false) |
virtual void | Sort (const int order) |
virtual void | SelectionMoveTop (const Bool_t update=kTRUE, const Bool_t emit=kTRUE) |
virtual void | SelectionMoveUp (const Bool_t update=kTRUE, const Bool_t emit=kTRUE) |
virtual void | SelectionMoveDown (const Bool_t update=kTRUE, const Bool_t emit=kTRUE) |
virtual void | SelectionMoveBottom (const Bool_t update=kTRUE, const Bool_t emit=kTRUE) |
virtual void | CancelMove (const Bool_t cancel=kTRUE) |
virtual Bool_t | GetCancelMoveState () const |
virtual void | SelectionRemove () |
virtual void | SelectAll () |
virtual void | SelectNone () |
virtual void | SelectInvert () |
Internal functions (no need to be protected) | |
virtual void | UpdateItemList () |
virtual void | UpdateListBox () |
virtual void | UpdateButtonState () |
Slots from sub-widgets | |
virtual void | ListSelected (Int_t n) |
virtual void | ListSelectionChanged () |
virtual void | ProcessedEvent (Event_t *event) |
Signals | |
virtual void | MoveUpClicked () |
virtual void | MoveDownClicked () |
virtual void | MoveTopClicked () |
virtual void | MoveBottomClicked () |
virtual void | SelectionMoved () |
virtual void | CustomClicked (Int_t id) |
virtual void | SelectionAllClicked () |
virtual void | SelectionNoneClicked () |
virtual void | SelectionInvertClicked () |
virtual void | Selected (Int_t n) |
virtual void | SelectionChanged () |
virtual void | DoubleClicked (Int_t n) |
virtual void | ItemRemoved (ULong_t ptr) |
ROOT related functions | |
ClassDef (RGItemListBox, 0) | |
Protected Attributes | |
GItemList | item_list |
List of elements. | |
UInt_t | list_w_min |
List widget minimum width. | |
UInt_t | list_h_min |
List widget minimum height. | |
UInt_t | options |
Widget options. | |
Int_t | previous_selected |
Dernière entrée clickée | |
Int_t | last_selected |
Last entry selected. | |
TGHorizontalFrame * | w_widgets_frame |
Main frame. | |
TGVerticalFrame * | w_list_frame |
List and move buttons frame. | |
TGListBox * | w_list |
List 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 |
Move buttons frame. | |
TGTextButton * | w_move_up |
Move button. | |
TGTextButton * | w_move_down |
Move button. | |
TGTextButton * | w_move_top |
Move button. | |
TGTextButton * | w_move_bottom |
Move button. | |
Bool_t | move_cancel |
Flag for move cancellation. | |
Bool_t | ctrl_key |
Flag for selection with CTRL key. | |
Bool_t | shift_key |
Flag for selection with Shift key. | |
Bool_t | dble_click |
Flag for double-click selection. | |
Int_t | dble_time |
Double-click time. | |
Private Member Functions | |
GObject (RGItemListBox) | |
Constructors, affectation, destructor | |
RGItemListBox (TGWindow *p, const char *label=NULL, const UInt_t opts=0, const UInt_t w_min=80, const UInt_t h_min=80) | |
virtual | ~RGItemListBox () |
RGItemListBox (const RGItemListBox &original) | |
This class defines a widget containing a list for selection of elements. The list elements are pointers on user objects, referred to by GItem objects.
The list of elements is presented in the widget through a TGListBox widget. Some buttons are predefined for various selection actions:
Options are defined at creation time, and may not be changed after: some internal widgets are only created according to these options. If an option may exceptionnaly be changed after creation, it is mentioned.
Options defined in the RGItemListBoxOptions enumeration:
RGItemListBox::RGItemListBox | ( | TGWindow * | p, |
const char * | label = NULL , |
||
const UInt_t | opts = 0 , |
||
const UInt_t | w_min = 80 , |
||
const UInt_t | h_min = 80 |
||
) |
Constructor.
p | parent widget |
label | list label |
opts | options |
w_min | minimum width of list widget |
h_min | minimum height of list widget |
References ctrl_key, dble_click, dble_time, RDico::ilb_all, RDico::ilb_all_tip, RDico::ilb_bottom, RDico::ilb_bottom_tip, RDico::ilb_down, RDico::ilb_down_tip, RDico::ilb_invert, RDico::ilb_invert_tip, RDico::ilb_none, RDico::ilb_none_tip, RDico::ilb_top, RDico::ilb_top_tip, RDico::ilb_up, RDico::ilb_up_tip, item_list, last_selected, list_h_min, list_w_min, move_cancel, options, previous_selected, rDico, shift_key, w_all_button, w_button_frame, w_invert_button, w_list, w_list_frame, w_move_bottom, w_move_down, w_move_top, w_move_up, w_none_button, w_side_frame, and w_widgets_frame.
|
protected |
Copy constructor, not implemented.
original | object to copy |
|
virtual |
Destructor.
References item_list, and RemoveItem().
|
private |
Macro from GCpp library that defines the following functions:
|
inlinevirtual |
Get TGListBox widget pointer.
References w_list.
Referenced by RGListRequester::Construct(), and RGListRequester::MapRequester().
|
inlinevirtual |
Get pointer to side buttons frame.
References w_side_frame.
Referenced by RGItemSelectionBox::AddDestButton(), and RGItemSelectionBox::AddSrcButton().
|
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 "Move up" button pointer.
References w_move_up.
|
inlinevirtual |
Get "Move down" button pointer.
References w_move_down.
|
inlinevirtual |
Get "Move top" button pointer.
References w_move_top.
|
inlinevirtual |
Get "Move bottom" button pointer.
References w_move_bottom.
|
virtual |
Overload of TGFrame function.
References GetSelectedFirst(), list_h_min, list_w_min, SetItemVisible(), UpdateButtonState(), UpdateListBox(), and w_list.
Referenced by AddBottomFrame(), AddSideButton(), and AddSideFrame().
|
inlinevirtual |
|
virtual |
Add a button to side buttons. The button emits a signal CustomClicked(Int_t id).
text | button text |
id | button identification number |
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 |
References MapSubwindows(), and w_side_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().
Referenced by RGItemSelectionBox::AddDestBottomFrame(), and RGItemSelectionBox::AddSrcBottomFrame().
|
inlinevirtual |
Get the iterator on first list element.
References item_list.
Referenced by RGItemSelectionBox::DestBegin(), RGItemSelectionBox::DestSelectionToSrc(), RGItemSelectionBox::SelectionRemove(), RGItemSelectionBox::SrcBegin(), and RGItemSelectionBox::SrcSelectionToDest().
|
inlinevirtual |
Get the iterator on last list element.
References item_list.
Referenced by RGItemSelectionBox::DestEnd(), and RGItemSelectionBox::SrcEnd().
|
inlinevirtual |
Get the null list iterator.
References item_list.
Referenced by RGItemSelectionBox::DestSelectionToSrc(), RGItemSelectionBox::SelectionRemove(), and RGItemSelectionBox::SrcSelectionToDest().
|
inlinevirtual |
Get the list size.
References item_list.
Referenced by RGItemSelectionBox::GetDestSize(), and RGItemSelectionBox::GetSrcSize().
|
virtual |
Set an element selection status.
n | element number |
b | selection status |
References item_list, options, previous_selected, and w_list.
Referenced by AddItem(), RGListRequester::Construct(), RGItemSelectionBox::DestSelectionToSrc(), ListSelected(), ProcessedEvent(), and RGItemSelectionBox::SrcSelectionToDest().
|
virtual |
Move the scroll bar so that an element becomes visible. If the element is above the visible area, the display is set so that it becomes the first visible element. If it is below, it becomes the last visible element.
n | element number |
References w_list.
Referenced by AddItem(), MapSubwindows(), SelectionMoveBottom(), SelectionMoveDown(), SelectionMoveTop(), and SelectionMoveUp().
|
virtual |
Get the number of the first selected element, or -1 if no element is selected.
References item_list.
Referenced by MapSubwindows(), SelectionMoveTop(), SelectionMoveUp(), and UpdateButtonState().
|
virtual |
Get the number of the last selected element, or -1 if no element is selected.
References item_list.
Referenced by SelectionMoveBottom(), SelectionMoveDown(), and UpdateButtonState().
|
virtual |
Get the number of selected elements.
References item_list.
Referenced by RGItemSelectionBox::DestSelectionToSrc(), ListSelected(), RGItemSelectionBox::SelectionRemove(), RGItemSelectionBox::SrcSelectionToDest(), and UpdateButtonState().
|
inlinevirtual |
Get the pointer to a list element.
id | element number |
References item_list.
Referenced by RGItemSelectionBox::DestSelectionToSrc(), RGItemSelectionBox::GetDestItem(), RGItemSelectionBox::GetSrcItem(), and RGItemSelectionBox::RemoveSubItems().
|
inlinevirtual |
Get last selected element of the TGListBox (see TGListBox::GetSelected).
References w_list.
Referenced by ProcessedEvent().
|
inlinevirtual |
Get the selection status of an element (see TGListBox::GetSelected).
id | element number |
References w_list.
Referenced by RGListRequester::ItemSelected(), ListSelected(), and RGListRequester::ProcessButton().
|
inlinevirtual |
Get the number of elements in the list.
References item_list.
Referenced by RGListRequester::Construct(), RGItemSelectionBox::DestSelectionToSrc(), and RGItemSelectionBox::RemoveSubItems().
|
inlinevirtual |
Add an element to the list. The function returns the element index if it is added, and -1 if adding has failed. Default behavior is that the list-box is updated from the list of elements, except if argument update is false. This should only be used in cases several elements will be added. In such case, only the objects list is updated (item_list), and not the list-box (w_list). In case of a later use of UpdateListBox(), the window display should be repositionned with SetItemVisible() function.
s | element name |
ptr | user data pointer |
update | flag for list-box update |
Referenced by RGItemSelectionBox::AddItem(), AddItem(), RGListRequester::Construct(), RGItemSelectionBox::DestSelectionToSrc(), RGItemSelectionBox::SrcItemToDest(), and RGItemSelectionBox::SrcSelectionToDest().
|
inlinevirtual |
Add an element to the list. The function returns the element index if it is added, and -1 if adding has failed. Default behavior is that the list-box is updated from the list of elements, except if argument update is false. This should only be used in cases several elements will be added. In such case, only the objects list is updated (item_list), and not the list-box (w_list). In case of a later use of UpdateListBox(), the window display should be repositionned with SetItemVisible() function.
item | element to add (cloned) |
update | flag for list-box update |
References AddItem().
|
virtual |
Add an element to the list. The function returns the element index if it is added, and -1 if adding has failed. Default behavior is that the list-box is updated from the list of elements, except if argument update is false. This should only be used in cases several elements will be added. In such case, only the objects list is updated (item_list), and not the list-box (w_list). In case of a later use of UpdateListBox(), the window display should be repositionned with SetItemVisible() function.
item | pointer to element to be added (adopted) |
update | flag for list-box update |
References item_list, Select(), SetItemVisible(), and UpdateListBox().
|
virtual |
Remove an element from the list. Default behavior is that the list-box is updated from the list of elements, except if argument update is false. This should only be used in cases several elements will be removed. In such case, only the objects list is updated (item_list), and not the list-box (w_list).
n | index of element to remove |
update | flag for list-box update |
References item_list, ItemRemoved(), and UpdateListBox().
Referenced by RGItemSelectionBox::DestSelectionToSrc(), RGItemSelectionBox::RemoveSubItems(), RGItemSelectionBox::SrcItemToDest(), and ~RGItemListBox().
|
virtual |
Sort the list. The sorting order depends on options. This function modifies the sorting options.
invert | indicate if order may be inverted with respect to current options |
References item_list, and UpdateListBox().
|
virtual |
Sort the list. The sorting order depends on the function argument. This function modifies the sorting options.
order | sorting order: descendant (<0), ascendant (>0), according to current options (=0) |
References item_list, and UpdateListBox().
|
virtual |
Move selected elements to top of the list. This function is effective only if the list is not always sorted.
update | flag for display update |
emit | flag for move signal emission |
References GetSelectedFirst(), move_cancel, options, SelectionMoved(), SelectionMoveUp(), SetItemVisible(), and UpdateListBox().
|
virtual |
Move selected elements one step up. This function is effective only if the list is not always sorted.
update | flag for display update |
emit | flag for move signal emission |
References GetSelectedFirst(), item_list, move_cancel, options, SelectionMoved(), SetItemVisible(), and UpdateListBox().
Referenced by SelectionMoveTop().
|
virtual |
Move selected elements one step down. This function is effective only if the list is not always sorted.
update | flag for display update |
emit | flag for move signal emission |
References GetSelectedLast(), item_list, move_cancel, options, SelectionMoved(), SetItemVisible(), and UpdateListBox().
Referenced by SelectionMoveBottom().
|
virtual |
Move selected elements to the bottom of the list. This function is effective only if the list is not always sorted.
update | flag for display update |
emit | flag for move signal emission |
References GetSelectedLast(), item_list, move_cancel, options, SelectionMoved(), SelectionMoveDown(), SetItemVisible(), and UpdateListBox().
|
inlinevirtual |
|
inlinevirtual |
Get the move cancellation flag.
References move_cancel.
|
virtual |
Remove selected elements from the list.
References item_list, ItemRemoved(), and UpdateListBox().
Referenced by RGItemSelectionBox::SrcSelectionToDest().
|
virtual |
Select all elements (only valid if multiple selection is set).
References item_list, options, SelectionChanged(), and UpdateListBox().
|
virtual |
Unselect all elements (only valid if multiple selection is set).
References item_list, options, SelectionChanged(), and UpdateListBox().
|
virtual |
Invert elements selection (only valid if multiple selection is set).
References item_list, options, SelectionChanged(), and UpdateListBox().
|
virtual |
Update objects list selection flags , from the list-box elements.
References item_list, and w_list.
Referenced by ListSelected(), and ListSelectionChanged().
|
virtual |
Update the list-box from the objects list. The widget is redrawn using ListBoxLayout().
cerr << "RGItemListBox::UpdateListBox()" << endl;
References item_list, ListBoxLayout(), UpdateButtonState(), and w_list.
Referenced by AddItem(), RGListRequester::Construct(), RGItemSelectionBox::DestSelectionToSrc(), ListSelected(), ListSelectionChanged(), MapSubwindows(), ProcessedEvent(), RemoveItem(), RGItemSelectionBox::RemoveSubItems(), SelectAll(), SelectInvert(), SelectionMoveBottom(), SelectionMoveDown(), SelectionMoveTop(), SelectionMoveUp(), SelectionRemove(), SelectNone(), Sort(), RGItemSelectionBox::SrcItemToDest(), RGItemSelectionBox::SrcSelectionToDest(), and RGItemSelectionBox::UpdateSelectionBox().
|
virtual |
Update buttons status according to the number of selected elements (move buttons, multiple selection).
References GetSelectedFirst(), GetSelectedLast(), GetSelectedNumber(), item_list, options, w_all_button, w_invert_button, w_move_bottom, w_move_down, w_move_top, w_move_up, and w_none_button.
Referenced by ListSelectionChanged(), MapSubwindows(), and UpdateListBox().
|
virtual |
Slot for selection of a list-box element.
n | element identification number |
References ctrl_key, dble_click, DoubleClicked(), GetSelectedNumber(), GetSelection(), item_list, last_selected, options, previous_selected, Select(), Selected(), shift_key, UpdateItemList(), and UpdateListBox().
Referenced by ProcessedEvent().
|
virtual |
Slot for list-box selection change.
References ctrl_key, item_list, options, SelectionChanged(), UpdateButtonState(), UpdateItemList(), UpdateListBox(), and w_list.
|
virtual |
Slot called when a ROOT event is processed in the list. When the slot is called, the event is already determined.
References ctrl_key, dble_click, dble_time, GetSelected(), last_selected, ListSelected(), options, rgDoubleClickDelay, Select(), shift_key, and UpdateListBox().
|
inlinevirtual |
Signal sent when Move Up is clicked. The signal is emitted before moving elements, so that the action can be cancelled in a slot if needed, with CancelMove() function.
|
inlinevirtual |
Signal sent when Move Down is clicked. The signal is emitted before moving elements, so that the action can be cancelled in a slot if needed, with CancelMove() function.
|
inlinevirtual |
Signal sent when Move Top is clicked. The signal is emitted before moving elements, so that the action can be cancelled in a slot if needed, with CancelMove() function.
|
inlinevirtual |
Signal sent when Move Bottom is clicked. The signal is emitted before moving elements, so that the action can be cancelled in a slot if needed, with CancelMove() function.
|
inlinevirtual |
Signal sent after elements have been moved, due to the move buttons.
Referenced by SelectionMoveBottom(), SelectionMoveDown(), SelectionMoveTop(), and SelectionMoveUp().
|
inlinevirtual |
Signal sent when a user button is clicked.
id | identification number of the button |
|
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 an element is selected.
n | element identification number |
Referenced by ListSelected().
|
inlinevirtual |
Signal sent when selection is changed.
Referenced by ListSelectionChanged(), SelectAll(), SelectInvert(), and SelectNone().
|
inlinevirtual |
Signal sent for double-click of an element.
n | element identification number |
Referenced by ListSelected().
|
inlinevirtual |
Signal sent when an element is suppressed.
ptr | pointer to the element user data |
Referenced by RemoveItem(), and SelectionRemove().
RGItemListBox::ClassDef | ( | RGItemListBox | , |
0 | |||
) |
For ROOT dictionary.