12 #ifndef ROOT_TGListTree
13 #define ROOT_TGListTree
39 #ifndef ROOT_TDNDManager
93 virtual const char *
GetText()
const = 0;
Bool_t HasUserControl() const
virtual void SetPictures(const TGPicture *opened, const TGPicture *closed)
Change list tree item icons.
TGListTreeItem * fFirstchild
void AddRoot(const char *string)
virtual void SetCanvas(TGCanvas *canvas)
void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t beginWith=kFALSE)
virtual ~TGListTreeItemStd()
Delete list tree item.
virtual Int_t GetTipTextLength() const
static const TGGC & GetHighlightGC()
Return graphics context for highlighted frame background.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a list tree widget as a C++ statements on output stream out.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
virtual void * GetUserData() const =0
TGListTreeItem * FindChildByData(TGListTreeItem *item, void *userData)
Find child of item by userData.
TGListTreeItem * FindItemByObj(TGListTreeItem *item, void *ptr)
Find item with fUserData == ptr.
Int_t DeleteItem(TGListTreeItem *item)
Delete item from list tree.
virtual void SetCheckBox(Bool_t=kTRUE)
void InsertChildren(TGListTreeItem *parent, TGListTreeItem *item)
Insert a list of ALREADY LINKED children into another list.
virtual Bool_t HasColor() const =0
virtual Pixel_t GetActiveColor() const
Return color for marking items that are active or selected.
virtual Bool_t HasUnCheckedChild(Bool_t=kFALSE)
static const TGPicture * GetOpenPic()
Returns the icon used by items in open state.
void DrawItem(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y, Int_t *xroot, UInt_t *retwidth, UInt_t *retheight)
Draw list tree item.
void OnMouseOver(TGFrame *)
Signal emitted when pointer is over entry.
void MayNotUse(const char *method) const
Use this method to signal that a method (defined in a base class) may not be called in a derived clas...
static Pixel_t GetWhitePixel()
Get white pixel value.
void ReturnPressed(TGFrame *)
Signal emitted when Return/Enter key pressed.
void LineDown(Bool_t select=kFALSE)
Move content one item-size down.
void RenameSelected(const char *string)
static const TGGC & GetLineGC()
Return graphics context in use for line drawing.
virtual void ClearColor()
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Redraw list tree.
const TGPicture * fUncheckedPic
ECheckMode GetCheckMode() const
void Draw(Handle_t id, Int_t yevent, Int_t hevent)
Draw list tree widget.
Int_t TextWidth(const char *c)
Returns text width relative to currently used font.
static const TGPicture * GetUncheckedPic()
Returns the icon used for unchecked checkbox.
virtual Bool_t IsChecked() const
void DoubleClicked(TGFrame *, Int_t)
Emit DoubleClicked() signal.
void AddItem(const char *string)
virtual void SavePrimitive(std::ostream &, Option_t *, Int_t)
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Int_t DeleteChildren(TGListTreeItem *item)
Delete children of item from list.
virtual void AdjustPosition()
Move content to position of highlighted/activated frame.
virtual Bool_t HasCheckedChild(Bool_t first=kFALSE)
Add all child items of 'item' into the list 'checked'.
static const TGPicture * fgCheckedPic
virtual Color_t GetColor() const
virtual void CheckAllChildren(Bool_t state=kTRUE)
Set all child items of this one checked if state=kTRUE, unchecked if state=kFALSE.
TGListTreeItem * GetLastChild() const
Bool_t HandleDNDLeave()
Handle drag leave events.
virtual Bool_t HasUnCheckedChild(Bool_t first=kFALSE)
Add all child items of 'item' into the list 'checked'.
void RemoveReference(TGListTreeItem *item)
This function removes the specified item from the linked list.
void PDeleteChildren(TGListTreeItem *item)
Recursively delete all children of an item.
virtual void SavePrimitive(std::ostream &out, Option_t *option, Int_t n)
Save a list tree item attributes as a C++ statements on output stream.
const TGPicture * fCheckedPic
Bool_t IsEventHandled() const
virtual Int_t GetTipTextLength() const =0
void SetAutoCheckBoxPic(Bool_t on)
virtual const TGPicture * GetPicture() const =0
void DoubleClicked(TGFrame *, Int_t, Int_t, Int_t)
Emit DoubleClicked() signal.
void SetCheckMode(ECheckMode mode)
virtual const char * GetTipText() const
const char * Data() const
virtual void CheckItem(Bool_t=kTRUE)=0
TGListTreeItem * GetParent() const
TGListTreeItem * FindChildByName(TGListTreeItem *item, const char *name)
Find child of item by name.
virtual void Checked(TObject *obj, Bool_t check)
Emit Checked() signal.
static const TGPicture * GetClosedPic()
Returns the icon used by items in closed state.
void SetDNDTarget(Bool_t onoff)
void Clicked(TGFrame *, Int_t)
Emit Clicked() signal.
virtual TDNDData * GetDNDData(Atom_t)
void SetToolTipText(const char *text, Int_t x, Int_t y, Long_t delayms)
Set tool tip text associated with this item.
#define ClassDef(name, id)
void HighlightChildren(TGListTreeItem *item, Bool_t state, Bool_t draw)
Higlight item children.
virtual void SetActive(Bool_t)
void DrawItemName(Handle_t id, TGListTreeItem *item)
Draw name of list tree item.
virtual void SetUserData(void *, Bool_t=kFALSE)
virtual void DrawOutline(Handle_t id, TGListTreeItem *item, Pixel_t col=0xbbbbbb, Bool_t clear=kFALSE)
Draw a outline of color 'col' around an item.
void SetToolTipItem(TGListTreeItem *item, const char *string)
Set tooltip text for this item.
virtual Bool_t HasCheckedChild(Bool_t=kFALSE)
Int_t SortSiblings(TGListTreeItem *item)
Sort siblings of item.
virtual Bool_t IsActive() const =0
virtual Bool_t HandlesDragAndDrop() const
virtual void SetUserData(void *userData, Bool_t own=kFALSE)
virtual Bool_t HasCheckBox() const
void AdjustPosition()
Move content to position of highlighted/activated frame.
virtual void HandleDrop()
static TGGC * fgHighlightGC
TGListTreeItem * FindSiblingByData(TGListTreeItem *item, void *userData)
Find sibling of item by userData.
EColorMarkupMode fColorMode
void SetEventHandled(Bool_t eh=kTRUE)
static const TGPicture * fgClosedPic
virtual Pixel_t GetActiveColor() const =0
TGListTreeItem * GetBelowMouse() const
virtual UInt_t GetPicWidth() const
Return width of item's icon.
virtual Bool_t IsActive() const
TGListTreeItem * FindItem(Int_t findy)
Find item at postion findy.
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
static Pixel_t GetGrayPixel()
Return gray draw color in use.
void InsertChild(TGListTreeItem *parent, TGListTreeItem *item)
Insert child in list.
TGListTreeItem * fPrevsibling
TGListTreeItem * GetFirstItem() const
virtual void SetText(const char *)
virtual const TGPicture * GetCheckBoxPicture() const
virtual void SetCheckBox(Bool_t on=kTRUE)
Set a check box on the tree node.
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
TGListTreeItemStd(const TGListTreeItemStd &)
static const TGFont * fgDefaultFont
virtual Color_t GetColor() const =0
void GetCheckedChildren(TList *checked, TGListTreeItem *item)
Add all child items of 'item' into the list 'checked'.
void CurrentChanged(TGFrame *)
Emit signal when current selected frame changed.
void UnselectAll(Bool_t draw)
Unselect all items.
void OpenItem(TGListTreeItem *item)
Open item in list tree (i.e. show child items).
virtual void SetTipText(const char *)
static const TGGC & GetActiveGC()
Return default graphics context in use.
static const TGPicture * GetCheckedPic()
Returns the icon used for checked checkbox.
virtual void SetCheckBoxPictures(const TGPicture *, const TGPicture *)
void PDeleteItem(TGListTreeItem *item)
Delete given item.
static const TGGC & GetDrawGC()
Return default graphics context in use.
TGListTreeItem * fSelected
virtual void * GetUserData() const
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
void CheckAllChildren(TGListTreeItem *item, Bool_t state)
Check all child items of 'item' and 'item' itself according to the state value: kTRUE means check all...
TGListTreeItem * GetNextSibling() const
virtual ~TGListTreeItem()
TGListTreeItem * GetFirstChild() const
void SetUserControl(Bool_t ctrl=kTRUE)
TGListTreeItem * fLastchild
TGListTreeItem & operator=(const TGListTreeItem &)
virtual Bool_t HasCheckBox() const =0
void GetPathnameFromItem(TGListTreeItem *item, char *path, Int_t depth=0)
Get pathname from item.
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
virtual void SetOpen(Bool_t o)
void GetChecked(TList *checked)
Add all checked list tree items of this list tree into the list 'checked'.
virtual const char * GetText() const =0
void ClearHighlighted()
Un highlight items.
Bool_t IsDNDSource() const
void Draw(Option_t *="")
Default Draw method for all objects.
virtual void CheckItem(Bool_t checked=kTRUE)
Int_t DrawChildren(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y, Int_t xroot)
Draw children of item in list tree.
void PageDown(Bool_t select=kFALSE)
Move content one page down.
virtual void UpdateState()
Update the state of the node 'item' according to the children states.
void SetColorMode(EColorMarkupMode colorMode)
TGListTree(const TGListTree &)
virtual void SetColor(Color_t color)
virtual Bool_t HandleButton(Event_t *event)
Handle button events in the list tree.
virtual void SetCheckBoxPictures(const TGPicture *checked, const TGPicture *unchecked)
Change list tree check item icons.
virtual ~TGListTree()
Delete list tree widget.
TGListTreeItem(const TGListTreeItem &)
Int_t FontHeight()
Returns height of currently used font.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event.
Int_t SortChildren(TGListTreeItem *item)
Sort children of item.
TGListTreeItem * fDropItem
void Rename(const char *new_name)
virtual const char * GetText() const
void CurrentChanged(Int_t, Int_t)
Emit signal when current position changed.
Bool_t HandleDNDDrop(TDNDData *data)
Handle drop events.
TGListTreeItem * fCurrent
TGListTreeItem * GetCurrent() const
Bool_t IsDNDTarget() const
virtual Int_t GetTextLength() const =0
TGListTreeItem * GetSelected() const
virtual Bool_t IsOpen() const
virtual void CheckChildren(TGListTreeItem *, Bool_t)
virtual void Layout()
Layout container entries.
void DisableOpen(Bool_t disable=kTRUE)
void select(Int_t replica=1, Int_t color=kGreen)
void Clicked(TGFrame *, Int_t, Int_t, Int_t)
Emit Clicked() signal.
virtual void DrawActive(Handle_t id, TGListTreeItem *item)
Draw active item with its active color.
void Search(Bool_t close=kTRUE)
Invokes search dialog. Looks for item with the entered name.
virtual void SetActive(Bool_t a)
virtual const TGPicture * GetCheckBoxPicture() const =0
TGListTreeItem * FindSiblingByName(TGListTreeItem *item, const char *name)
Find sibling of item by name.
void PageUp(Bool_t select=kFALSE)
Move content one page up.
Int_t ReparentChildren(TGListTreeItem *item, TGListTreeItem *newparent)
Make newparent the new parent of the children of item.
TGListTreeItem * GetPrevSibling() const
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click event in the list tree (only for kButton1).
Atom_t HandleDNDEnter(Atom_t *typelist)
Handle drag enter events.
static const TGPicture * fgOpenPic
virtual const TGPicture * GetPicture() const
TGListTreeItem * fBelowMouse
TGListTreeItemStd & operator=(const TGListTreeItemStd &)
virtual void SetText(const char *text)
virtual void SetPictures(const TGPicture *, const TGPicture *)
virtual void CheckAllChildren(Bool_t=kTRUE)
void SetCheckBox(TGListTreeItem *item, Bool_t on=kTRUE)
Set check button state for the node 'item'.
Mother of all ROOT objects.
Int_t Sort(TGListTreeItem *item)
Sort items starting with item.
Int_t SearchChildren(TGListTreeItem *item, Int_t y, Int_t findy, TGListTreeItem **finditem)
Search child item.
void ToggleItem(TGListTreeItem *item)
Toggle check button state of the node 'item'.
Int_t Reparent(TGListTreeItem *item, TGListTreeItem *newparent)
Make newparent the new parent of item.
void KeyPressed(TGFrame *, UInt_t, UInt_t)
Signal emitted when keyboard key pressed.
TGListTreeItem * FindItemByPathname(const char *path)
Find item by pathname.
virtual Bool_t IsChecked() const =0
virtual void UpdateState()
static Pixel_t fgGrayPixel
void SetAutoTips(Bool_t on=kTRUE)
TGListTreeItem * fNextsibling
void SetDNDSource(Bool_t onoff)
void CloseItem(TGListTreeItem *item)
Close item in list tree (i.e. hide child items).
virtual void SetColor(Color_t)
Atom_t HandleDNDPosition(Int_t x, Int_t y, Atom_t action, Int_t xroot, Int_t yroot)
Handle dragging position events.
Int_t FontAscent()
Returns ascent of currently used font.
static const TGGC & GetColorGC()
Return graphics context for highlighted frame background.
virtual void HandleDrag()
virtual Int_t GetTextLength() const
void SaveChildren(std::ostream &out, TGListTreeItem *item, Int_t &n)
Save child items as a C++ statements on output stream out.
TGListTreeItem * fTipItem
void CheckItem(TGListTreeItem *item, Bool_t check=kTRUE)
Set check button state for the node 'item'.
static const TGPicture * fgUncheckedPic
TGListTree & operator=(const TGListTree &)
const TGPicture * fOpenPic
void HighlightItem(TGListTreeItem *item)
Highlight item.
virtual Bool_t HasColor() const
EColorMarkupMode GetColorMode() const
virtual void ClearColor()
virtual void UpdateChecked(TGListTreeItem *item, Bool_t redraw=kFALSE)
Update the state of the node 'item' according to the children states.
virtual void MouseOver(TGListTreeItem *entry)
Signal emitted when pointer is over entry.
void DrawNode(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y)
Draw node (little + in box).
void SetSelected(TGListTreeItem *item)
Int_t RecursiveDeleteItem(TGListTreeItem *item, void *userData)
Delete item with fUserData == ptr.
void RenameItem(TGListTreeItem *item, const char *string)
Rename item in list tree.
void Home(Bool_t select=kFALSE)
Move content to the top.
virtual Bool_t HandleKey(Event_t *event)
The key press event handler converts a key press to some line editor action.
void LineUp(Bool_t select=kFALSE)
Move content one item-size up.
virtual void CheckChildren(TGListTreeItem *item, Bool_t state)
Set all child items of 'item' checked if state=kTRUE; unchecked if state=kFALSE.
virtual const char * GetTipText() const =0
const TGPicture * fClosedPic
void End(Bool_t select=kFALSE)
Move content to the bottom.
virtual void DataDropped(TGListTreeItem *item, TDNDData *data)
Emit DataDropped() signal.
virtual void SetTipText(const char *tip)