Logo ROOT   6.08/07
Reference Guide
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,
222  kColorUnderline = BIT(0),
223  kColorBox = BIT(1)
224  };
225  enum ECheckMode {
226  kSimple = BIT(2),
227  kRecursive = BIT(3)
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();
280  static FontStruct_t GetDefaultFontStruct();
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*)"); }
289  Int_t DrawChildren(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y, Int_t xroot);
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);
302  Int_t SearchChildren(TGListTreeItem *item, Int_t y, Int_t findy,
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);
360  Int_t DeleteItem(TGListTreeItem *item);
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 
368  Int_t DeleteChildren(TGListTreeItem *item);
369  Int_t Reparent(TGListTreeItem *item, TGListTreeItem *newparent);
370  Int_t ReparentChildren(TGListTreeItem *item, TGListTreeItem *newparent);
371  void SetToolTipItem(TGListTreeItem *item, const char *string);
372  void SetAutoTips(Bool_t on = kTRUE) { fAutoTips = on; }
373  void SetAutoCheckBoxPic(Bool_t on) { fAutoCheckBoxPic = 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);
388  Int_t SortSiblings(TGListTreeItem *item);
389  Int_t SortChildren(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; }
405  TGListTreeItem *GetBelowMouse() const { return fBelowMouse; }
406  TGListTreeItem *FindSiblingByName(TGListTreeItem *item, const char *name);
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
441  void SetUserControl(Bool_t ctrl=kTRUE) { fUserControlled = ctrl; }
442  Bool_t HasUserControl() const { return fUserControlled; }
443  void SetEventHandled(Bool_t eh=kTRUE) { fEventHandled = eh; }
444  Bool_t IsEventHandled() const { return fEventHandled; }
445 
446  Bool_t HandleDNDDrop(TDNDData *data);
447  Atom_t HandleDNDPosition(Int_t x, Int_t y, Atom_t action,
448  Int_t xroot, Int_t yroot);
449  Atom_t HandleDNDEnter(Atom_t * typelist);
450  Bool_t HandleDNDLeave();
451 
453  return &fDNDData;
454  }
455 
456  EColorMarkupMode GetColorMode() const { return fColorMode; }
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
TGClient * fClient
Definition: TGListTree.h:58
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
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGListTree.h:347
void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t beginWith=kFALSE)
Definition: TGListTree.h:305
GContext_t fHighlightGC
Definition: TGListTree.h:244
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
Definition: TBufferFile.h:51
virtual void * GetUserData() const =0
virtual void SetCheckBox(Bool_t=kTRUE)
Definition: TGListTree.h:109
Bool_t IsDNDTarget() const
Definition: TGListTree.h:134
return c
virtual Bool_t HasColor() const =0
const char Option_t
Definition: RtypesCore.h:62
virtual Bool_t HasUnCheckedChild(Bool_t=kFALSE)
Definition: TGListTree.h:119
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
TH1 * h
Definition: legend2.C:5
void ReturnPressed(TGFrame *)
Signal emitted when Return/Enter key pressed.
Definition: TGListTree.h:316
void RenameSelected(const char *string)
Definition: TGListTree.h:416
TDNDData fDNDData
Definition: TGListTree.h:253
virtual void ClearColor()
Definition: TGListTree.h:208
const TGPicture * fUncheckedPic
Definition: TGListTree.h:159
TGListTreeItem * GetBelowMouse() const
Definition: TGListTree.h:405
Int_t fExposeBottom
Definition: TGListTree.h:249
void DoubleClicked(TGFrame *, Int_t)
Emit DoubleClicked() signal.
Definition: TGListTree.h:319
virtual Int_t GetTextLength() const
Definition: TGListTree.h:179
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
int Int_t
Definition: RtypesCore.h:41
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
static const TGPicture * fgCheckedPic
Definition: TGListTree.h:276
virtual const TGPicture * GetPicture() const
Definition: TGListTree.h:188
Int_t DeleteSelected()
Definition: TGListTree.h:415
const TGPicture * fCheckedPic
Definition: TGListTree.h:158
virtual Bool_t HasCheckBox() const
Definition: TGListTree.h:194
TGListTreeItem * GetSelected() const
Definition: TGListTree.h:403
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 void CheckItem(Bool_t=kTRUE)=0
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
#define ClassDef(name, id)
Definition: Rtypes.h:254
Int_t fIndent
Definition: TGListTree.h:238
ULong_t Pixel_t
Definition: GuiTypes.h:41
virtual void SetActive(Bool_t)
Definition: TGListTree.h:90
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition: TGListTree.h:100
virtual Bool_t HasCheckedChild(Bool_t=kFALSE)
Definition: TGListTree.h:118
UInt_t fLastEventState
Definition: TGListTree.h:261
virtual Bool_t IsActive() const =0
FontStruct_t fFont
Definition: TGListTree.h:245
Handle_t Atom_t
Definition: GuiTypes.h:38
virtual void SetUserData(void *userData, Bool_t own=kFALSE)
Definition: TGListTree.h:185
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
EColorMarkupMode fColorMode
Definition: TGListTree.h:263
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
Definition: TMath.h:989
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 * GetPrevSibling() const
Definition: TGListTree.h:82
virtual void Toggle()
Definition: TGListTree.h:196
GContext_t fLineGC
Definition: TGListTree.h:243
virtual const char * GetText() const
Definition: TGListTree.h:178
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
Definition: TGCanvas.cxx:1687
Bool_t fAutoTips
Definition: TGListTree.h:256
short Color_t
Definition: RtypesCore.h:79
TGListTreeItem * fPrevsibling
Definition: TGListTree.h:62
virtual void SetText(const char *)
Definition: TGListTree.h:97
void MayNotUse(const char *method)
This function can be used in classes that should override a certain function, but in the inherited cl...
Definition: TError.cxx:269
Bool_t IsEventHandled() const
Definition: TGListTree.h:444
static const TGFont * fgDefaultFont
Definition: TGListTree.h:268
Bool_t HasUserControl() const
Definition: TGListTree.h:442
virtual Color_t GetColor() const =0
A doubly linked list.
Definition: TList.h:47
void CurrentChanged(TGFrame *)
Emit signal when current selected frame changed.
Definition: TGListTree.h:315
virtual void SetTipText(const char *)
Definition: TGListTree.h:98
th1 Draw()
friend class TGListTree
Definition: TGListTree.h:51
virtual Bool_t HasColor() const
Definition: TGListTree.h:205
virtual Bool_t IsActive() const
Definition: TGListTree.h:175
Pixel_t fGrayPixel
Definition: TGListTree.h:240
virtual void SetCheckBoxPictures(const TGPicture *, const TGPicture *)
Definition: TGListTree.h:106
TGListTreeItem * GetCurrent() const
Definition: TGListTree.h:404
TGListTreeItem * fSelected
Definition: TGListTree.h:233
Bool_t IsDNDSource() const
Definition: TGListTree.h:133
UInt_t fDefh
Definition: TGListTree.h:247
virtual ~TGListTreeItem()
Definition: TGListTree.h:77
TGListTreeItem * GetNextSibling() const
Definition: TGListTree.h:83
void SetUserControl(Bool_t ctrl=kTRUE)
Definition: TGListTree.h:441
TGListTreeItem * fLastchild
Definition: TGListTree.h:61
TGListTreeItem & operator=(const TGListTreeItem &)
virtual const TGPicture * GetCheckBoxPicture() const
Definition: TGListTree.h:189
virtual Bool_t HasCheckBox() const =0
TGListTreeItem * fParent
Definition: TGListTree.h:59
virtual void * GetUserData() const
Definition: TGListTree.h:186
virtual void SetOpen(Bool_t o)
Definition: TGListTree.h:86
virtual const char * GetText() const =0
unsigned int UInt_t
Definition: RtypesCore.h:42
static TGGC * fgLineGC
Definition: TGListTree.h:271
virtual Color_t GetColor() const
Definition: TGListTree.h:206
Ssiz_t Length() const
Definition: TString.h:390
void Draw(Option_t *="")
Default Draw method for all objects.
Definition: TGListTree.h:288
virtual void CheckItem(Bool_t checked=kTRUE)
Definition: TGListTree.h:195
Bool_t fDisableOpen
Definition: TGListTree.h:258
void SetColorMode(EColorMarkupMode colorMode)
Definition: TGListTree.h:457
virtual void Toggle()
Definition: TGListTree.h:112
virtual void SetColor(Color_t color)
Definition: TGListTree.h:207
GContext_t fColorGC
Definition: TGListTree.h:265
TGListTreeItem(const TGListTreeItem &)
TGListTreeItem * fDropItem
Definition: TGListTree.h:255
void Rename(const char *new_name)
Definition: TGListTree.h:92
void CurrentChanged(Int_t, Int_t)
Emit signal when current position changed.
Definition: TGListTree.h:314
EColorMarkupMode GetColorMode() const
Definition: TGListTree.h:456
Bool_t fAutoCheckBoxPic
Definition: TGListTree.h:257
TGListTreeItem * fCurrent
Definition: TGListTree.h:234
virtual Bool_t HandlesDragAndDrop() const
Definition: TGListTree.h:137
TGListTreeItem * fLast
Definition: TGListTree.h:232
virtual Int_t GetTextLength() const =0
long Long_t
Definition: RtypesCore.h:50
TGListTreeItem * GetParent() const
Definition: TGListTree.h:79
Bool_t fEventHandled
Definition: TGListTree.h:260
virtual void CheckChildren(TGListTreeItem *, Bool_t)
Definition: TGListTree.h:117
virtual void Layout()
Layout container entries.
Definition: TGListTree.h:311
TGListTreeItem * GetLastChild() const
Definition: TGListTree.h:81
void DisableOpen(Bool_t disable=kTRUE)
Definition: TGListTree.h:397
TText * text
virtual UInt_t GetPicWidth() const
Return width of item&#39;s icon.
Definition: TGListTree.cxx:99
UInt_t fDefw
Definition: TGListTree.h:246
TGListTreeItem * GetFirstChild() const
Definition: TGListTree.h:80
void Clicked(TGFrame *, Int_t, Int_t, Int_t)
Emit Clicked() signal.
Definition: TGListTree.h:318
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
Double_t y[n]
Definition: legend1.C:17
virtual const char * GetTipText() const
Definition: TGListTree.h:180
ECheckMode fCheckMode
Definition: TGListTree.h:264
static const TGPicture * fgOpenPic
Definition: TGListTree.h:274
Bool_t fUserControlled
Definition: TGListTree.h:259
TGListTreeItem * fBelowMouse
Definition: TGListTree.h:235
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
Int_t fMargin
Definition: TGListTree.h:239
virtual Bool_t IsOpen() const
Definition: TGListTree.h:85
Mother of all ROOT objects.
Definition: TObject.h:37
virtual Int_t GetTipTextLength() const
Definition: TGListTree.h:181
ECheckMode GetCheckMode() const
Definition: TGListTree.h:459
void KeyPressed(TGFrame *, UInt_t, UInt_t)
Signal emitted when keyboard key pressed.
Definition: TGListTree.h:321
virtual Bool_t IsChecked() const
Definition: TGListTree.h:197
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
virtual void SetColor(Color_t)
Definition: TGListTree.h:125
void End()
virtual void HandleDrag()
Definition: TGListTree.h:138
TGListTreeItem * fTipItem
Definition: TGListTree.h:251
static const TGPicture * fgUncheckedPic
Definition: TGListTree.h:277
Definition: first.py:1
const TGPicture * fOpenPic
Definition: TGListTree.h:156
TGListTreeItem * GetFirstItem() const
Definition: TGListTree.h:402
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void ClearColor()
Definition: TGListTree.h:126
Definition: TGGC.h:35
const Int_t n
Definition: legend1.C:16
static TGGC * fgColorGC
Definition: TGListTree.h:273
Int_t fExposeTop
Definition: TGListTree.h:248
char name[80]
Definition: TGX11.cxx:109
void SetSelected(TGListTreeItem *item)
Definition: TGListTree.h:374
virtual const char * GetTipText() const =0
const TGPicture * fClosedPic
Definition: TGListTree.h:157
T1 fFirst
Definition: X11Events.mm:86
static TGGC * fgActiveGC
Definition: TGListTree.h:269
const char * Data() const
Definition: TString.h:349
ULong_t Handle_t
Definition: GuiTypes.h:27
virtual void SetTipText(const char *tip)
Definition: TGListTree.h:183