class TGListTreeItem


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).


Function Members (Methods)

public:
TGListTreeItem(TGClient* fClient = gClient, const char* name = 0, const TGPicture* opened = 0, const TGPicture* closed = 0, Bool_t checkbox = kFALSE)
virtual~TGListTreeItem()
voidCheckAllChildren(Bool_t state = kTRUE)
voidCheckChildren(TGListTreeItem* item, Bool_t state)
voidCheckItem(Bool_t checked = kTRUE)
static TClass*Class()
voidClearColor()
Color_tGetColor() const
TGListTreeItem*GetFirstChild() const
TGListTreeItem*GetNextSibling() const
TGListTreeItem*GetParent() const
TGListTreeItem*GetPrevSibling() const
const char*GetText() const
const char*GetTipText() const
void*GetUserData() const
Bool_tHasCheckBox() const
Bool_tHasCheckedChild(Bool_t first = kFALSE)
Bool_tHasUnCheckedChild(Bool_t first = kFALSE)
virtual TClass*IsA() const
Bool_tIsActive() const
Bool_tIsChecked() const
Bool_tIsDNDSource() const
Bool_tIsDNDTarget() const
Bool_tIsOpen() const
voidRename(const char* new_name)
voidSavePrimitive(ostream& out, Option_t* option, Int_t n)
voidSetCheckBox(Bool_t on = kTRUE)
voidSetCheckBoxPictures(const TGPicture* checked, const TGPicture* unchecked)
voidSetColor(Color_t color)
voidSetDNDSource(Bool_t onoff)
voidSetDNDTarget(Bool_t onoff)
voidSetPictures(const TGPicture* opened, const TGPicture* closed)
voidSetTipText(const char* tip)
voidSetUserData(void* userData, Bool_t own = kFALSE)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
voidToggle()
voidUpdateState()
private:
TGListTreeItem(const TGListTreeItem&)
TGListTreeItem&operator=(const TGListTreeItem&)

Data Members

private:
Bool_tfActivetrue if item is active
Bool_tfCheckBoxtrue if checkbox is visible
Bool_tfCheckedtrue if item is checked
const TGPicture*fCheckedPicicon for checked item
TGClient*fClientpointer to TGClient
const TGPicture*fClosedPicicon for closed state
Color_tfColoritem's color
Int_tfDNDStateEDNDFlags
TGListTreeItem*fFirstchildpointer to first child item
Bool_tfHasColortrue if item has assigned color
UInt_tfHeightitem height
TGListTreeItem*fNextsiblingpointer to next sibling
Bool_tfOpentrue if item is open
const TGPicture*fOpenPicicon for open state
Bool_tfOwnsDatatrue if user data has to be deleted
TGListTreeItem*fParentpointer to parent
UInt_tfPicWidthwidth of item icon
TGListTreeItem*fPrevsiblingpointer to previous sibling
TStringfTextitem text
TStringfTipTexttooltip text
const TGPicture*fUncheckedPicicon for unchecked item
void*fUserDatapointer to user data structure
Int_tfXtextx position of item text
Int_tfYy position of item
Int_tfYtexty position of item text

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TGListTreeItem(TGClient* fClient = gClient, const char* name = 0, const TGPicture* opened = 0, const TGPicture* closed = 0, Bool_t checkbox = kFALSE)
 Create list tree item.
~TGListTreeItem()
 Delete list tree item.
Bool_t HasCheckedChild(Bool_t first = kFALSE)
 Add all child items of 'item' into the list 'checked'.
Bool_t HasUnCheckedChild(Bool_t first = kFALSE)
 Add all child items of 'item' into the list 'checked'.
void UpdateState()
 Update the state of the node 'item' according to the children states.
void CheckAllChildren(Bool_t state = kTRUE)
 Set all child items of this one checked if state=kTRUE,
 unchecked if state=kFALSE.
void CheckChildren(TGListTreeItem* item, Bool_t state)
 Set all child items of 'item' checked if state=kTRUE;
 unchecked if state=kFALSE.
void Rename(const char* new_name)
 Rename a list tree item.
void SetCheckBox(Bool_t on = kTRUE)
 Set a check box on the tree node.
void SetCheckBoxPictures(const TGPicture* checked, const TGPicture* unchecked)
 Change list tree check item icons.
void SetPictures(const TGPicture* opened, const TGPicture* closed)
 Change list tree item icons.
void SavePrimitive(ostream& out, Option_t* option, Int_t n)
 Save a list tree item attributes as a C++ statements on output stream.
TGListTreeItem(const TGListTreeItem& )
TGListTreeItem& operator=(const TGListTreeItem& )
TGListTreeItem * GetParent()
{ return fParent; }
TGListTreeItem * GetFirstChild()
{ return fFirstchild; }
TGListTreeItem * GetPrevSibling()
{ return fPrevsibling; }
TGListTreeItem * GetNextSibling()
{ return fNextsibling; }
Bool_t IsActive()
{ return fActive; }
Bool_t IsOpen()
{ return fOpen; }
const char * GetText()
{ return fText.Data(); }
void SetTipText(const char* tip)
{ fTipText = tip; }
const char * GetTipText()
{ return fTipText.Data(); }
void SetUserData(void* userData, Bool_t own = kFALSE)
{ fUserData = userData; fOwnsData=own; }
void * GetUserData()
{ return fUserData; }
Bool_t HasCheckBox()
{ return fCheckBox; }
void CheckItem(Bool_t checked = kTRUE)
{ fChecked = checked; }
void Toggle()
{ fChecked = !fChecked; }
Bool_t IsChecked()
{ return fChecked; }
Color_t GetColor()
{ return fColor; }
void SetColor(Color_t color)
{ fHasColor = true;fColor = color; }
void ClearColor()
{ fHasColor = false; }
void SetDNDSource(Bool_t onoff)
 drag and drop...
{ if (onoff) fDNDState |= kIsDNDSource; else fDNDState &= ~kIsDNDSource; }
void SetDNDTarget(Bool_t onoff)
{ if (onoff) fDNDState |= kIsDNDTarget; else fDNDState &= ~kIsDNDTarget; }
Bool_t IsDNDSource()
{ return fDNDState & kIsDNDSource; }
Bool_t IsDNDTarget()
{ return fDNDState & kIsDNDTarget; }

Author: Fons Rademakers 25/02/98
Last update: root/gui:$Id: TGListTree.h 21502 2007-12-19 17:33:27Z brun $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *

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.