library: libGui
#include "TGListTree.h"

TGListTree


class description - header file - source file - inheritance tree (.pdf)

class TGListTree : public TGContainer

Inheritance Chart:
TObject
<-
TGObject
<-
TGWindow
TQObject
<-
TGFrame
<-
TGCompositeFrame
<-
TGContainer
<-
TGListTree

    protected:
TGListTree(const TGListTree&) virtual void Clicked(TGFrame*, Int_t) virtual void Clicked(TGFrame*, Int_t, Int_t, Int_t) virtual void CurrentChanged(Int_t, Int_t) virtual void CurrentChanged(TGFrame*) virtual void DoRedraw() virtual void DoubleClicked(TGFrame*, Int_t) virtual void DoubleClicked(TGFrame*, Int_t, Int_t, Int_t) void Draw(Int_t yevent, Int_t hevent) virtual void Draw(Option_t* = "") Int_t DrawChildren(TGListTreeItem* item, Int_t x, Int_t y, Int_t xroot) void DrawItem(TGListTreeItem* item, Int_t x, Int_t y, Int_t* xroot, UInt_t* retwidth, UInt_t* retheight) void DrawItemName(TGListTreeItem* item) void DrawNode(TGListTreeItem* item, Int_t x, Int_t y) TGListTreeItem* FindItem(Int_t findy) virtual void* FindItem(const TString& name, Bool_t direction = kTRUE, Bool_t caseSensitive = kTRUE, Bool_t beginWith = kFALSE) static const TGGC& GetColorGC() static FontStruct_t GetDefaultFontStruct() static const TGGC& GetDrawGC() static Pixel_t GetGrayPixel() static const TGGC& GetHighlightGC() static const TGGC& GetLineGC() void InsertChild(TGListTreeItem* parent, TGListTreeItem* item) void InsertChildren(TGListTreeItem* parent, TGListTreeItem* item) virtual void KeyPressed(TGFrame*, UInt_t, UInt_t) virtual void Layout() virtual void OnMouseOver(TGFrame*) TGListTree& operator=(const TGListTree&) void PDeleteChildren(TGListTreeItem* item) void RemoveReference(TGListTreeItem* item) virtual void ReturnPressed(TGFrame*) void SaveChildren(ostream& out, TGListTreeItem* item, Int_t& n) Int_t SearchChildren(TGListTreeItem* item, Int_t y, Int_t findy, TGListTreeItem** finditem) void UpdateChecked(TGListTreeItem* item, Bool_t redraw = kFALSE) public:
TGListTree(TGWindow* p = 0, UInt_t w = 1, UInt_t h = 1, UInt_t options = 0, Pixel_t back = GetWhitePixel()) TGListTree(TGCanvas* p, UInt_t options, Pixel_t back = GetWhitePixel()) virtual ~TGListTree() TGListTreeItem* AddItem(TGListTreeItem* parent, const char* string, const TGPicture* open = 0, const TGPicture* closed = 0, Bool_t checkbox = kFALSE) TGListTreeItem* AddItem(TGListTreeItem* parent, const char* string, void* userData, const TGPicture* open = 0, const TGPicture* closed = 0, Bool_t checkbox = kFALSE) void AddItem(const char* string) void AddRoot(const char* string) void AdjustPosition(TGListTreeItem* item) virtual void AdjustPosition() virtual void Checked(TObject* obj, Bool_t check) void CheckItem(TGListTreeItem* item, Bool_t check = kTRUE) static TClass* Class() void ClearHighlighted() virtual void Clicked(TGListTreeItem* entry, Int_t btn) virtual void Clicked(TGListTreeItem* entry, Int_t btn, Int_t x, Int_t y) void CloseItem(TGListTreeItem* item) Int_t DeleteChildren(TGListTreeItem* item) Int_t DeleteItem(TGListTreeItem* item) Int_t DeleteSelected() void DisableOpen(Bool_t disable = kTRUE) virtual void DoubleClicked(TGListTreeItem* entry, Int_t btn) virtual void DoubleClicked(TGListTreeItem* entry, Int_t btn, Int_t x, Int_t y) virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h) virtual void End(Bool_t select = kFALSE) TGListTreeItem* FindChildByData(TGListTreeItem* item, void* userData) TGListTreeItem* FindChildByName(TGListTreeItem* item, const char* name) TGListTreeItem* FindItemByObj(TGListTreeItem* item, void* ptr) TGListTreeItem* FindItemByPathname(const char* path) TGListTreeItem* FindSiblingByData(TGListTreeItem* item, void* userData) TGListTreeItem* FindSiblingByName(TGListTreeItem* item, const char* name) TGListTree::EColorMarkupMode GetColorMode() const virtual TGDimension GetDefaultSize() const TGListTreeItem* GetFirstItem() const void GetPathnameFromItem(TGListTreeItem* item, char* path, Int_t depth = 0) TGListTreeItem* GetSelected() const virtual Bool_t HandleButton(Event_t* event) virtual Bool_t HandleCrossing(Event_t* event) virtual Bool_t HandleDoubleClick(Event_t* event) virtual Bool_t HandleExpose(Event_t* event) virtual Bool_t HandleKey(Event_t* event) virtual Bool_t HandleMotion(Event_t* event) void HighlightChildren(TGListTreeItem* item, Bool_t state, Bool_t draw) void HighlightItem(TGListTreeItem* item) void HighlightItem(TGListTreeItem* item, Bool_t state, Bool_t draw) virtual void Home(Bool_t select = kFALSE) virtual TClass* IsA() const virtual void KeyPressed(TGListTreeItem* entry, UInt_t keysym, UInt_t mask) virtual void LineDown(Bool_t select = kFALSE) virtual void LineUp(Bool_t select = kFALSE) virtual void OnMouseOver(TGListTreeItem* entry) void OpenItem(TGListTreeItem* item) virtual void PageDown(Bool_t select = kFALSE) virtual void PageUp(Bool_t select = kFALSE) Int_t RecursiveDeleteItem(TGListTreeItem* item, void* userData) void RenameItem(TGListTreeItem* item, const char* string) void RenameSelected(const char* string) Int_t Reparent(TGListTreeItem* item, TGListTreeItem* newparent) Int_t ReparentChildren(TGListTreeItem* item, TGListTreeItem* newparent) virtual void ReturnPressed(TGListTreeItem* entry) virtual void SavePrimitive(ostream& out, Option_t* option = "") virtual void Search(Bool_t close = kTRUE) void SetAutoTips(Bool_t on = kTRUE) virtual void SetCanvas(TGCanvas* canvas) void SetCheckBox(TGListTreeItem* item, Bool_t on = kTRUE) void SetColorMode(TGListTree::EColorMarkupMode colorMode) void SetSelected(TGListTreeItem* item) void SetToolTipItem(TGListTreeItem* item, const char* string) void SetToolTipText(const char* text, Int_t x, Int_t y, Long_t delayms) virtual void ShowMembers(TMemberInspector& insp, char* parent) Int_t Sort(TGListTreeItem* item) Int_t SortChildren(TGListTreeItem* item) Int_t SortSiblings(TGListTreeItem* item) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) void ToggleItem(TGListTreeItem* item) void UnselectAll(Bool_t draw)

Data Members


    protected:
TGListTreeItem* fFirst pointer to first item in list TGListTreeItem* fSelected pointer to selected item in list Int_t fHspacing horizontal spacing between items Int_t fVspacing vertical spacing between items Int_t fIndent number of pixels indentation Int_t fMargin number of pixels margin from left side Int_t fLastY last used y position Pixel_t fGrayPixel gray draw color GContext_t fDrawGC icon drawing context GContext_t fLineGC dashed line drawing context GContext_t fHighlightGC highlighted icon drawing context FontStruct_t fFont font used to draw item text UInt_t fDefw default list width UInt_t fDefh default list height Int_t fExposeTop top y postion of visible region Int_t fExposeBottom bottom y position of visible region TGToolTip* fTip tooltip shown when moving over list items TGListTreeItem* fTipItem item for which tooltip is set Bool_t fAutoTips assume item->fUserData is TObject and use GetTitle() for tip text Bool_t fDisableOpen disable branch opening on double-clicks TGListTree::EColorMarkupMode fColorMode if/how to render item's main color GContext_t fColorGC drawing context for main item color static Pixel_t fgGrayPixel static const TGFont* fgDefaultFont static TGGC* fgDrawGC static TGGC* fgLineGC static TGGC* fgHighlightGC static TGGC* fgColorGC public:
static const TGListTree::EColorMarkupMode kDefault static const TGListTree::EColorMarkupMode kColorUnderline static const TGListTree::EColorMarkupMode kColorBox

Class Description

                                                                      
 TGListTree and TGListTreeItem                                        
                                                                      
 A list tree is a widget that can contain a number of items           
 arranged in a tree structure. The items are represented by small     
 folder icons that can be either open or closed.                      
                                                                      
 The TGListTree is user callable. The TGListTreeItem is a service     
 class of the list tree.                                              
                                                                      
 A list tree can generate the following events:                       
 kC_LISTTREE, kCT_ITEMCLICK, which button, location (y<<16|x).        
 kC_LISTTREE, kCT_ITEMDBLCLICK, which button, location (y<<16|x).     
                                                                      

TGListTree(TGWindow *p, UInt_t w, UInt_t h, UInt_t options, ULong_t back)
 Create a list tree widget.
TGListTree(TGCanvas *p,UInt_t options,ULong_t back)
 Create a list tree widget.
TGListTree(const TGListTree& lt)
copy constructor
TGListTree& operator=(const TGListTree& lt)
assignment operator
~TGListTree()
 Delete list tree widget.
void HighlightItem(TGListTreeItem *item, Bool_t state, Bool_t draw)
 Highlight tree item.
void HighlightChildren(TGListTreeItem *item, Bool_t state, Bool_t draw)
 Higlight item children.
void UnselectAll(Bool_t draw)
 Unselect all items.
Bool_t HandleButton(Event_t *event)
 Handle button events in the list tree.
Bool_t HandleDoubleClick(Event_t *event)
 Handle double click event in the list tree (only for kButton1).
Bool_t HandleCrossing(Event_t *event)
 Handle mouse crossing event.
Bool_t HandleMotion(Event_t *event)
 Handle mouse motion event. Only used to set tool tip.
Bool_t HandleKey(Event_t *event)
 The key press event handler converts a key press to some line editor
 action.
void OnMouseOver(TGListTreeItem *entry)
 Signal emitted when pointer is over entry.
void KeyPressed(TGListTreeItem *entry, UInt_t keysym, UInt_t mask)
 Signal emitted when keyboard key pressed

 item - selected item
 keysym - defined in "KeySymbols.h"
 mask - modifier key mask, defined in "GuiTypes.h"

 const Mask_t kKeyShiftMask   = BIT(0);
 const Mask_t kKeyLockMask    = BIT(1);
 const Mask_t kKeyControlMask = BIT(2);
 const Mask_t kKeyMod1Mask    = BIT(3);   // typically the Alt key
 const Mask_t kButton1Mask    = BIT(8);
 const Mask_t kButton2Mask    = BIT(9);
 const Mask_t kButton3Mask    = BIT(10);
 const Mask_t kButton4Mask    = BIT(11);
 const Mask_t kButton5Mask    = BIT(12);
 const Mask_t kAnyModifier    = BIT(15);
void ReturnPressed(TGListTreeItem *entry)
 Emit ReturnPressed() signal.
void Clicked(TGListTreeItem *entry, Int_t btn)
 Emit Clicked() signal.
void Checked(TObject *entry, Bool_t on)
 Emit Checked() signal.
void Clicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y)
 Emit Clicked() signal.
void DoubleClicked(TGListTreeItem *entry, Int_t btn)
 Emit DoubleClicked() signal.
void DoubleClicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y)
 Emit DoubleClicked() signal.
void AdjustPosition(TGListTreeItem *item)
 Move content to position of item. If item is 0, move to position
 of currently selected item.
void DoRedraw()
 Redraw list tree.
void Draw(Int_t yevent, Int_t hevent)
 Draw list tree widget.
Int_t DrawChildren(TGListTreeItem *item, Int_t x, Int_t y, Int_t xroot)
 Draw children of item in list tree.
void DrawItem(TGListTreeItem *item, Int_t x, Int_t y, Int_t *xroot, UInt_t *retwidth, UInt_t *retheight)
 Draw list tree item.
void DrawItemName(TGListTreeItem *item)
 Draw name of list tree item.
void DrawNode(TGListTreeItem *item, Int_t x, Int_t y)
 Draw node (little + in box).
void SetToolTipText(const char *text, Int_t x, Int_t y, Long_t delayms)
 Set tool tip text associated with this item. The delay is in
 milliseconds (minimum 250). To remove tool tip call method with
 delayms = 0. To change delayms you first have to call this method
 with delayms=0.
void RemoveReference(TGListTreeItem *item)
 This function removes the specified item from the linked list.
 It does not do anything with the data contained in the item, though.
void PDeleteChildren(TGListTreeItem *item)
 Delete children of item from list.
void InsertChild(TGListTreeItem *parent, TGListTreeItem *item)
 Insert child in list.
void InsertChildren(TGListTreeItem *parent, TGListTreeItem *item)
 Insert a list of ALREADY LINKED children into another list
Int_t SearchChildren(TGListTreeItem *item, Int_t y, Int_t findy, TGListTreeItem **finditem)
 Search child item.
TGListTreeItem * FindItem(Int_t findy)
 Find item at postion findy.
TGListTreeItem * AddItem(TGListTreeItem *parent, const char *string, const TGPicture *open, const TGPicture *closed, Bool_t checkbox)
 Add item to list tree. Returns new item.
TGListTreeItem * AddItem(TGListTreeItem *parent, const char *string, void *userData, const TGPicture *open, const TGPicture *closed, Bool_t checkbox)
 Add item to list tree. If item with same userData already exists
 don't add it. Returns new item.
void RenameItem(TGListTreeItem *item, const char *string)
 Rename item in list tree.
Int_t DeleteItem(TGListTreeItem *item)
 Delete item from list tree.
void OpenItem(TGListTreeItem *item)
 Open item in list tree (i.e. show child items).
void CloseItem(TGListTreeItem *item)
 Close item in list tree (i.e. hide child items).
Int_t RecursiveDeleteItem(TGListTreeItem *item, void *ptr)
 Delete item with fUserData == ptr. Search tree downwards starting
 at item.
void SetToolTipItem(TGListTreeItem *item, const char *string)
 Set tooltip text for this item. By default an item for which the
 userData is a pointer to an TObject the TObject::GetTitle() will
 be used to get the tip text.
Int_t DeleteChildren(TGListTreeItem *item)
 Delete children of item from list.
Int_t Reparent(TGListTreeItem *item, TGListTreeItem *newparent)
 Make newparent the new parent of item.
Int_t ReparentChildren(TGListTreeItem *item, TGListTreeItem *newparent)
 Make newparent the new parent of the children of item.
Int_t Sort(TGListTreeItem *item)
 Sort items starting with item.
Int_t SortSiblings(TGListTreeItem *item)
 Sort siblings of item.
Int_t SortChildren(TGListTreeItem *item)
 Sort children of item.
TGListTreeItem * FindSiblingByName(TGListTreeItem *item, const char *name)
 Find sibling of item by name.
TGListTreeItem * FindSiblingByData(TGListTreeItem *item, void *userData)
 Find sibling of item by userData.
TGListTreeItem * FindChildByName(TGListTreeItem *item, const char *name)
 Find child of item by name.
TGListTreeItem * FindChildByData(TGListTreeItem *item, void *userData)
 Find child of item by userData.
TGListTreeItem * FindItemByPathname(const char *path)
 Find item by pathname. Pathname is in the form of /xx/yy/zz. If zz
 in path /xx/yy is found it returns item, 0 otherwise.
void HighlightItem(TGListTreeItem *item)
 Highlight item.
void ClearHighlighted()
 Un highlight items.
void GetPathnameFromItem(TGListTreeItem *item, char *path, Int_t depth)
 Get pathname from item. Use depth to limit path name to last
 depth levels. By default depth is not limited.
Pixel_t GetGrayPixel()
 Return gray draw color in use.
FontStruct_t GetDefaultFontStruct()
 Return default font structure in use.
const TGGC & GetDrawGC()
 Return default graphics context in use.
const TGGC & GetLineGC()
 Return graphics context in use for line drawing.
const TGGC & GetHighlightGC()
 Return graphics context for highlighted frame background.
const TGGC & GetColorGC()
 Return graphics context for highlighted frame background.
void SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 Save a list tree widget as a C++ statements on output stream out.
void SaveChildren(ostream &out, TGListTreeItem *item, Int_t &n)
 Save child items as a C++ statements on output stream out.
void CheckItem(TGListTreeItem *item, Bool_t check)
 Set check button state for the node 'item'.
void SetCheckBox(TGListTreeItem *item, Bool_t on)
 Set check button state for the node 'item'.
void ToggleItem(TGListTreeItem *item)
 Toggle check button state of the node 'item'.
void UpdateChecked(TGListTreeItem *item, Bool_t redraw)
 Update the state of the node 'item' according to the children states.
TGListTreeItem * FindItemByObj(TGListTreeItem *item, void *ptr)
 Find item with fUserData == ptr. Search tree downwards starting
 at item.
void Draw(Int_t yevent, Int_t hevent)
void Layout()
void OnMouseOver(TGFrame*)
void CurrentChanged(TGFrame *)
void ReturnPressed(TGFrame*)
Bool_t HandleExpose(Event_t *event)
void SetCanvas(TGCanvas *canvas)
void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
TGDimension GetDefaultSize()
void SetAutoTips(Bool_t on = kTRUE)
void SetSelected(TGListTreeItem *item)
void AdjustPosition(TGListTreeItem *item)
void Home(Bool_t select = kFALSE)
 overwrite TGContainer's methods
void End(Bool_t select = kFALSE)
void PageUp(Bool_t select = kFALSE)
void PageDown(Bool_t select = kFALSE)
void LineUp(Bool_t select = kFALSE)
void LineDown(Bool_t select = kFALSE)
void Search(Bool_t close = kTRUE)
void DisableOpen(Bool_t disable = kTRUE)
void AddItem(const char *string)
void AddRoot(const char *string)
Int_t DeleteSelected()
void RenameSelected(const char *string)
void KeyPressed(TGListTreeItem *entry, UInt_t keysym, UInt_t mask)
void Clicked(TGListTreeItem *entry, Int_t btn)
void Clicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y)
void DoubleClicked(TGListTreeItem *entry, Int_t btn)
void DoubleClicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y)
EColorMarkupMode GetColorMode()
void SetColorMode(EColorMarkupMode colorMode)

Author: Fons Rademakers 25/02/98
Last update: root/gui:$Name: $:$Id: TGListTree.cxx,v 1.57 2006/07/09 05:27:54 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.