Logo ROOT   6.10/09
Reference Guide
TEveBrowser.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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_TEveBrowser
13 #define ROOT_TEveBrowser
14 
15 #include "TEveElement.h"
16 
17 #include "TContextMenu.h"
18 #include "TGListTree.h"
19 #include "TRootBrowser.h"
20 #include "TString.h"
21 
22 
23 class TGFileBrowser;
24 class TGSplitter;
25 
26 class TEveGedEditor;
27 
28 
30 {
31 private:
32  TEveListTreeItem(const TEveListTreeItem&); // not implemented
33  TEveListTreeItem& operator=(const TEveListTreeItem&); // not implemented
34 
35 protected:
37 
38  void NotSupported(const char* func) const;
39 
40 public:
41  TEveListTreeItem(TEveElement* el) : TGListTreeItem(), fElement(el) {}
42  virtual ~TEveListTreeItem() {}
43 
44  virtual Bool_t IsActive() const { return fElement->GetSelectedLevel() != 0; }
45  virtual Pixel_t GetActiveColor() const;
46  virtual void SetActive(Bool_t) { NotSupported("SetActive"); }
47 
48  virtual const char *GetText() const { return fElement->GetElementName(); }
49  virtual Int_t GetTextLength() const { return strlen(fElement->GetElementName()); }
50  virtual const char *GetTipText() const { return fElement->GetElementTitle(); }
51  virtual Int_t GetTipTextLength() const { return strlen(fElement->GetElementTitle()); }
52  virtual void SetText(const char *) { NotSupported("SetText"); }
53  virtual void SetTipText(const char *) { NotSupported("SetTipText"); }
54 
55  virtual void SetUserData(void *, Bool_t=kFALSE) { NotSupported("SetUserData"); }
56  virtual void *GetUserData() const { return fElement; }
57 
58  virtual const TGPicture*GetPicture() const { return fElement->GetListTreeIcon(fOpen); }
59  virtual const TGPicture*GetCheckBoxPicture() const { return fElement->GetListTreeCheckBoxIcon(); }
60 
61  virtual void SetPictures(const TGPicture*, const TGPicture*) { NotSupported("SetUserData"); }
62  virtual void SetCheckBoxPictures(const TGPicture*, const TGPicture*) { NotSupported("SetUserData"); }
63 
64  virtual void SetCheckBox(Bool_t=kTRUE) { NotSupported("SetCheckBox"); }
65  virtual Bool_t HasCheckBox() const { return kTRUE; }
66  virtual void CheckItem(Bool_t=kTRUE) { printf("TEveListTreeItem::CheckItem - to be ignored ... all done via signal Checked().\n"); }
67  virtual void Toggle();
68  virtual Bool_t IsChecked() const { return fElement->GetRnrState(); }
69 
70  // Propagation of checked-state form children to parents. Not needed, ignore.
71 
72  // Item coloration (underline + minibox)
73  virtual Bool_t HasColor() const { return fElement->HasMainColor(); }
74  virtual Color_t GetColor() const { return fElement->GetMainColor(); }
75  virtual void SetColor(Color_t) { NotSupported("SetColor"); }
76  virtual void ClearColor() { NotSupported("ClearColor"); }
77 
78  ClassDef(TEveListTreeItem,0); // Special llist-tree-item for Eve.
79 };
80 
81 
83 {
84  TEveGListTreeEditorFrame(const TEveGListTreeEditorFrame&); // Not implemented
86 
87  friend class TEveManager;
88 
89 protected:
92 
97 
99 
101 
103 
104 public:
105  TEveGListTreeEditorFrame(const TGWindow* p=0, Int_t width=250, Int_t height=700);
106  virtual ~TEveGListTreeEditorFrame();
107 
108  void ConnectSignals();
109  void DisconnectSignals();
110 
111  void ReconfToHorizontal();
112  void ReconfToVertical();
113 
114  TGListTree* GetListTree() const { return fListTree; }
115  TEveGedEditor* GetEditor() const { return fEditor; }
116 
117  void ItemBelowMouse(TGListTreeItem *entry, UInt_t mask);
118  void ItemClicked(TGListTreeItem *entry, Int_t btn, UInt_t mask, Int_t x, Int_t y);
119  void ItemDblClicked(TGListTreeItem* item, Int_t btn);
120  void ItemKeyPress(TGListTreeItem *entry, UInt_t keysym, UInt_t mask);
121 
122  static void SetEditorClass(const char* edclass);
123 
124  ClassDef(TEveGListTreeEditorFrame, 0); // Composite GUI frame for parallel display of a TGListTree and TEveGedEditor.
125 };
126 
127 // ----------------------------------------------------------------
128 
129 class TEveBrowser : public TRootBrowser
130 {
131  TEveBrowser(const TEveBrowser&); // Not implemented
132  TEveBrowser& operator=(const TEveBrowser&); // Not implemented
133 
134 protected:
135  void SetupCintExport(TClass* cl);
136  void CalculateReparentXY(TGObject* parent, Int_t& x, Int_t& y);
137 
142 
143 public:
145  virtual ~TEveBrowser() { CloseTabs(); }
146 
147  virtual void ReallyDelete();
148  virtual void CloseTab(Int_t id);
149  virtual void CloseWindow();
150 
151  void InitPlugins(Option_t *opt="FI");
152 
153  TGFileBrowser* MakeFileBrowser(Bool_t make_default=kFALSE);
154  TGFileBrowser* GetFileBrowser() const;
155  void SetFileBrowser(TGFileBrowser* b);
156 
157  void EveMenu(Int_t id);
158 
159  // Some getters missing in TRootBrowser
160  TGMenuBar* GetMenuBar() const { return fMenuBar; }
161  TGHorizontalFrame* GetTopMenuFrame() const { return fTopMenuFrame; }
162 
163  void HideBottomTab();
164 
165  void SanitizeTabCounts();
166 
167  ClassDef(TEveBrowser, 0); // Specialization of TRootBrowser for Eve.
168 };
169 
170 #endif
TContextMenu * fCtxMenu
Definition: TEveBrowser.h:98
virtual Pixel_t GetActiveColor() const
Return highlight color corresponding to current state of TEveElement.
Definition: TEveBrowser.cxx:83
virtual void CheckItem(Bool_t=kTRUE)
Definition: TEveBrowser.h:66
virtual void SetPictures(const TGPicture *, const TGPicture *)
Definition: TEveBrowser.h:61
virtual Int_t GetTipTextLength() const
Definition: TEveBrowser.h:51
virtual void ClearColor()
Definition: TEveBrowser.h:76
virtual Bool_t IsChecked() const
Definition: TEveBrowser.h:68
virtual const char * GetTipText() const
Definition: TEveBrowser.h:50
const char Option_t
Definition: RtypesCore.h:62
virtual Color_t GetColor() const
Definition: TEveBrowser.h:74
Specialization of TGedEditor for proper update propagation to TEveManager.
Definition: TEveGedEditor.h:26
TH1 * h
Definition: legend2.C:5
TGPopupMenu * fSelPopup
Definition: TEveBrowser.h:140
Specialization of TRootBrowser for Eve.
Definition: TEveBrowser.h:129
virtual Bool_t GetRnrState() const
Definition: TEveElement.h:256
TEveGedEditor * GetEditor() const
Definition: TEveBrowser.h:115
Bool_t fOpen
Definition: TGListTree.h:59
void NotSupported(const char *func) const
Warn about access to function members that should never be called.
Definition: TEveBrowser.cxx:75
Basic string class.
Definition: TString.h:129
TGListTree * GetListTree() const
Definition: TEveBrowser.h:114
TGFileBrowser * fFileBrowser
Definition: TEveBrowser.h:138
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition: TEveBrowser.h:55
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
static TString fgEditorClass
Definition: TEveBrowser.h:102
virtual const TGPicture * GetCheckBoxPicture() const
Definition: TEveBrowser.h:59
virtual ~TEveListTreeItem()
Definition: TEveBrowser.h:42
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:297
ULong_t Pixel_t
Definition: GuiTypes.h:39
virtual void Toggle()
Item's check-box state has been toggled ...
Definition: TEveBrowser.cxx:99
TGPopupMenu * fEvePopup
Definition: TEveBrowser.h:139
TGPopupMenu * fHilPopup
Definition: TEveBrowser.h:141
virtual Bool_t IsActive() const
Definition: TEveBrowser.h:44
TEveElement * fElement
Definition: TEveBrowser.h:36
TGMenuBar * GetMenuBar() const
Definition: TEveBrowser.h:160
virtual ~TEveBrowser()
Definition: TEveBrowser.h:145
TGCompositeFrame * fFrame
Definition: TEveBrowser.h:90
TGCompositeFrame * fLTFrame
Definition: TEveBrowser.h:91
virtual void SetColor(Color_t)
Definition: TEveBrowser.h:75
short Color_t
Definition: RtypesCore.h:79
TEveListTreeItem & operator=(const TEveListTreeItem &)
virtual Color_t GetMainColor() const
Definition: TEveElement.h:270
TGHorizontalFrame * GetTopMenuFrame() const
Definition: TEveBrowser.h:161
TGSplitter * fSplitter
Definition: TEveBrowser.h:95
virtual Bool_t HasMainColor() const
Definition: TEveElement.h:269
virtual const TGPicture * GetListTreeCheckBoxIcon()
Returns list-tree-item check-box picture appropriate for given rendering state.
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:40
virtual Int_t GetTextLength() const
Definition: TEveBrowser.h:49
unsigned int UInt_t
Definition: RtypesCore.h:42
TGListTree * fListTree
Definition: TEveBrowser.h:94
virtual const char * GetText() const
Definition: TEveBrowser.h:48
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:71
virtual const char * GetElementName() const
Virtual function for retrieving name of the element.
virtual Bool_t HasCheckBox() const
Definition: TEveBrowser.h:65
const Bool_t kFALSE
Definition: RtypesCore.h:92
virtual void SetTipText(const char *)
Definition: TEveBrowser.h:53
TEveListTreeItem(const TEveListTreeItem &)
virtual void SetCheckBox(Bool_t=kTRUE)
Definition: TEveBrowser.h:64
virtual const char * GetElementTitle() const
Virtual function for retrieving title of the render-element.
virtual void * GetUserData() const
Definition: TEveBrowser.h:56
Double_t y[n]
Definition: legend1.C:17
double func(double *x, double *p)
Definition: stressTF1.cxx:213
Central application manager for Eve.
Definition: TEveManager.h:49
virtual Bool_t HasColor() const
Definition: TEveBrowser.h:73
virtual const TGPicture * GetListTreeIcon(Bool_t open=kFALSE)
Returns pointer to first listtreeicon.
virtual void SetCheckBoxPictures(const TGPicture *, const TGPicture *)
Definition: TEveBrowser.h:62
virtual void SetText(const char *)
Definition: TEveBrowser.h:52
TEveGedEditor * fEditor
Definition: TEveBrowser.h:96
Special list-tree-item for Eve.
Definition: TEveBrowser.h:29
virtual const TGPicture * GetPicture() const
Definition: TEveBrowser.h:58
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
Composite GUI frame for parallel display of a TGListTree and TEveGedEditor.
Definition: TEveBrowser.h:82
TEveListTreeItem(TEveElement *el)
Definition: TEveBrowser.h:41
virtual void SetActive(Bool_t)
Definition: TEveBrowser.h:46
virtual UChar_t GetSelectedLevel() const
Get selection level, needed for rendering selection and highlight feedback.
const Bool_t kTRUE
Definition: RtypesCore.h:91
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33