TGListTree


class description - source file - inheritance tree

class TGListTree : public TGFrame, public TGWidget


    protected:
virtual void DoRedraw() 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) void HighlightChildren(TGListTreeItem* item, Bool_t state, Bool_t draw) void HighlightItem(TGListTreeItem* item, Bool_t state, Bool_t draw) void InsertChild(TGListTreeItem* parent, TGListTreeItem* item) void InsertChildren(TGListTreeItem* parent, TGListTreeItem* item) void PDeleteChildren(TGListTreeItem* item) void RemoveReference(TGListTreeItem* item) Int_t SearchChildren(TGListTreeItem* item, Int_t y, Int_t findy, TGListTreeItem** finditem) void SetToolTipText(const char* text, Int_t x, Int_t y, Long_t delayms) void UnselectAll(Bool_t draw) public:
TGListTree TGListTree(TGWindow* p, UInt_t w, UInt_t h, UInt_t options, ULong_t back = fgWhitePixel) TGListTree TGListTree(TGListTree&) virtual void ~TGListTree() TGListTreeItem* AddItem(TGListTreeItem* parent, const char* string, void* userData, const TGPicture* open = 0, const TGPicture* closed = 0) TGListTreeItem* AddItem(TGListTreeItem* parent, const char* string, const TGPicture* open = 0, const TGPicture* closed = 0) static TClass* Class() void ClearHighlighted() virtual void Clicked(TGListTreeItem* entry, Int_t btn) void CloseItem(TGListTreeItem* item) Int_t DeleteChildren(TGListTreeItem* item) Int_t DeleteItem(TGListTreeItem* item) virtual void DoubleClicked(TGListTreeItem* entry, Int_t btn) TGListTreeItem* FindChildByData(TGListTreeItem* item, void* userData) TGListTreeItem* FindChildByName(TGListTreeItem* item, const char* name) TGListTreeItem* FindItemByPathname(const char* path) TGListTreeItem* FindSiblingByData(TGListTreeItem* item, void* userData) TGListTreeItem* FindSiblingByName(TGListTreeItem* item, const char* name) 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 HandleMotion(Event_t* event) void HighlightItem(TGListTreeItem* item) virtual TClass* IsA() const void OpenItem(TGListTreeItem* item) Int_t RecursiveDeleteItem(TGListTreeItem* item, void* userData) void RenameItem(TGListTreeItem* item, const char* string) Int_t Reparent(TGListTreeItem* item, TGListTreeItem* newparent) Int_t ReparentChildren(TGListTreeItem* item, TGListTreeItem* newparent) void SetAutoTips(Bool_t on = kTRUE) virtual void SetCanvas(TGCanvas* canvas) void SetToolTipItem(TGListTreeItem* item, const char* string) 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)

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 ULong_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 TGCanvas* fCanvas canvas which contains the tree Bool_t fAutoTips assume item->fUserData is TObject and use GetTitle() for tip text static FontStruct_t fgDefaultFontStruct public:

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) : TGFrame(p, w, h, options, back)
 Create a list tree widget.

~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 HandleExpose(Event_t *event)
 Handle expose event in the list tree.

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.

void DoubleClicked(TGListTreeItem *entry, Int_t btn)
 Emit DoubleClicked() signal.

void Clicked(TGListTreeItem *entry, Int_t btn)
 Emit Clicked() signal.

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)
 Add item to list tree. Returns new item.

TGListTreeItem* AddItem(TGListTreeItem *parent, const char *string, void *userData, const TGPicture *open, const TGPicture *closed)
 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.



Inline Functions


                   void Draw(Option_t*)
                   void SetCanvas(TGCanvas* canvas)
            TGDimension GetDefaultSize() const
                   void SetAutoTips(Bool_t on = kTRUE)
        TGListTreeItem* GetFirstItem() const
        TGListTreeItem* GetSelected() const
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)
             TGListTree TGListTree(TGListTree&)


Author: Fons Rademakers 25/02/98
Last update: root/gui:$Name: $:$Id: TGListTree.cxx,v 1.7 2000/10/17 12:34:52 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - 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.