ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TGListTree.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 25/02/98
3 
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  *************************************************************************/
11 
12 #ifndef ROOT_TGListTree
13 #define ROOT_TGListTree
14 
15 
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 //////////////////////////////////////////////////////////////////////////
32 
33 #ifndef ROOT_TGCanvas
34 #include "TGCanvas.h"
35 #endif
36 #ifndef ROOT_TGWidget
37 #include "TGWidget.h"
38 #endif
39 #ifndef ROOT_TDNDManager
40 #include "TGDNDManager.h"
41 #endif
42 
43 class TGPicture;
44 class TGToolTip;
45 class TGCanvas;
46 class TList;
47 class TBufferFile;
48 
50 {
51  friend class TGListTree;
52 
53 private:
54  TGListTreeItem(const TGListTreeItem&); // not implemented
55  TGListTreeItem& operator=(const TGListTreeItem&); // not implemented
56 
57 protected:
58  TGClient *fClient; // pointer to TGClient
59  TGListTreeItem *fParent; // pointer to parent
60  TGListTreeItem *fFirstchild; // pointer to first child item
61  TGListTreeItem *fLastchild; // pointer to last child item
62  TGListTreeItem *fPrevsibling; // pointer to previous sibling
63  TGListTreeItem *fNextsibling; // pointer to next sibling
64 
65  Bool_t fOpen; // true if item is open
66 
67  Int_t fDNDState; // EDNDFlags
68 
69  // State managed by TGListTree during drawing.
70  Int_t fY; // y position of item
71  Int_t fXtext; // x position of item text
72  Int_t fYtext; // y position of item text
73  UInt_t fHeight; // item height
74 
75 public:
77  virtual ~TGListTreeItem() {}
78 
79  TGListTreeItem *GetParent() const { return fParent; }
81  TGListTreeItem *GetLastChild() const { return fLastchild; }
84 
85  virtual Bool_t IsOpen() const { return fOpen; }
86  virtual void SetOpen(Bool_t o) { fOpen = o; }
87 
88  virtual Bool_t IsActive() const = 0;
89  virtual Pixel_t GetActiveColor() const = 0;
90  virtual void SetActive(Bool_t) {}
91 
92  void Rename(const char* new_name) { SetText(new_name); }
93  virtual const char *GetText() const = 0;
94  virtual Int_t GetTextLength() const = 0;
95  virtual const char *GetTipText() const = 0;
96  virtual Int_t GetTipTextLength() const = 0;
97  virtual void SetText(const char *) {}
98  virtual void SetTipText(const char *) {}
99 
100  virtual void SetUserData(void *, Bool_t=kFALSE) {}
101  virtual void *GetUserData() const = 0;
102 
103  virtual const TGPicture*GetPicture() const = 0;
104  virtual void SetPictures(const TGPicture*, const TGPicture*) {}
105  virtual const TGPicture*GetCheckBoxPicture() const = 0;
106  virtual void SetCheckBoxPictures(const TGPicture*, const TGPicture*) {}
107  virtual UInt_t GetPicWidth() const;
108 
109  virtual void SetCheckBox(Bool_t=kTRUE) {}
110  virtual Bool_t HasCheckBox() const = 0;
111  virtual void CheckItem(Bool_t=kTRUE) = 0;
112  virtual void Toggle() { SetCheckBox( ! IsChecked()); }
113  virtual Bool_t IsChecked() const = 0;
114 
115  // Propagation of checked-state form children to parents.
116  virtual void CheckAllChildren(Bool_t=kTRUE) {}
118  virtual Bool_t HasCheckedChild(Bool_t=kFALSE) { return kTRUE; } // !!!!
119  virtual Bool_t HasUnCheckedChild(Bool_t=kFALSE) { return kTRUE; } // !!!!
120  virtual void UpdateState() {}
121 
122  // Item coloration (underline + minibox)
123  virtual Bool_t HasColor() const = 0;
124  virtual Color_t GetColor() const = 0;
125  virtual void SetColor(Color_t) {}
126  virtual void ClearColor() {}
127 
128  // Drag and drop.
129  void SetDNDSource(Bool_t onoff)
130  { if (onoff) fDNDState |= kIsDNDSource; else fDNDState &= ~kIsDNDSource; }
131  void SetDNDTarget(Bool_t onoff)
132  { if (onoff) fDNDState |= kIsDNDTarget; else fDNDState &= ~kIsDNDTarget; }
133  Bool_t IsDNDSource() const { return fDNDState & kIsDNDSource; }
134  Bool_t IsDNDTarget() const { return fDNDState & kIsDNDTarget; }
135 
136  // Allow handling by the items themselves ... NOT USED in TGListTree yet !!!!
137  virtual Bool_t HandlesDragAndDrop() const { return kFALSE; }
138  virtual void HandleDrag() {}
139  virtual void HandleDrop() {}
140 
141  virtual void SavePrimitive(std::ostream&, Option_t*, Int_t) {}
142 
143  ClassDef(TGListTreeItem,0) // Abstract base-class for items that go into a TGListTree container.
144 };
145 
146 
148 {
149 private:
150  Bool_t fActive; // true if item is active
151  Bool_t fCheckBox; // true if checkbox is visible
152  Bool_t fChecked; // true if item is checked
153  Bool_t fOwnsData; // true if user data has to be deleted
154  TString fText; // item text
155  TString fTipText; // tooltip text
156  const TGPicture *fOpenPic; // icon for open state
157  const TGPicture *fClosedPic; // icon for closed state
158  const TGPicture *fCheckedPic; // icon for checked item
159  const TGPicture *fUncheckedPic; // icon for unchecked item
160  void *fUserData; // pointer to user data structure
161 
162  Bool_t fHasColor; // true if item has assigned color
163  Color_t fColor; // item's color
164 
165  TGListTreeItemStd(const TGListTreeItemStd&); // not implemented
166  TGListTreeItemStd& operator=(const TGListTreeItemStd&); // not implemented
167 
168 public:
169  TGListTreeItemStd(TGClient *fClient = gClient, const char *name = 0,
170  const TGPicture *opened = 0, const TGPicture *closed = 0,
171  Bool_t checkbox = kFALSE);
172  virtual ~TGListTreeItemStd();
173 
174  virtual Pixel_t GetActiveColor() const;
175  virtual Bool_t IsActive() const { return fActive; }
176  virtual void SetActive(Bool_t a) { fActive = a; }
177 
178  virtual const char *GetText() const { return fText.Data(); }
179  virtual Int_t GetTextLength() const { return fText.Length(); }
180  virtual const char *GetTipText() const { return fTipText.Data(); }
181  virtual Int_t GetTipTextLength() const { return fTipText.Length(); }
182  virtual void SetText(const char *text) { fText = text; }
183  virtual void SetTipText(const char *tip) { fTipText = tip; }
184 
185  virtual void SetUserData(void *userData, Bool_t own=kFALSE) { fUserData = userData; fOwnsData=own; }
186  virtual void *GetUserData() const { return fUserData; }
187 
188  virtual const TGPicture*GetPicture() const { return fOpen ? fOpenPic : fClosedPic; }
189  virtual const TGPicture*GetCheckBoxPicture() const { return fCheckBox ? (fChecked ? fCheckedPic : fUncheckedPic) : 0; }
190  virtual void SetPictures(const TGPicture *opened, const TGPicture *closed);
191  virtual void SetCheckBoxPictures(const TGPicture *checked, const TGPicture *unchecked);
192 
193  virtual void SetCheckBox(Bool_t on = kTRUE);
194  virtual Bool_t HasCheckBox() const { return fCheckBox; }
195  virtual void CheckItem(Bool_t checked = kTRUE) { fChecked = checked; }
196  virtual void Toggle() { fChecked = !fChecked; }
197  virtual Bool_t IsChecked() const { return fChecked; }
198 
199  virtual void CheckAllChildren(Bool_t state = kTRUE);
200  virtual void CheckChildren(TGListTreeItem *item, Bool_t state);
203  virtual void UpdateState();
204 
205  virtual Bool_t HasColor() const { return fHasColor; }
206  virtual Color_t GetColor() const { return fColor; }
207  virtual void SetColor(Color_t color) { fHasColor = true;fColor = color; }
208  virtual void ClearColor() { fHasColor = false; }
209 
210  virtual void SavePrimitive(std::ostream &out, Option_t *option, Int_t n);
211 
212  ClassDef(TGListTreeItemStd,0) //Item that goes into a TGListTree container
213 };
214 
215 
216 class TGListTree : public TGContainer {
217 
218 public:
219  //---- color markup mode of tree items
221  kDefault = 0,
224  };
225  enum ECheckMode {
226  kSimple = BIT(2),
228  };
229 
230 protected:
231  TGListTreeItem *fFirst; // pointer to first item in list
232  TGListTreeItem *fLast; // pointer to last item in list
233  TGListTreeItem *fSelected; // pointer to selected item in list
234  TGListTreeItem *fCurrent; // pointer to current item in list
235  TGListTreeItem *fBelowMouse; // pointer to item below mouses cursor
236  Int_t fHspacing; // horizontal spacing between items
237  Int_t fVspacing; // vertical spacing between items
238  Int_t fIndent; // number of pixels indentation
239  Int_t fMargin; // number of pixels margin from left side
240  Pixel_t fGrayPixel; // gray draw color
241  GContext_t fActiveGC; // activated (selected) drawing context
242  GContext_t fDrawGC; // icon drawing context
243  GContext_t fLineGC; // dashed line drawing context
244  GContext_t fHighlightGC; // highlighted icon drawing context
245  FontStruct_t fFont; // font used to draw item text
246  UInt_t fDefw; // default list width
247  UInt_t fDefh; // default list height
248  Int_t fExposeTop; // top y postion of visible region
249  Int_t fExposeBottom; // bottom y position of visible region
250  TGToolTip *fTip; // tooltip shown when moving over list items
251  TGListTreeItem *fTipItem; // item for which tooltip is set
252  TBufferFile *fBuf; // buffer used for Drag and Drop
253  TDNDData fDNDData; // Drag and Drop data
254  Atom_t *fDNDTypeList; // handles DND types
255  TGListTreeItem *fDropItem; // item on which DND is over
256  Bool_t fAutoTips; // assume item->fUserData is TObject and use GetTitle() for tip text
257  Bool_t fAutoCheckBoxPic;// change check box picture if parent and children have diffrent state
258  Bool_t fDisableOpen; // disable branch opening on double-clicks
259  Bool_t fUserControlled; // let user decides what is the behaviour on events
260  Bool_t fEventHandled; // flag used from user code to bypass standard event handling
261  UInt_t fLastEventState; // modifier state of the last keyboard event
262 
263  EColorMarkupMode fColorMode; // if/how to render item's main color
264  ECheckMode fCheckMode; // how to propagate check properties through the tree
265  GContext_t fColorGC; // drawing context for main item color
266 
268  static const TGFont *fgDefaultFont;
269  static TGGC *fgActiveGC;
270  static TGGC *fgDrawGC;
271  static TGGC *fgLineGC;
273  static TGGC *fgColorGC;
274  static const TGPicture *fgOpenPic; // icon for open item
275  static const TGPicture *fgClosedPic; // icon for closed item
276  static const TGPicture *fgCheckedPic; // icon for checked item
277  static const TGPicture *fgUncheckedPic; // icon for unchecked item
278 
279  static Pixel_t GetGrayPixel();
281  static const TGGC &GetActiveGC();
282  static const TGGC &GetDrawGC();
283  static const TGGC &GetLineGC();
284  static const TGGC &GetHighlightGC();
285  static const TGGC &GetColorGC();
286 
287  void Draw(Handle_t id, Int_t yevent, Int_t hevent);
288  void Draw(Option_t * ="") { MayNotUse("Draw(Option_t*)"); }
290  void DrawItem(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y, Int_t *xroot,
291  UInt_t *retwidth, UInt_t *retheight);
292  void DrawItemName(Handle_t id, TGListTreeItem *item);
293  void DrawNode(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y);
294  virtual void UpdateChecked(TGListTreeItem *item, Bool_t redraw = kFALSE);
295 
296  void SaveChildren(std::ostream &out, TGListTreeItem *item, Int_t &n);
297  void RemoveReference(TGListTreeItem *item);
298  void PDeleteItem(TGListTreeItem *item);
299  void PDeleteChildren(TGListTreeItem *item);
300  void InsertChild(TGListTreeItem *parent, TGListTreeItem *item);
301  void InsertChildren(TGListTreeItem *parent, TGListTreeItem *item);
303  TGListTreeItem **finditem);
304  TGListTreeItem *FindItem(Int_t findy);
305  void *FindItem(const TString& name,
306  Bool_t direction = kTRUE,
307  Bool_t caseSensitive = kTRUE,
308  Bool_t beginWith = kFALSE)
309  { return TGContainer::FindItem(name, direction, caseSensitive, beginWith); }
310 
311  virtual void Layout() {}
312 
313  void OnMouseOver(TGFrame*) { }
314  void CurrentChanged(Int_t /*x*/, Int_t /*y*/) { }
317  void Clicked(TGFrame *, Int_t /*btn*/) { }
318  void Clicked(TGFrame *, Int_t /*btn*/, Int_t /*x*/, Int_t /*y*/) { }
319  void DoubleClicked(TGFrame *, Int_t /*btn*/) { }
320  void DoubleClicked(TGFrame *, Int_t /*btn*/, Int_t /*x*/, Int_t /*y*/) { }
321  void KeyPressed(TGFrame *, UInt_t /*keysym*/, UInt_t /*mask*/) { }
322 
323 private:
324  TGListTree(const TGListTree&); // not implemented
325  TGListTree& operator=(const TGListTree&); // not implemented
326 
327 public:
328  TGListTree(TGWindow *p = 0, UInt_t w = 1, UInt_t h = 1,
329  UInt_t options = 0, Pixel_t back = GetWhitePixel());
330  TGListTree(TGCanvas *p, UInt_t options, Pixel_t back = GetWhitePixel());
331 
332  virtual ~TGListTree();
333 
334  virtual Bool_t HandleButton(Event_t *event);
335  virtual Bool_t HandleDoubleClick(Event_t *event);
336  virtual Bool_t HandleCrossing(Event_t *event);
337  virtual Bool_t HandleMotion(Event_t *event);
338  virtual Bool_t HandleKey(Event_t *event);
339 
340  virtual void SetCanvas(TGCanvas *canvas) { fCanvas = canvas; }
341  virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h);
342 
343  virtual void DrawOutline(Handle_t id, TGListTreeItem *item, Pixel_t col=0xbbbbbb,
344  Bool_t clear=kFALSE);
345  virtual void DrawActive(Handle_t id, TGListTreeItem *item);
346 
347  virtual TGDimension GetDefaultSize() const
348  { return TGDimension(fDefw, fDefh); }
349 
350  void AddItem(TGListTreeItem *parent, TGListTreeItem *item);
351  TGListTreeItem *AddItem(TGListTreeItem *parent, const char *string,
352  const TGPicture *open = 0,
353  const TGPicture *closed = 0,
354  Bool_t checkbox = kFALSE);
355  TGListTreeItem *AddItem(TGListTreeItem *parent, const char *string,
356  void *userData, const TGPicture *open = 0,
357  const TGPicture *closed = 0,
358  Bool_t checkbox = kFALSE);
359  void RenameItem(TGListTreeItem *item, const char *string);
361  void OpenItem(TGListTreeItem *item);
362  void CloseItem(TGListTreeItem *item);
363  void CheckItem(TGListTreeItem *item, Bool_t check = kTRUE);
364  void SetCheckBox(TGListTreeItem *item, Bool_t on = kTRUE);
365  void ToggleItem(TGListTreeItem *item);
366  Int_t RecursiveDeleteItem(TGListTreeItem *item, void *userData);
367 
369  Int_t Reparent(TGListTreeItem *item, TGListTreeItem *newparent);
371  void SetToolTipItem(TGListTreeItem *item, const char *string);
372  void SetAutoTips(Bool_t on = kTRUE) { fAutoTips = on; }
374  void SetSelected(TGListTreeItem *item) { fSelected = item; }
375  void AdjustPosition(TGListTreeItem *item);
377 
378  // overwrite TGContainer's methods
379  void Home(Bool_t select = kFALSE);
380  void End(Bool_t select = kFALSE);
381  void PageUp(Bool_t select = kFALSE);
382  void PageDown(Bool_t select = kFALSE);
383  void LineUp(Bool_t select = kFALSE);
384  void LineDown(Bool_t select = kFALSE);
385  void Search(Bool_t close = kTRUE);
386 
387  Int_t Sort(TGListTreeItem *item);
390  void HighlightItem(TGListTreeItem *item);
391  void ClearHighlighted();
392  void GetPathnameFromItem(TGListTreeItem *item, char *path, Int_t depth = 0);
393  void UnselectAll(Bool_t draw);
394  void SetToolTipText(const char *text, Int_t x, Int_t y, Long_t delayms);
395  void HighlightItem(TGListTreeItem *item, Bool_t state, Bool_t draw);
396  void HighlightChildren(TGListTreeItem *item, Bool_t state, Bool_t draw);
397  void DisableOpen(Bool_t disable = kTRUE) { fDisableOpen = disable;}
398  void GetChecked(TList *checked);
399  void GetCheckedChildren(TList *checked, TGListTreeItem *item);
400  void CheckAllChildren(TGListTreeItem *item, Bool_t state);
401 
402  TGListTreeItem *GetFirstItem() const { return fFirst; }
403  TGListTreeItem *GetSelected() const { return fSelected; }
404  TGListTreeItem *GetCurrent() const { return fCurrent; }
407  TGListTreeItem *FindSiblingByData(TGListTreeItem *item, void *userData);
408  TGListTreeItem *FindChildByName(TGListTreeItem *item, const char *name);
409  TGListTreeItem *FindChildByData(TGListTreeItem *item, void *userData);
410  TGListTreeItem *FindItemByPathname(const char *path);
411  TGListTreeItem *FindItemByObj(TGListTreeItem *item, void *ptr);
412 
413  void AddItem(const char *string) { AddItem(fSelected, string); } //*MENU*
414  void AddRoot(const char *string) { AddItem(0, string); } //*MENU*
415  Int_t DeleteSelected() { return (fSelected ? DeleteItem(fSelected) : 0); } //*MENU*
416  void RenameSelected(const char *string) { if (fSelected) RenameItem(fSelected, string); } //*MENU*
417 
418  virtual void MouseOver(TGListTreeItem *entry); //*SIGNAL*
419  virtual void MouseOver(TGListTreeItem *entry, UInt_t mask); //*SIGNAL*
420  virtual void KeyPressed(TGListTreeItem *entry, UInt_t keysym, UInt_t mask); //*SIGNAL*
421  virtual void ReturnPressed(TGListTreeItem *entry); //*SIGNAL*
422  virtual void Clicked(TGListTreeItem *entry, Int_t btn); //*SIGNAL*
423  virtual void Clicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y); //*SIGNAL*
424  virtual void Clicked(TGListTreeItem *entry, Int_t btn, UInt_t mask, Int_t x, Int_t y); //*SIGNAL*
425  virtual void DoubleClicked(TGListTreeItem *entry, Int_t btn); //*SIGNAL*
426  virtual void DoubleClicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y); //*SIGNAL*
427  virtual void Checked(TObject *obj, Bool_t check); //*SIGNAL*
428  virtual void DataDropped(TGListTreeItem *item, TDNDData *data); //*SIGNAL*
429 
430  // Utility functions
431  Int_t FontHeight();
432  Int_t FontAscent();
433  Int_t TextWidth(const char *c);
434 
435  static const TGPicture *GetOpenPic();
436  static const TGPicture *GetClosedPic();
437  static const TGPicture *GetCheckedPic();
438  static const TGPicture *GetUncheckedPic();
439 
440  // User control
444  Bool_t IsEventHandled() const { return fEventHandled; }
445 
448  Int_t xroot, Int_t yroot);
449  Atom_t HandleDNDEnter(Atom_t * typelist);
451 
453  return &fDNDData;
454  }
455 
457  void SetColorMode(EColorMarkupMode colorMode) { fColorMode = colorMode; }
458 
459  ECheckMode GetCheckMode() const { return fCheckMode; }
460  void SetCheckMode(ECheckMode mode) { fCheckMode = mode; }
461 
462  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
463 
464  ClassDef(TGListTree,0) //Show items in a tree structured list
465 };
466 
467 #endif
Bool_t HasUserControl() const
Definition: TGListTree.h:442
TGClient * fClient
Definition: TGListTree.h:58
virtual void SetPictures(const TGPicture *opened, const TGPicture *closed)
Change list tree item icons.
Definition: TGListTree.cxx:311
TGListTreeItem * fFirstchild
Definition: TGListTree.h:60
TGToolTip * fTip
Definition: TGListTree.h:250
Handle_t FontStruct_t
Definition: GuiTypes.h:40
void AddRoot(const char *string)
Definition: TGListTree.h:414
virtual void SetCanvas(TGCanvas *canvas)
Definition: TGListTree.h:340
void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t beginWith=kFALSE)
Definition: TGListTree.h:305
virtual ~TGListTreeItemStd()
Delete list tree item.
Definition: TGListTree.cxx:152
virtual Int_t GetTipTextLength() const
Definition: TGListTree.h:181
GContext_t fHighlightGC
Definition: TGListTree.h:244
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:51
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:109
void InsertChildren(TGListTreeItem *parent, TGListTreeItem *item)
Insert a list of ALREADY LINKED children into another list.
Ssiz_t Length() const
Definition: TString.h:390
return c
virtual Bool_t HasColor() const =0
const char Option_t
Definition: RtypesCore.h:62
virtual Pixel_t GetActiveColor() const
Return color for marking items that are active or selected.
Definition: TGListTree.cxx:167
virtual Bool_t HasUnCheckedChild(Bool_t=kFALSE)
Definition: TGListTree.h:119
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:73
static TGGC * fgDrawGC
Definition: TGListTree.h:270
void OnMouseOver(TGFrame *)
Signal emitted when pointer is over entry.
Definition: TGListTree.h:313
TBufferFile * fBuf
Definition: TGListTree.h:252
#define BIT(n)
Definition: Rtypes.h:120
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:971
TH1 * h
Definition: legend2.C:5
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:316
void LineDown(Bool_t select=kFALSE)
Move content one item-size down.
void RenameSelected(const char *string)
Definition: TGListTree.h:416
static const TGGC & GetLineGC()
Return graphics context in use for line drawing.
TDNDData fDNDData
Definition: TGListTree.h:253
virtual void ClearColor()
Definition: TGListTree.h:208
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Redraw list tree.
const TGPicture * fUncheckedPic
Definition: TGListTree.h:159
ECheckMode GetCheckMode() const
Definition: TGListTree.h:459
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:249
static const TGPicture * GetUncheckedPic()
Returns the icon used for unchecked checkbox.
virtual Bool_t IsChecked() const
Definition: TGListTree.h:197
void DoubleClicked(TGFrame *, Int_t)
Emit DoubleClicked() signal.
Definition: TGListTree.h:319
Handle_t GContext_t
Definition: GuiTypes.h:39
Bool_t fOpen
Definition: TGListTree.h:65
void AddItem(const char *string)
Definition: TGListTree.h:413
Basic string class.
Definition: TString.h:137
#define gClient
Definition: TGClient.h:174
virtual void SavePrimitive(std::ostream &, Option_t *, Int_t)
Definition: TGListTree.h:141
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGListTree.h:347
int Int_t
Definition: RtypesCore.h:41
Int_t DeleteChildren(TGListTreeItem *item)
Delete children of item from list.
GContext_t fDrawGC
Definition: TGListTree.h:242
bool Bool_t
Definition: RtypesCore.h:59
TArc * a
Definition: textangle.C:12
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void AdjustPosition()
Move content to position of highlighted/activated frame.
Definition: TGCanvas.cxx:1790
virtual Bool_t HasCheckedChild(Bool_t first=kFALSE)
Add all child items of 'item' into the list 'checked'.
Definition: TGListTree.cxx:175
TGCanvas * fCanvas
Definition: TGCanvas.h:53
void closed(Int_t id)
Definition: threadsh1.C:60
static const TGPicture * fgCheckedPic
Definition: TGListTree.h:276
virtual Color_t GetColor() const
Definition: TGListTree.h:206
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
TGListTreeItem * GetLastChild() const
Definition: TGListTree.h:81
Bool_t HandleDNDLeave()
Handle drag leave events.
Definition: TGListTree.cxx:770
virtual Bool_t HasUnCheckedChild(Bool_t first=kFALSE)
Add all child items of 'item' into the list 'checked'.
Definition: TGListTree.cxx:198
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:415
const TGPicture * fCheckedPic
Definition: TGListTree.h:158
Bool_t IsEventHandled() const
Definition: TGListTree.h:444
virtual Int_t GetTipTextLength() const =0
GContext_t fActiveGC
Definition: TGListTree.h:241
Atom_t * fDNDTypeList
Definition: TGListTree.h:254
void SetAutoCheckBoxPic(Bool_t on)
Definition: TGListTree.h:373
virtual const TGPicture * GetPicture() const =0
void DoubleClicked(TGFrame *, Int_t, Int_t, Int_t)
Emit DoubleClicked() signal.
Definition: TGListTree.h:320
void SetCheckMode(ECheckMode mode)
Definition: TGListTree.h:460
virtual const char * GetTipText() const
Definition: TGListTree.h:180
const char * Data() const
Definition: TString.h:349
virtual void CheckItem(Bool_t=kTRUE)=0
TGListTreeItem * GetParent() const
Definition: TGListTree.h:79
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:131
void Clicked(TGFrame *, Int_t)
Emit Clicked() signal.
Definition: TGListTree.h:317
Double_t x[n]
Definition: legend1.C:17
virtual TDNDData * GetDNDData(Atom_t)
Definition: TGListTree.h:452
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:254
Int_t fIndent
Definition: TGListTree.h:238
ULong_t Pixel_t
Definition: GuiTypes.h:41
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:90
void DrawItemName(Handle_t id, TGListTreeItem *item)
Draw name of list tree item.
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition: TGListTree.h:100
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)
Definition: TGListTree.h:118
UInt_t fLastEventState
Definition: TGListTree.h:261
Int_t SortSiblings(TGListTreeItem *item)
Sort siblings of item.
virtual Bool_t IsActive() const =0
FontStruct_t fFont
Definition: TGListTree.h:245
Handle_t Atom_t
Definition: GuiTypes.h:38
virtual Bool_t HandlesDragAndDrop() const
Definition: TGListTree.h:137
virtual void SetUserData(void *userData, Bool_t own=kFALSE)
Definition: TGListTree.h:185
virtual Bool_t HasCheckBox() const
Definition: TGListTree.h:194
void AdjustPosition()
Move content to position of highlighted/activated frame.
Definition: TGListTree.h:376
virtual void HandleDrop()
Definition: TGListTree.h:139
static TGGC * fgHighlightGC
Definition: TGListTree.h:272
TGListTreeItem * fFirst
Definition: TGListTree.h:231
TGListTreeItem * FindSiblingByData(TGListTreeItem *item, void *userData)
Find sibling of item by userData.
EColorMarkupMode fColorMode
Definition: TGListTree.h:263
void SetEventHandled(Bool_t eh=kTRUE)
Definition: TGListTree.h:443
static const TGPicture * fgClosedPic
Definition: TGListTree.h:275
virtual Pixel_t GetActiveColor() const =0
TGListTreeItem * GetBelowMouse() const
Definition: TGListTree.h:405
virtual UInt_t GetPicWidth() const
Return width of item's icon.
Definition: TGListTree.cxx:99
virtual Bool_t IsActive() const
Definition: TGListTree.h:175
virtual void Toggle()
Definition: TGListTree.h:196
GContext_t fLineGC
Definition: TGListTree.h:243
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)
Definition: TGCanvas.cxx:1687
static Pixel_t GetGrayPixel()
Return gray draw color in use.
Bool_t fAutoTips
Definition: TGListTree.h:256
void InsertChild(TGListTreeItem *parent, TGListTreeItem *item)
Insert child in list.
char * out
Definition: TBase64.cxx:29
short Color_t
Definition: RtypesCore.h:79
TGListTreeItem * fPrevsibling
Definition: TGListTree.h:62
TGListTreeItem * GetFirstItem() const
Definition: TGListTree.h:402
virtual void SetText(const char *)
Definition: TGListTree.h:97
virtual const TGPicture * GetCheckBoxPicture() const
Definition: TGListTree.h:189
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
TGListTreeItemStd(const TGListTreeItemStd &)
static const TGFont * fgDefaultFont
Definition: TGListTree.h:268
virtual Color_t GetColor() const =0
A doubly linked list.
Definition: TList.h:47
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.
Definition: TGListTree.h:315
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:98
static const TGGC & GetActiveGC()
Return default graphics context in use.
static const TGPicture * GetCheckedPic()
Returns the icon used for checked checkbox.
Pixel_t fGrayPixel
Definition: TGListTree.h:240
virtual void SetCheckBoxPictures(const TGPicture *, const TGPicture *)
Definition: TGListTree.h:106
void PDeleteItem(TGListTreeItem *item)
Delete given item.
static const TGGC & GetDrawGC()
Return default graphics context in use.
TGListTreeItem * fSelected
Definition: TGListTree.h:233
virtual void * GetUserData() const
Definition: TGListTree.h:186
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...
UInt_t fDefh
Definition: TGListTree.h:247
TGListTreeItem * GetNextSibling() const
Definition: TGListTree.h:83
virtual ~TGListTreeItem()
Definition: TGListTree.h:77
TGListTreeItem * GetFirstChild() const
Definition: TGListTree.h:80
void SetUserControl(Bool_t ctrl=kTRUE)
Definition: TGListTree.h:441
TGListTreeItem * fLastchild
Definition: TGListTree.h:61
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.
TGListTreeItem * fParent
Definition: TGListTree.h:59
virtual void SetOpen(Bool_t o)
Definition: TGListTree.h:86
void GetChecked(TList *checked)
Add all checked list tree items of this list tree into the list 'checked'.
virtual const char * GetText() const =0
unsigned int UInt_t
Definition: RtypesCore.h:42
static TGGC * fgLineGC
Definition: TGListTree.h:271
void ClearHighlighted()
Un highlight items.
Bool_t IsDNDSource() const
Definition: TGListTree.h:133
void Draw(Option_t *="")
Default Draw method for all objects.
Definition: TGListTree.h:288
bool first
Definition: line3Dfit.C:48
virtual void CheckItem(Bool_t checked=kTRUE)
Definition: TGListTree.h:195
tuple w
Definition: qtexample.py:51
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:258
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.
Definition: TGListTree.cxx:221
void SetColorMode(EColorMarkupMode colorMode)
Definition: TGListTree.h:457
TGListTree(const TGListTree &)
virtual void Toggle()
Definition: TGListTree.h:112
virtual void SetColor(Color_t color)
Definition: TGListTree.h:207
GContext_t fColorGC
Definition: TGListTree.h:265
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
Int_t SortChildren(TGListTreeItem *item)
Sort children of item.
Long64_t entry
TGListTreeItem * fDropItem
Definition: TGListTree.h:255
void Rename(const char *new_name)
Definition: TGListTree.h:92
virtual const char * GetText() const
Definition: TGListTree.h:178
void CurrentChanged(Int_t, Int_t)
Emit signal when current position changed.
Definition: TGListTree.h:314
Bool_t HandleDNDDrop(TDNDData *data)
Handle drop events.
Definition: TGListTree.cxx:778
Bool_t fAutoCheckBoxPic
Definition: TGListTree.h:257
TGListTreeItem * fCurrent
Definition: TGListTree.h:234
TGListTreeItem * fLast
Definition: TGListTree.h:232
TGListTreeItem * GetCurrent() const
Definition: TGListTree.h:404
Bool_t IsDNDTarget() const
Definition: TGListTree.h:134
virtual Int_t GetTextLength() const =0
TGListTreeItem * GetSelected() const
Definition: TGListTree.h:403
long Long_t
Definition: RtypesCore.h:50
Bool_t fEventHandled
Definition: TGListTree.h:260
virtual Bool_t IsOpen() const
Definition: TGListTree.h:85
virtual void CheckChildren(TGListTreeItem *, Bool_t)
Definition: TGListTree.h:117
virtual void Layout()
Layout container entries.
Definition: TGListTree.h:311
void DisableOpen(Bool_t disable=kTRUE)
Definition: TGListTree.h:397
void select(Int_t replica=1, Int_t color=kGreen)
Definition: runplugin.C:24
TText * text
UInt_t fDefw
Definition: TGListTree.h:246
void Clicked(TGFrame *, Int_t, Int_t, Int_t)
Emit Clicked() signal.
Definition: TGListTree.h:318
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:176
virtual const TGPicture * GetCheckBoxPicture() const =0
Definition: TGFont.h:155
Int_t fDNDState
Definition: TGListTree.h:67
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.
Int_t ReparentChildren(TGListTreeItem *item, TGListTreeItem *newparent)
Make newparent the new parent of the children of item.
TGListTreeItem * GetPrevSibling() const
Definition: TGListTree.h:82
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:264
Atom_t HandleDNDEnter(Atom_t *typelist)
Handle drag enter events.
Definition: TGListTree.cxx:755
static const TGPicture * fgOpenPic
Definition: TGListTree.h:274
virtual const TGPicture * GetPicture() const
Definition: TGListTree.h:188
Bool_t fUserControlled
Definition: TGListTree.h:259
TGListTreeItem * fBelowMouse
Definition: TGListTree.h:235
TGListTreeItemStd & operator=(const TGListTreeItemStd &)
virtual void SetText(const char *text)
Definition: TGListTree.h:182
virtual void SetPictures(const TGPicture *, const TGPicture *)
Definition: TGListTree.h:104
virtual void CheckAllChildren(Bool_t=kTRUE)
Definition: TGListTree.h:116
#define name(a, b)
Definition: linkTestLib0.cpp:5
Int_t fMargin
Definition: TGListTree.h:239
void SetCheckBox(TGListTreeItem *item, Bool_t on=kTRUE)
Set check button state for the node 'item'.
Mother of all ROOT objects.
Definition: TObject.h:58
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.
Definition: TGListTree.h:321
TGListTreeItem * FindItemByPathname(const char *path)
Find item by pathname.
Int_t fVspacing
Definition: TGListTree.h:237
virtual Bool_t IsChecked() const =0
virtual void UpdateState()
Definition: TGListTree.h:120
static Pixel_t fgGrayPixel
Definition: TGListTree.h:267
void SetAutoTips(Bool_t on=kTRUE)
Definition: TGListTree.h:372
Int_t fHspacing
Definition: TGListTree.h:236
TGListTreeItem * fNextsibling
Definition: TGListTree.h:63
void SetDNDSource(Bool_t onoff)
Definition: TGListTree.h:129
void CloseItem(TGListTreeItem *item)
Close item in list tree (i.e. hide child items).
virtual void SetColor(Color_t)
Definition: TGListTree.h:125
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
static const TGGC & GetColorGC()
Return graphics context for highlighted frame background.
virtual void HandleDrag()
Definition: TGListTree.h:138
virtual Int_t GetTextLength() const
Definition: TGListTree.h:179
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:251
void CheckItem(TGListTreeItem *item, Bool_t check=kTRUE)
Set check button state for the node 'item'.
static const TGPicture * fgUncheckedPic
Definition: TGListTree.h:277
TGListTree & operator=(const TGListTree &)
const TGPicture * fOpenPic
Definition: TGListTree.h:156
void HighlightItem(TGListTreeItem *item)
Highlight item.
virtual Bool_t HasColor() const
Definition: TGListTree.h:205
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
EColorMarkupMode GetColorMode() const
Definition: TGListTree.h:456
virtual void ClearColor()
Definition: TGListTree.h:126
Definition: TGGC.h:35
const Int_t n
Definition: legend1.C:16
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.
static TGGC * fgColorGC
Definition: TGListTree.h:273
Int_t fExposeTop
Definition: TGListTree.h:248
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:374
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 'item' checked if state=kTRUE; unchecked if state=kFALSE.
Definition: TGListTree.cxx:255
virtual const char * GetTipText() const =0
const TGPicture * fClosedPic
Definition: TGListTree.h:157
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:269
ULong_t Handle_t
Definition: GuiTypes.h:27
virtual void SetTipText(const char *tip)
Definition: TGListTree.h:183