Logo ROOT   6.21/01
Reference Guide
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 25/02/98
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
12 #ifndef ROOT_TGListTree
13 #define ROOT_TGListTree
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TGListTree and TGListTreeItem //
19 // //
20 // A list tree is a widget that can contain a number of items //
21 // arranged in a tree structure. The items are represented by small //
22 // folder icons that can be either open or closed. //
23 // //
24 // The TGListTree is user callable. The TGListTreeItem is a service //
25 // class of the list tree. //
26 // //
27 // A list tree can generate the following events: //
28 // kC_LISTTREE, kCT_ITEMCLICK, which button, location (y<<16|x). //
29 // kC_LISTTREE, kCT_ITEMDBLCLICK, which button, location (y<<16|x). //
30 // //
31 //////////////////////////////////////////////////////////////////////////
33 #include "TGCanvas.h"
34 #include "TGWidget.h"
35 #include "TGDNDManager.h"
37 class TGPicture;
38 class TGToolTip;
39 class TGCanvas;
40 class TList;
41 class TBufferFile;
44 {
45  friend class TGListTree;
47 private:
48  TGListTreeItem(const TGListTreeItem&); // not implemented
49  TGListTreeItem& operator=(const TGListTreeItem&); // not implemented
51 protected:
52  TGClient *fClient; // pointer to TGClient
53  TGListTreeItem *fParent; // pointer to parent
54  TGListTreeItem *fFirstchild; // pointer to first child item
55  TGListTreeItem *fLastchild; // pointer to last child item
56  TGListTreeItem *fPrevsibling; // pointer to previous sibling
57  TGListTreeItem *fNextsibling; // pointer to next sibling
59  Bool_t fOpen; // true if item is open
61  Int_t fDNDState; // EDNDFlags
63  // State managed by TGListTree during drawing.
64  Int_t fY; // y position of item
65  Int_t fXtext; // x position of item text
66  Int_t fYtext; // y position of item text
67  UInt_t fHeight; // item height
69 public:
71  virtual ~TGListTreeItem() {}
73  TGListTreeItem *GetParent() const { return fParent; }
75  TGListTreeItem *GetLastChild() const { return fLastchild; }
79  virtual Bool_t IsOpen() const { return fOpen; }
80  virtual void SetOpen(Bool_t o) { fOpen = o; }
82  virtual Bool_t IsActive() const = 0;
83  virtual Pixel_t GetActiveColor() const = 0;
84  virtual void SetActive(Bool_t) {}
86  void Rename(const char* new_name) { SetText(new_name); }
87  virtual const char *GetText() const = 0;
88  virtual Int_t GetTextLength() const = 0;
89  virtual const char *GetTipText() const = 0;
90  virtual Int_t GetTipTextLength() const = 0;
91  virtual void SetText(const char *) {}
92  virtual void SetTipText(const char *) {}
94  virtual void SetUserData(void *, Bool_t=kFALSE) {}
95  virtual void *GetUserData() const = 0;
97  virtual const TGPicture*GetPicture() const = 0;
98  virtual void SetPictures(const TGPicture*, const TGPicture*) {}
99  virtual const TGPicture*GetCheckBoxPicture() const = 0;
100  virtual void SetCheckBoxPictures(const TGPicture*, const TGPicture*) {}
101  virtual UInt_t GetPicWidth() const;
103  virtual void SetCheckBox(Bool_t=kTRUE) {}
104  virtual Bool_t HasCheckBox() const = 0;
105  virtual void CheckItem(Bool_t=kTRUE) = 0;
106  virtual void Toggle() { SetCheckBox( ! IsChecked()); }
107  virtual Bool_t IsChecked() const = 0;
109  // Propagation of checked-state form children to parents.
110  virtual void CheckAllChildren(Bool_t=kTRUE) {}
112  virtual Bool_t HasCheckedChild(Bool_t=kFALSE) { return kTRUE; } // !!!!
113  virtual Bool_t HasUnCheckedChild(Bool_t=kFALSE) { return kTRUE; } // !!!!
114  virtual void UpdateState() {}
116  // Item coloration (underline + minibox)
117  virtual Bool_t HasColor() const = 0;
118  virtual Color_t GetColor() const = 0;
119  virtual void SetColor(Color_t) {}
120  virtual void ClearColor() {}
122  // Drag and drop.
123  void SetDNDSource(Bool_t onoff)
124  { if (onoff) fDNDState |= kIsDNDSource; else fDNDState &= ~kIsDNDSource; }
125  void SetDNDTarget(Bool_t onoff)
126  { if (onoff) fDNDState |= kIsDNDTarget; else fDNDState &= ~kIsDNDTarget; }
127  Bool_t IsDNDSource() const { return fDNDState & kIsDNDSource; }
128  Bool_t IsDNDTarget() const { return fDNDState & kIsDNDTarget; }
130  // Allow handling by the items themselves ... NOT USED in TGListTree yet !!!!
131  virtual Bool_t HandlesDragAndDrop() const { return kFALSE; }
132  virtual void HandleDrag() {}
133  virtual void HandleDrop() {}
135  virtual void SavePrimitive(std::ostream&, Option_t*, Int_t) {}
137  ClassDef(TGListTreeItem,0) // Abstract base-class for items that go into a TGListTree container.
138 };
142 {
143 private:
144  Bool_t fActive; // true if item is active
145  Bool_t fCheckBox; // true if checkbox is visible
146  Bool_t fChecked; // true if item is checked
147  Bool_t fOwnsData; // true if user data has to be deleted
148  TString fText; // item text
149  TString fTipText; // tooltip text
150  const TGPicture *fOpenPic; // icon for open state
151  const TGPicture *fClosedPic; // icon for closed state
152  const TGPicture *fCheckedPic; // icon for checked item
153  const TGPicture *fUncheckedPic; // icon for unchecked item
154  void *fUserData; // pointer to user data structure
156  Bool_t fHasColor; // true if item has assigned color
157  Color_t fColor; // item's color
159  TGListTreeItemStd(const TGListTreeItemStd&); // not implemented
160  TGListTreeItemStd& operator=(const TGListTreeItemStd&); // not implemented
162 public:
163  TGListTreeItemStd(TGClient *fClient = gClient, const char *name = 0,
164  const TGPicture *opened = 0, const TGPicture *closed = 0,
165  Bool_t checkbox = kFALSE);
166  virtual ~TGListTreeItemStd();
168  virtual Pixel_t GetActiveColor() const;
169  virtual Bool_t IsActive() const { return fActive; }
170  virtual void SetActive(Bool_t a) { fActive = a; }
172  virtual const char *GetText() const { return fText.Data(); }
173  virtual Int_t GetTextLength() const { return fText.Length(); }
174  virtual const char *GetTipText() const { return fTipText.Data(); }
175  virtual Int_t GetTipTextLength() const { return fTipText.Length(); }
176  virtual void SetText(const char *text) { fText = text; }
177  virtual void SetTipText(const char *tip) { fTipText = tip; }
179  virtual void SetUserData(void *userData, Bool_t own=kFALSE) { fUserData = userData; fOwnsData=own; }
180  virtual void *GetUserData() const { return fUserData; }
182  virtual const TGPicture*GetPicture() const { return fOpen ? fOpenPic : fClosedPic; }
183  virtual const TGPicture*GetCheckBoxPicture() const { return fCheckBox ? (fChecked ? fCheckedPic : fUncheckedPic) : 0; }
184  virtual void SetPictures(const TGPicture *opened, const TGPicture *closed);
185  virtual void SetCheckBoxPictures(const TGPicture *checked, const TGPicture *unchecked);
187  virtual void SetCheckBox(Bool_t on = kTRUE);
188  virtual Bool_t HasCheckBox() const { return fCheckBox; }
189  virtual void CheckItem(Bool_t checked = kTRUE) { fChecked = checked; }
190  virtual void Toggle() { fChecked = !fChecked; }
191  virtual Bool_t IsChecked() const { return fChecked; }
193  virtual void CheckAllChildren(Bool_t state = kTRUE);
194  virtual void CheckChildren(TGListTreeItem *item, Bool_t state);
197  virtual void UpdateState();
199  virtual Bool_t HasColor() const { return fHasColor; }
200  virtual Color_t GetColor() const { return fColor; }
201  virtual void SetColor(Color_t color) { fHasColor = true;fColor = color; }
202  virtual void ClearColor() { fHasColor = false; }
204  virtual void SavePrimitive(std::ostream &out, Option_t *option, Int_t n);
206  ClassDef(TGListTreeItemStd,0) //Item that goes into a TGListTree container
207 };
210 class TGListTree : public TGContainer {
212 public:
213  //---- color markup mode of tree items
215  kDefault = 0,
218  };
219  enum ECheckMode {
220  kSimple = BIT(2),
222  };
224 protected:
225  TGListTreeItem *fFirst; // pointer to first item in list
226  TGListTreeItem *fLast; // pointer to last item in list
227  TGListTreeItem *fSelected; // pointer to selected item in list
228  TGListTreeItem *fCurrent; // pointer to current item in list
229  TGListTreeItem *fBelowMouse; // pointer to item below mouses cursor
230  Int_t fHspacing; // horizontal spacing between items
231  Int_t fVspacing; // vertical spacing between items
232  Int_t fIndent; // number of pixels indentation
233  Int_t fMargin; // number of pixels margin from left side
234  Pixel_t fGrayPixel; // gray draw color
235  GContext_t fActiveGC; // activated (selected) drawing context
236  GContext_t fDrawGC; // icon drawing context
237  GContext_t fLineGC; // dashed line drawing context
238  GContext_t fHighlightGC; // highlighted icon drawing context
239  FontStruct_t fFont; // font used to draw item text
240  UInt_t fDefw; // default list width
241  UInt_t fDefh; // default list height
242  Int_t fExposeTop; // top y postion of visible region
243  Int_t fExposeBottom; // bottom y position of visible region
244  TGToolTip *fTip; // tooltip shown when moving over list items
245  TGListTreeItem *fTipItem; // item for which tooltip is set
246  TBufferFile *fBuf; // buffer used for Drag and Drop
247  TDNDData fDNDData; // Drag and Drop data
248  Atom_t *fDNDTypeList; // handles DND types
249  TGListTreeItem *fDropItem; // item on which DND is over
250  Bool_t fAutoTips; // assume item->fUserData is TObject and use GetTitle() for tip text
251  Bool_t fAutoCheckBoxPic;// change check box picture if parent and children have diffrent state
252  Bool_t fDisableOpen; // disable branch opening on double-clicks
253  Bool_t fUserControlled; // let user decides what is the behaviour on events
254  Bool_t fEventHandled; // flag used from user code to bypass standard event handling
255  UInt_t fLastEventState; // modifier state of the last keyboard event
257  EColorMarkupMode fColorMode; // if/how to render item's main color
258  ECheckMode fCheckMode; // how to propagate check properties through the tree
259  GContext_t fColorGC; // drawing context for main item color
262  static const TGFont *fgDefaultFont;
263  static TGGC *fgActiveGC;
264  static TGGC *fgDrawGC;
265  static TGGC *fgLineGC;
267  static TGGC *fgColorGC;
268  static const TGPicture *fgOpenPic; // icon for open item
269  static const TGPicture *fgClosedPic; // icon for closed item
270  static const TGPicture *fgCheckedPic; // icon for checked item
271  static const TGPicture *fgUncheckedPic; // icon for unchecked item
273  static Pixel_t GetGrayPixel();
275  static const TGGC &GetActiveGC();
276  static const TGGC &GetDrawGC();
277  static const TGGC &GetLineGC();
278  static const TGGC &GetHighlightGC();
279  static const TGGC &GetColorGC();
281  void Draw(Handle_t id, Int_t yevent, Int_t hevent);
282  void Draw(Option_t * ="") { MayNotUse("Draw(Option_t*)"); }
284  void DrawItem(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y, Int_t *xroot,
285  UInt_t *retwidth, UInt_t *retheight);
286  void DrawItemName(Handle_t id, TGListTreeItem *item);
287  void DrawNode(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y);
288  virtual void UpdateChecked(TGListTreeItem *item, Bool_t redraw = kFALSE);
290  void SaveChildren(std::ostream &out, TGListTreeItem *item, Int_t &n);
291  void RemoveReference(TGListTreeItem *item);
292  void PDeleteItem(TGListTreeItem *item);
293  void PDeleteChildren(TGListTreeItem *item);
294  void InsertChild(TGListTreeItem *parent, TGListTreeItem *item);
295  void InsertChildren(TGListTreeItem *parent, TGListTreeItem *item);
297  TGListTreeItem **finditem);
298  TGListTreeItem *FindItem(Int_t findy);
299  void *FindItem(const TString& name,
300  Bool_t direction = kTRUE,
301  Bool_t caseSensitive = kTRUE,
302  Bool_t beginWith = kFALSE)
303  { return TGContainer::FindItem(name, direction, caseSensitive, beginWith); }
305  virtual void Layout() {}
307  void OnMouseOver(TGFrame*) { }
308  void CurrentChanged(Int_t /*x*/, Int_t /*y*/) { }
311  void Clicked(TGFrame *, Int_t /*btn*/) { }
312  void Clicked(TGFrame *, Int_t /*btn*/, Int_t /*x*/, Int_t /*y*/) { }
313  void DoubleClicked(TGFrame *, Int_t /*btn*/) { }
314  void DoubleClicked(TGFrame *, Int_t /*btn*/, Int_t /*x*/, Int_t /*y*/) { }
315  void KeyPressed(TGFrame *, UInt_t /*keysym*/, UInt_t /*mask*/) { }
317 private:
318  TGListTree(const TGListTree&); // not implemented
319  TGListTree& operator=(const TGListTree&); // not implemented
321 public:
322  TGListTree(TGWindow *p = 0, UInt_t w = 1, UInt_t h = 1,
323  UInt_t options = 0, Pixel_t back = GetWhitePixel());
324  TGListTree(TGCanvas *p, UInt_t options, Pixel_t back = GetWhitePixel());
326  virtual ~TGListTree();
328  virtual Bool_t HandleButton(Event_t *event);
329  virtual Bool_t HandleDoubleClick(Event_t *event);
330  virtual Bool_t HandleCrossing(Event_t *event);
331  virtual Bool_t HandleMotion(Event_t *event);
332  virtual Bool_t HandleKey(Event_t *event);
334  virtual void SetCanvas(TGCanvas *canvas) { fCanvas = canvas; }
335  virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h);
337  virtual void DrawOutline(Handle_t id, TGListTreeItem *item, Pixel_t col=0xbbbbbb,
338  Bool_t clear=kFALSE);
339  virtual void DrawActive(Handle_t id, TGListTreeItem *item);
341  virtual TGDimension GetDefaultSize() const
342  { return TGDimension(fDefw, fDefh); }
344  void AddItem(TGListTreeItem *parent, TGListTreeItem *item);
345  TGListTreeItem *AddItem(TGListTreeItem *parent, const char *string,
346  const TGPicture *open = 0,
347  const TGPicture *closed = 0,
348  Bool_t checkbox = kFALSE);
349  TGListTreeItem *AddItem(TGListTreeItem *parent, const char *string,
350  void *userData, const TGPicture *open = 0,
351  const TGPicture *closed = 0,
352  Bool_t checkbox = kFALSE);
353  void RenameItem(TGListTreeItem *item, const char *string);
355  void OpenItem(TGListTreeItem *item);
356  void CloseItem(TGListTreeItem *item);
357  void CheckItem(TGListTreeItem *item, Bool_t check = kTRUE);
358  void SetCheckBox(TGListTreeItem *item, Bool_t on = kTRUE);
359  void ToggleItem(TGListTreeItem *item);
360  Int_t RecursiveDeleteItem(TGListTreeItem *item, void *userData);
363  Int_t Reparent(TGListTreeItem *item, TGListTreeItem *newparent);
365  void SetToolTipItem(TGListTreeItem *item, const char *string);
366  void SetAutoTips(Bool_t on = kTRUE) { fAutoTips = on; }
368  void SetSelected(TGListTreeItem *item) { fSelected = item; }
369  void AdjustPosition(TGListTreeItem *item);
372  // overwrite TGContainer's methods
373  void Home(Bool_t select = kFALSE);
374  void End(Bool_t select = kFALSE);
375  void PageUp(Bool_t select = kFALSE);
376  void PageDown(Bool_t select = kFALSE);
377  void LineUp(Bool_t select = kFALSE);
378  void LineDown(Bool_t select = kFALSE);
379  void Search(Bool_t close = kTRUE);
381  Int_t Sort(TGListTreeItem *item);
384  void HighlightItem(TGListTreeItem *item);
385  void ClearHighlighted();
386  void GetPathnameFromItem(TGListTreeItem *item, char *path, Int_t depth = 0);
387  void UnselectAll(Bool_t draw);
388  void SetToolTipText(const char *text, Int_t x, Int_t y, Long_t delayms);
389  void HighlightItem(TGListTreeItem *item, Bool_t state, Bool_t draw);
390  void HighlightChildren(TGListTreeItem *item, Bool_t state, Bool_t draw);
391  void DisableOpen(Bool_t disable = kTRUE) { fDisableOpen = disable;}
392  void GetChecked(TList *checked);
393  void GetCheckedChildren(TList *checked, TGListTreeItem *item);
394  void CheckAllChildren(TGListTreeItem *item, Bool_t state);
396  TGListTreeItem *GetFirstItem() const { return fFirst; }
397  TGListTreeItem *GetSelected() const { return fSelected; }
398  TGListTreeItem *GetCurrent() const { return fCurrent; }
401  TGListTreeItem *FindSiblingByData(TGListTreeItem *item, void *userData);
402  TGListTreeItem *FindChildByName(TGListTreeItem *item, const char *name);
403  TGListTreeItem *FindChildByData(TGListTreeItem *item, void *userData);
404  TGListTreeItem *FindItemByPathname(const char *path);
405  TGListTreeItem *FindItemByObj(TGListTreeItem *item, void *ptr);
407  void AddItem(const char *string) { AddItem(fSelected, string); } //*MENU*
408  void AddRoot(const char *string) { AddItem(0, string); } //*MENU*
409  Int_t DeleteSelected() { return (fSelected ? DeleteItem(fSelected) : 0); } //*MENU*
410  void RenameSelected(const char *string) { if (fSelected) RenameItem(fSelected, string); } //*MENU*
412  virtual void MouseOver(TGListTreeItem *entry); //*SIGNAL*
413  virtual void MouseOver(TGListTreeItem *entry, UInt_t mask); //*SIGNAL*
414  virtual void KeyPressed(TGListTreeItem *entry, UInt_t keysym, UInt_t mask); //*SIGNAL*
415  virtual void ReturnPressed(TGListTreeItem *entry); //*SIGNAL*
416  virtual void Clicked(TGListTreeItem *entry, Int_t btn); //*SIGNAL*
417  virtual void Clicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y); //*SIGNAL*
418  virtual void Clicked(TGListTreeItem *entry, Int_t btn, UInt_t mask, Int_t x, Int_t y); //*SIGNAL*
419  virtual void DoubleClicked(TGListTreeItem *entry, Int_t btn); //*SIGNAL*
420  virtual void DoubleClicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y); //*SIGNAL*
421  virtual void Checked(TObject *obj, Bool_t check); //*SIGNAL*
422  virtual void DataDropped(TGListTreeItem *item, TDNDData *data); //*SIGNAL*
424  // Utility functions
425  Int_t FontHeight();
426  Int_t FontAscent();
427  Int_t TextWidth(const char *c);
429  static const TGPicture *GetOpenPic();
430  static const TGPicture *GetClosedPic();
431  static const TGPicture *GetCheckedPic();
432  static const TGPicture *GetUncheckedPic();
434  // User control
438  Bool_t IsEventHandled() const { return fEventHandled; }
442  Int_t xroot, Int_t yroot);
443  Atom_t HandleDNDEnter(Atom_t * typelist);
447  return &fDNDData;
448  }
451  void SetColorMode(EColorMarkupMode colorMode) { fColorMode = colorMode; }
453  ECheckMode GetCheckMode() const { return fCheckMode; }
454  void SetCheckMode(ECheckMode mode) { fCheckMode = mode; }
456  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
458  ClassDef(TGListTree,0) //Show items in a tree structured list
459 };
461 #endif
TGClient * fClient
Definition: TGListTree.h:52
virtual void SetPictures(const TGPicture *opened, const TGPicture *closed)
Change list tree item icons.
Definition: TGListTree.cxx:311
TGListTreeItem * fFirstchild
Definition: TGListTree.h:54
TGToolTip * fTip
Definition: TGListTree.h:244
Handle_t FontStruct_t
Definition: GuiTypes.h:38
void AddRoot(const char *string)
Definition: TGListTree.h:408
virtual void SetCanvas(TGCanvas *canvas)
Definition: TGListTree.h:334
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGListTree.h:341
void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t beginWith=kFALSE)
Definition: TGListTree.h:299
virtual ~TGListTreeItemStd()
Delete list tree item.
Definition: TGListTree.cxx:152
GContext_t fHighlightGC
Definition: TGListTree.h:238
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...
Definition: TBufferFile.h:46
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)
Definition: TGListTree.h:103
void InsertChildren(TGListTreeItem *parent, TGListTreeItem *item)
Insert a list of ALREADY LINKED children into another list.
Bool_t IsDNDTarget() const
Definition: TGListTree.h:128
virtual Bool_t HasColor() const =0
const char Option_t
Definition: RtypesCore.h:62
virtual Bool_t HasUnCheckedChild(Bool_t=kFALSE)
Definition: TGListTree.h:113
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.
UInt_t fHeight
Definition: TGListTree.h:67
static TGGC * fgDrawGC
Definition: TGListTree.h:264
void OnMouseOver(TGFrame *)
Signal emitted when pointer is over entry.
Definition: TGListTree.h:307
TBufferFile * fBuf
Definition: TGListTree.h:246
#define BIT(n)
Definition: Rtypes.h:83
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:691
void ReturnPressed(TGFrame *)
Signal emitted when Return/Enter key pressed.
Definition: TGListTree.h:310
void LineDown(Bool_t select=kFALSE)
Move content one item-size down.
void RenameSelected(const char *string)
Definition: TGListTree.h:410
static const TGGC & GetLineGC()
Return graphics context in use for line drawing.
Definition: TGListTree.h:247
virtual void ClearColor()
Definition: TGListTree.h:202
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Redraw list tree.
const TGPicture * fUncheckedPic
Definition: TGListTree.h:153
TGListTreeItem * GetBelowMouse() const
Definition: TGListTree.h:399
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.
Definition: TGListTree.cxx:512
Int_t fExposeBottom
Definition: TGListTree.h:243
static const TGPicture * GetUncheckedPic()
Returns the icon used for unchecked checkbox.
void DoubleClicked(TGFrame *, Int_t)
Emit DoubleClicked() signal.
Definition: TGListTree.h:313
virtual Int_t GetTextLength() const
Definition: TGListTree.h:173
Handle_t GContext_t
Definition: GuiTypes.h:37
Bool_t fOpen
Definition: TGListTree.h:59
void AddItem(const char *string)
Definition: TGListTree.h:407
Basic string class.
Definition: TString.h:131
#define gClient
Definition: TGClient.h:166
virtual void SavePrimitive(std::ostream &, Option_t *, Int_t)
Definition: TGListTree.h:135
int Int_t
Definition: RtypesCore.h:41
Int_t DeleteChildren(TGListTreeItem *item)
Delete children of item from list.
GContext_t fDrawGC
Definition: TGListTree.h:236
bool Bool_t
Definition: RtypesCore.h:59
virtual void AdjustPosition()
Move content to position of highlighted/activated frame.
Definition: TGCanvas.cxx:1788
virtual Bool_t HasCheckedChild(Bool_t first=kFALSE)
Add all child items of &#39;item&#39; into the list &#39;checked&#39;.
Definition: TGListTree.cxx:175
TGCanvas * fCanvas
Definition: TGCanvas.h:51
static const TGPicture * fgCheckedPic
Definition: TGListTree.h:270
virtual void CheckAllChildren(Bool_t state=kTRUE)
Set all child items of this one checked if state=kTRUE, unchecked if state=kFALSE.
Definition: TGListTree.cxx:238
Bool_t HandleDNDLeave()
Handle drag leave events.
Definition: TGListTree.cxx:770
virtual Bool_t HasUnCheckedChild(Bool_t first=kFALSE)
Add all child items of &#39;item&#39; into the list &#39;checked&#39;.
Definition: TGListTree.cxx:198
virtual const TGPicture * GetPicture() const
Definition: TGListTree.h:182
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.
Int_t DeleteSelected()
Definition: TGListTree.h:409
const TGPicture * fCheckedPic
Definition: TGListTree.h:152
virtual Bool_t HasCheckBox() const
Definition: TGListTree.h:188
TGListTreeItem * GetSelected() const
Definition: TGListTree.h:397
virtual Int_t GetTipTextLength() const =0
GContext_t fActiveGC
Definition: TGListTree.h:235
Atom_t * fDNDTypeList
Definition: TGListTree.h:248
void SetAutoCheckBoxPic(Bool_t on)
Definition: TGListTree.h:367
virtual const TGPicture * GetPicture() const =0
void DoubleClicked(TGFrame *, Int_t, Int_t, Int_t)
Emit DoubleClicked() signal.
Definition: TGListTree.h:314
void SetCheckMode(ECheckMode mode)
Definition: TGListTree.h:454
virtual void CheckItem(Bool_t=kTRUE)=0
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)
Definition: TGListTree.h:125
void Clicked(TGFrame *, Int_t)
Emit Clicked() signal.
Definition: TGListTree.h:311
Double_t x[n]
Definition: legend1.C:17
virtual TDNDData * GetDNDData(Atom_t)
Definition: TGListTree.h:446
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)
Definition: Rtypes.h:326
Int_t fIndent
Definition: TGListTree.h:232
ULong_t Pixel_t
Definition: GuiTypes.h:39
void HighlightChildren(TGListTreeItem *item, Bool_t state, Bool_t draw)
Higlight item children.
Definition: TGListTree.cxx:540
virtual void SetActive(Bool_t)
Definition: TGListTree.h:84
void DrawItemName(Handle_t id, TGListTreeItem *item)
Draw name of list tree item.
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition: TGListTree.h:94
virtual void DrawOutline(Handle_t id, TGListTreeItem *item, Pixel_t col=0xbbbbbb, Bool_t clear=kFALSE)
Draw a outline of color &#39;col&#39; around an item.
void SetToolTipItem(TGListTreeItem *item, const char *string)
Set tooltip text for this item.
virtual Bool_t HasCheckedChild(Bool_t=kFALSE)
Definition: TGListTree.h:112
UInt_t fLastEventState
Definition: TGListTree.h:255
Int_t SortSiblings(TGListTreeItem *item)
Sort siblings of item.
virtual Bool_t IsActive() const =0
FontStruct_t fFont
Definition: TGListTree.h:239
Handle_t Atom_t
Definition: GuiTypes.h:36
virtual void SetUserData(void *userData, Bool_t own=kFALSE)
Definition: TGListTree.h:179
void AdjustPosition()
Move content to position of highlighted/activated frame.
Definition: TGListTree.h:370
virtual void HandleDrop()
Definition: TGListTree.h:133
static TGGC * fgHighlightGC
Definition: TGListTree.h:266
TGListTreeItem * fFirst
Definition: TGListTree.h:225
TGListTreeItem * FindSiblingByData(TGListTreeItem *item, void *userData)
Find sibling of item by userData.
EColorMarkupMode fColorMode
Definition: TGListTree.h:257
void SetEventHandled(Bool_t eh=kTRUE)
Definition: TGListTree.h:437
static const TGPicture * fgClosedPic
Definition: TGListTree.h:269
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...
Definition: TObject.cxx:933
virtual Pixel_t GetActiveColor() const =0
TGListTreeItem * GetPrevSibling() const
Definition: TGListTree.h:76
virtual void Toggle()
Definition: TGListTree.h:190
GContext_t fLineGC
Definition: TGListTree.h:237
TGListTreeItem * FindItem(Int_t findy)
Find item at postion findy.
virtual const char * GetText() const
Definition: TGListTree.h:172
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
Definition: TGCanvas.cxx:1685
static Pixel_t GetGrayPixel()
Return gray draw color in use.
Bool_t fAutoTips
Definition: TGListTree.h:250
void InsertChild(TGListTreeItem *parent, TGListTreeItem *item)
Insert child in list.
short Color_t
Definition: RtypesCore.h:79
TGListTreeItem * fPrevsibling
Definition: TGListTree.h:56
virtual void SetText(const char *)
Definition: TGListTree.h:91
virtual void SetCheckBox(Bool_t on=kTRUE)
Set a check box on the tree node.
Definition: TGListTree.cxx:278
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
Definition: TGListTree.cxx:702
Bool_t IsEventHandled() const
Definition: TGListTree.h:438
TGListTreeItemStd(const TGListTreeItemStd &)
static const TGFont * fgDefaultFont
Definition: TGListTree.h:262
Bool_t HasUserControl() const
Definition: TGListTree.h:436
virtual Color_t GetColor() const =0
A doubly linked list.
Definition: TList.h:44
void GetCheckedChildren(TList *checked, TGListTreeItem *item)
Add all child items of &#39;item&#39; into the list &#39;checked&#39;.
void CurrentChanged(TGFrame *)
Emit signal when current selected frame changed.
Definition: TGListTree.h:309
void UnselectAll(Bool_t draw)
Unselect all items.
Definition: TGListTree.cxx:553
void OpenItem(TGListTreeItem *item)
Open item in list tree (i.e. show child items).
virtual void SetTipText(const char *)
Definition: TGListTree.h:92
static const TGGC & GetActiveGC()
Return default graphics context in use.
virtual Bool_t HasColor() const
Definition: TGListTree.h:199
static const TGPicture * GetCheckedPic()
Returns the icon used for checked checkbox.
virtual Bool_t IsActive() const
Definition: TGListTree.h:169
Pixel_t fGrayPixel
Definition: TGListTree.h:234
virtual void SetCheckBoxPictures(const TGPicture *, const TGPicture *)
Definition: TGListTree.h:100
TGListTreeItem * GetCurrent() const
Definition: TGListTree.h:398
void PDeleteItem(TGListTreeItem *item)
Delete given item.
static const TGGC & GetDrawGC()
Return default graphics context in use.
TGListTreeItem * fSelected
Definition: TGListTree.h:227
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
Bool_t IsDNDSource() const
Definition: TGListTree.h:127
void CheckAllChildren(TGListTreeItem *item, Bool_t state)
Check all child items of &#39;item&#39; and &#39;item&#39; itself according to the state value: kTRUE means check all...
UInt_t fDefh
Definition: TGListTree.h:241
virtual ~TGListTreeItem()
Definition: TGListTree.h:71
TGListTreeItem * GetNextSibling() const
Definition: TGListTree.h:77
auto * a
Definition: textangle.C:12
void SetUserControl(Bool_t ctrl=kTRUE)
Definition: TGListTree.h:435
TGListTreeItem * fLastchild
Definition: TGListTree.h:55
TGListTreeItem & operator=(const TGListTreeItem &)
virtual const TGPicture * GetCheckBoxPicture() const
Definition: TGListTree.h:183
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.
TGListTreeItem * fParent
Definition: TGListTree.h:53
virtual void * GetUserData() const
Definition: TGListTree.h:180
virtual void SetOpen(Bool_t o)
Definition: TGListTree.h:80
void GetChecked(TList *checked)
Add all checked list tree items of this list tree into the list &#39;checked&#39;.
virtual const char * GetText() const =0
unsigned int UInt_t
Definition: RtypesCore.h:42
static TGGC * fgLineGC
Definition: TGListTree.h:265
void ClearHighlighted()
Un highlight items.
virtual Color_t GetColor() const
Definition: TGListTree.h:200
Ssiz_t Length() const
Definition: TString.h:405
void Draw(Option_t *="")
Default Draw method for all objects.
Definition: TGListTree.h:282
virtual void CheckItem(Bool_t checked=kTRUE)
Definition: TGListTree.h:189
Int_t DrawChildren(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y, Int_t xroot)
Draw children of item in list tree.
Bool_t fDisableOpen
Definition: TGListTree.h:252
void PageDown(Bool_t select=kFALSE)
Move content one page down.
virtual void UpdateState()
Update the state of the node &#39;item&#39; according to the children states.
Definition: TGListTree.cxx:221
void SetColorMode(EColorMarkupMode colorMode)
Definition: TGListTree.h:451
TGListTree(const TGListTree &)
virtual void Toggle()
Definition: TGListTree.h:106
virtual void SetColor(Color_t color)
Definition: TGListTree.h:201
GContext_t fColorGC
Definition: TGListTree.h:259
virtual Bool_t HandleButton(Event_t *event)
Handle button events in the list tree.
Definition: TGListTree.cxx:562
virtual void SetCheckBoxPictures(const TGPicture *checked, const TGPicture *unchecked)
Change list tree check item icons.
Definition: TGListTree.cxx:286
virtual ~TGListTree()
Delete list tree widget.
Definition: TGListTree.cxx:469
TGListTreeItem(const TGListTreeItem &)
Int_t FontHeight()
Returns height of currently used font.
Definition: TGListTree.cxx:490
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event.
Definition: TGListTree.cxx:803
virtual Pixel_t GetActiveColor() const
Return color for marking items that are active or selected.
Definition: TGListTree.cxx:167
Int_t SortChildren(TGListTreeItem *item)
Sort children of item.
TGListTreeItem * fDropItem
Definition: TGListTree.h:249
void Rename(const char *new_name)
Definition: TGListTree.h:86
#define h(i)
Definition: RSha256.hxx:106
void CurrentChanged(Int_t, Int_t)
Emit signal when current position changed.
Definition: TGListTree.h:308
Bool_t HandleDNDDrop(TDNDData *data)
Handle drop events.
Definition: TGListTree.cxx:778
EColorMarkupMode GetColorMode() const
Definition: TGListTree.h:450
const Bool_t kFALSE
Definition: RtypesCore.h:88
Bool_t fAutoCheckBoxPic
Definition: TGListTree.h:251
TGListTreeItem * fCurrent
Definition: TGListTree.h:228
virtual Bool_t HandlesDragAndDrop() const
Definition: TGListTree.h:131
TGListTreeItem * fLast
Definition: TGListTree.h:226
virtual Int_t GetTextLength() const =0
long Long_t
Definition: RtypesCore.h:50
TGListTreeItem * GetParent() const
Definition: TGListTree.h:73
Bool_t fEventHandled
Definition: TGListTree.h:254
virtual void CheckChildren(TGListTreeItem *, Bool_t)
Definition: TGListTree.h:111
virtual void Layout()
Layout container entries.
Definition: TGListTree.h:305
TGListTreeItem * GetLastChild() const
Definition: TGListTree.h:75
void DisableOpen(Bool_t disable=kTRUE)
Definition: TGListTree.h:391
TText * text
virtual UInt_t GetPicWidth() const
Return width of item&#39;s icon.
Definition: TGListTree.cxx:99
UInt_t fDefw
Definition: TGListTree.h:240
TGListTreeItem * GetFirstChild() const
Definition: TGListTree.h:74
void Clicked(TGFrame *, Int_t, Int_t, Int_t)
Emit Clicked() signal.
Definition: TGListTree.h:312
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)
Definition: TGListTree.h:170
virtual const TGPicture * GetCheckBoxPicture() const =0
Definition: TGFont.h:149
Int_t fDNDState
Definition: TGListTree.h:61
TGListTreeItem * FindSiblingByName(TGListTreeItem *item, const char *name)
Find sibling of item by name.
Double_t y[n]
Definition: legend1.C:17
void PageUp(Bool_t select=kFALSE)
Move content one page up.
virtual const char * GetTipText() const
Definition: TGListTree.h:174
Int_t ReparentChildren(TGListTreeItem *item, TGListTreeItem *newparent)
Make newparent the new parent of the children of item.
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click event in the list tree (only for kButton1).
Definition: TGListTree.cxx:660
ECheckMode fCheckMode
Definition: TGListTree.h:258
Atom_t HandleDNDEnter(Atom_t *typelist)
Handle drag enter events.
Definition: TGListTree.cxx:755
static const TGPicture * fgOpenPic
Definition: TGListTree.h:268
Bool_t fUserControlled
Definition: TGListTree.h:253
TGListTreeItem * fBelowMouse
Definition: TGListTree.h:229
TGListTreeItemStd & operator=(const TGListTreeItemStd &)
virtual void SetText(const char *text)
Definition: TGListTree.h:176
virtual void SetPictures(const TGPicture *, const TGPicture *)
Definition: TGListTree.h:98
virtual void CheckAllChildren(Bool_t=kTRUE)
Definition: TGListTree.h:110
Int_t fMargin
Definition: TGListTree.h:233
void SetCheckBox(TGListTreeItem *item, Bool_t on=kTRUE)
Set check button state for the node &#39;item&#39;.
virtual Bool_t IsOpen() const
Definition: TGListTree.h:79
Mother of all ROOT objects.
Definition: TObject.h:37
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 &#39;item&#39;.
virtual Int_t GetTipTextLength() const
Definition: TGListTree.h:175
Int_t Reparent(TGListTreeItem *item, TGListTreeItem *newparent)
Make newparent the new parent of item.
ECheckMode GetCheckMode() const
Definition: TGListTree.h:453
void KeyPressed(TGFrame *, UInt_t, UInt_t)
Signal emitted when keyboard key pressed.
Definition: TGListTree.h:315
TGListTreeItem * FindItemByPathname(const char *path)
Find item by pathname.
virtual Bool_t IsChecked() const
Definition: TGListTree.h:191
Int_t fVspacing
Definition: TGListTree.h:231
virtual Bool_t IsChecked() const =0
virtual void UpdateState()
Definition: TGListTree.h:114
static Pixel_t fgGrayPixel
Definition: TGListTree.h:261
void SetAutoTips(Bool_t on=kTRUE)
Definition: TGListTree.h:366
Int_t fHspacing
Definition: TGListTree.h:230
TGListTreeItem * fNextsibling
Definition: TGListTree.h:57
void SetDNDSource(Bool_t onoff)
Definition: TGListTree.h:123
void CloseItem(TGListTreeItem *item)
Close item in list tree (i.e. hide child items).
virtual void SetColor(Color_t)
Definition: TGListTree.h:119
Atom_t HandleDNDPosition(Int_t x, Int_t y, Atom_t action, Int_t xroot, Int_t yroot)
Handle dragging position events.
Definition: TGListTree.cxx:729
Int_t FontAscent()
Returns ascent of currently used font.
Definition: TGListTree.cxx:500
#define c(i)
Definition: RSha256.hxx:101
static const TGGC & GetColorGC()
Return graphics context for highlighted frame background.
virtual void HandleDrag()
Definition: TGListTree.h:132
void SaveChildren(std::ostream &out, TGListTreeItem *item, Int_t &n)
Save child items as a C++ statements on output stream out.
TGListTreeItem * fTipItem
Definition: TGListTree.h:245
void CheckItem(TGListTreeItem *item, Bool_t check=kTRUE)
Set check button state for the node &#39;item&#39;.
static const TGPicture * fgUncheckedPic
Definition: TGListTree.h:271
Definition: first.py:1
TGListTree & operator=(const TGListTree &)
const TGPicture * fOpenPic
Definition: TGListTree.h:150
void HighlightItem(TGListTreeItem *item)
Highlight item.
TGListTreeItem * GetFirstItem() const
Definition: TGListTree.h:396
virtual void ClearColor()
Definition: TGListTree.h:120
const Bool_t kTRUE
Definition: RtypesCore.h:87
Definition: TGGC.h:31
const Int_t n
Definition: legend1.C:16
virtual void UpdateChecked(TGListTreeItem *item, Bool_t redraw=kFALSE)
Update the state of the node &#39;item&#39; according to the children states.
virtual void MouseOver(TGListTreeItem *entry)
Signal emitted when pointer is over entry.
static TGGC * fgColorGC
Definition: TGListTree.h:267
Int_t fExposeTop
Definition: TGListTree.h:242
char name[80]
Definition: TGX11.cxx:109
void DrawNode(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y)
Draw node (little + in box).
void SetSelected(TGListTreeItem *item)
Definition: TGListTree.h:368
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.
Definition: TGListTree.cxx:931
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 &#39;item&#39; checked if state=kTRUE; unchecked if state=kFALSE.
Definition: TGListTree.cxx:255
virtual const char * GetTipText() const =0
const TGPicture * fClosedPic
Definition: TGListTree.h:151
void End(Bool_t select=kFALSE)
Move content to the bottom.
virtual void DataDropped(TGListTreeItem *item, TDNDData *data)
Emit DataDropped() signal.
Definition: TGListTree.cxx:789
static TGGC * fgActiveGC
Definition: TGListTree.h:263
const char * Data() const
Definition: TString.h:364
ULong_t Handle_t
Definition: GuiTypes.h:25
virtual void SetTipText(const char *tip)
Definition: TGListTree.h:177