Logo ROOT  
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:
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 {
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 
154  TGFileBrowser* GetFileBrowser() const;
156 
157  void EveMenu(Int_t id);
158 
159  // Some getters missing in TRootBrowser
160  TGMenuBar* GetMenuBar() const { return fMenuBar; }
162 
163  void HideBottomTab();
164 
165  void SanitizeTabCounts();
166 
167  ClassDef(TEveBrowser, 0); // Specialization of TRootBrowser for Eve.
168 };
169 
170 #endif
TEveGListTreeEditorFrame::ConnectSignals
void ConnectSignals()
Connect list-tree signals.
Definition: TEveBrowser.cxx:197
TGObject
This class is the baseclass for all ROOT GUI widgets.
Definition: TGObject.h:22
TEveBrowser::ReallyDelete
virtual void ReallyDelete()
Override from TRootBrowser.
Definition: TEveBrowser.cxx:769
TGFileBrowser
System file browser, used as TRootBrowser plug-in.
Definition: TGFileBrowser.h:36
TEveElement::GetRnrState
virtual Bool_t GetRnrState() const
Definition: TEveElement.h:258
TEveListTreeItem::SetUserData
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition: TEveBrowser.h:55
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TEveGListTreeEditorFrame::fLTCanvas
TGCanvas * fLTCanvas
Definition: TEveBrowser.h:93
TEveElement
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:36
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TEveGListTreeEditorFrame::fSplitter
TGSplitter * fSplitter
Definition: TEveBrowser.h:95
TGMainFrame
Defines top level windows that interact with the system Window Manager.
Definition: TGFrame.h:398
TEveGListTreeEditorFrame::ReconfToHorizontal
void ReconfToHorizontal()
Reconfigure to horizontal layout, list-tree and editor side by side.
Definition: TEveBrowser.cxx:233
TEveGListTreeEditorFrame::fListTree
TGListTree * fListTree
Definition: TEveBrowser.h:94
TEveElement::GetSelectedLevel
virtual UChar_t GetSelectedLevel() const
Get selection level, needed for rendering selection and highlight feedback.
Definition: TEveElement.cxx:2003
TEveBrowser::CloseTab
virtual void CloseTab(Int_t id)
Virtual from TRootBrowser. Need to intercept closing of Eve tabs.
Definition: TEveBrowser.cxx:777
TGPicture
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
Option_t
const char Option_t
Definition: RtypesCore.h:66
TEveBrowser::fSelPopup
TGPopupMenu * fSelPopup
Definition: TEveBrowser.h:140
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
TEveGListTreeEditorFrame::operator=
TEveGListTreeEditorFrame & operator=(const TEveGListTreeEditorFrame &)
TRootBrowser.h
TEveListTreeItem::SetPictures
virtual void SetPictures(const TGPicture *, const TGPicture *)
Definition: TEveBrowser.h:61
TEveGListTreeEditorFrame::ItemDblClicked
void ItemDblClicked(TGListTreeItem *item, Int_t btn)
Item has been double-clicked, potentially expand the children.
Definition: TEveBrowser.cxx:365
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TEveGListTreeEditorFrame::SetEditorClass
static void SetEditorClass(const char *edclass)
Set GED editor class.
Definition: TEveBrowser.cxx:189
Int_t
int Int_t
Definition: RtypesCore.h:45
TEveGedEditor
Specialization of TGedEditor for proper update propagation to TEveManager.
Definition: TEveGedEditor.h:27
TEveBrowser::operator=
TEveBrowser & operator=(const TEveBrowser &)
TGListTree
A list tree is a widget that can contain a number of items arranged in a tree structure.
Definition: TGListTree.h:195
TEveListTreeItem::GetTipText
virtual const char * GetTipText() const
Definition: TEveBrowser.h:50
TEveBrowser::~TEveBrowser
virtual ~TEveBrowser()
Definition: TEveBrowser.h:145
TEveBrowser::fFileBrowser
TGFileBrowser * fFileBrowser
Definition: TEveBrowser.h:138
x
Double_t x[n]
Definition: legend1.C:17
TRootBrowser::CloseTabs
void CloseTabs() override
Properly close the mainframes embedded in the different tabs.
Definition: TRootBrowser.cxx:406
TEveElement.h
TEveBrowser::SetFileBrowser
void SetFileBrowser(TGFileBrowser *b)
Set the default file browser.
Definition: TEveBrowser.cxx:760
TGHorizontalFrame
A composite frame that layout their children in horizontal way.
Definition: TGFrame.h:386
TEveListTreeItem::HasColor
virtual Bool_t HasColor() const
Definition: TEveBrowser.h:73
TEveBrowser::CloseWindow
virtual void CloseWindow()
Virtual from TGMainFrame. Calls TEveManager::Terminate().
Definition: TEveBrowser.cxx:802
TString
Basic string class.
Definition: TString.h:136
TEveBrowser::HideBottomTab
void HideBottomTab()
Hide the bottom tab (usually holding command-line widget).
Definition: TEveBrowser.cxx:810
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TEveGListTreeEditorFrame::~TEveGListTreeEditorFrame
virtual ~TEveGListTreeEditorFrame()
Destructor.
Definition: TEveBrowser.cxx:170
TEveListTreeItem::SetColor
virtual void SetColor(Color_t)
Definition: TEveBrowser.h:75
Color_t
short Color_t
Definition: RtypesCore.h:92
TEveBrowser::MakeFileBrowser
TGFileBrowser * MakeFileBrowser(Bool_t make_default=kFALSE)
Create a file-browser.
Definition: TEveBrowser.cxx:730
TEveGListTreeEditorFrame::fSignalsConnected
Bool_t fSignalsConnected
Definition: TEveBrowser.h:100
b
#define b(i)
Definition: RSha256.hxx:100
TString.h
TEveElement::GetMainColor
virtual Color_t GetMainColor() const
Definition: TEveElement.h:272
TEveBrowser::GetMenuBar
TGMenuBar * GetMenuBar() const
Definition: TEveBrowser.h:160
TEveListTreeItem::SetText
virtual void SetText(const char *)
Definition: TEveBrowser.h:52
bool
TEveBrowser::TEveBrowser
TEveBrowser(const TEveBrowser &)
TEveListTreeItem
Special list-tree-item for Eve.
Definition: TEveBrowser.h:30
TEveElement::GetListTreeCheckBoxIcon
virtual const TGPicture * GetListTreeCheckBoxIcon()
Returns list-tree-item check-box picture appropriate for given rendering state.
Definition: TEveElement.cxx:2054
TContextMenu
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:44
TEveBrowser::SanitizeTabCounts
void SanitizeTabCounts()
TRootBrowser keeps (somewhat unnecessarily) counters for number ob tabs on each position.
Definition: TEveBrowser.cxx:821
TEveListTreeItem::ClearColor
virtual void ClearColor()
Definition: TEveBrowser.h:76
TRootBrowser::fMenuBar
TGMenuBar * fMenuBar
Main (owned) menu bar.
Definition: TRootBrowser.h:81
TEveListTreeItem::IsChecked
virtual Bool_t IsChecked() const
Definition: TEveBrowser.h:68
TContextMenu.h
TEveListTreeItem::CheckItem
virtual void CheckItem(Bool_t=kTRUE)
Definition: TEveBrowser.h:66
TEveGListTreeEditorFrame::DisconnectSignals
void DisconnectSignals()
Disconnect list-tree signals.
Definition: TEveBrowser.cxx:214
TEveBrowser::GetTopMenuFrame
TGHorizontalFrame * GetTopMenuFrame() const
Definition: TEveBrowser.h:161
TEveElement::GetElementName
virtual const char * GetElementName() const
Virtual function for retrieving name of the element.
Definition: TEveElement.cxx:265
h
#define h(i)
Definition: RSha256.hxx:106
TEveGListTreeEditorFrame::ItemBelowMouse
void ItemBelowMouse(TGListTreeItem *entry, UInt_t mask)
Different item is below mouse.
Definition: TEveBrowser.cxx:315
TEveBrowser::InitPlugins
void InitPlugins(Option_t *opt="FI")
Initialize standard plugins.
Definition: TEveBrowser.cxx:704
TEveGListTreeEditorFrame::fgEditorClass
static TString fgEditorClass
Definition: TEveBrowser.h:102
TEveBrowser::fEvePopup
TGPopupMenu * fEvePopup
Definition: TEveBrowser.h:139
TEveBrowser::fHilPopup
TGPopupMenu * fHilPopup
Definition: TEveBrowser.h:141
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TEveListTreeItem::NotSupported
void NotSupported(const char *func) const
Warn about access to function members that should never be called.
Definition: TEveBrowser.cxx:60
TGListTreeItem::fOpen
Bool_t fOpen
true if item is open
Definition: TGListTree.h:42
TEveGListTreeEditorFrame::fFrame
TGCompositeFrame * fFrame
Definition: TEveBrowser.h:90
TEveListTreeItem::HasCheckBox
virtual Bool_t HasCheckBox() const
Definition: TEveBrowser.h:65
TEveListTreeItem::operator=
TEveListTreeItem & operator=(const TEveListTreeItem &)
TEveBrowser::CalculateReparentXY
void CalculateReparentXY(TGObject *parent, Int_t &x, Int_t &y)
Calculate position of a widget for reparenting into parent.
Definition: TEveBrowser.cxx:483
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TEveListTreeItem::SetTipText
virtual void SetTipText(const char *)
Definition: TEveBrowser.h:53
TEveListTreeItem::GetTipTextLength
virtual Int_t GetTipTextLength() const
Definition: TEveBrowser.h:51
TEveGListTreeEditorFrame::fEditor
TEveGedEditor * fEditor
Definition: TEveBrowser.h:96
y
Double_t y[n]
Definition: legend1.C:17
TEveManager
Central application manager for Eve.
Definition: TEveManager.h:50
TEveBrowser::GetFileBrowser
TGFileBrowser * GetFileBrowser() const
Returns the default file-browser.
Definition: TEveBrowser.cxx:752
TEveListTreeItem::SetCheckBox
virtual void SetCheckBox(Bool_t=kTRUE)
Definition: TEveBrowser.h:64
TEveGListTreeEditorFrame::GetListTree
TGListTree * GetListTree() const
Definition: TEveBrowser.h:114
TRootBrowser::fTopMenuFrame
TGHorizontalFrame * fTopMenuFrame
Top menu frame.
Definition: TRootBrowser.h:77
TEveListTreeItem::IsActive
virtual Bool_t IsActive() const
Definition: TEveBrowser.h:44
TGSplitter
A splitter allows the frames left and right or above and below of it to be resized.
Definition: TGSplitter.h:19
TEveListTreeItem::GetTextLength
virtual Int_t GetTextLength() const
Definition: TEveBrowser.h:49
TEveListTreeItem::SetActive
virtual void SetActive(Bool_t)
Definition: TEveBrowser.h:46
unsigned int
TEveBrowser::EveMenu
void EveMenu(Int_t id)
Handle events from Eve menu.
Definition: TEveBrowser.cxx:590
TEveListTreeItem::GetActiveColor
virtual Pixel_t GetActiveColor() const
Return highlight color corresponding to current state of TEveElement.
Definition: TEveBrowser.cxx:68
TEveBrowser
Specialization of TRootBrowser for Eve.
Definition: TEveBrowser.h:130
TEveGListTreeEditorFrame::TEveGListTreeEditorFrame
TEveGListTreeEditorFrame(const TEveGListTreeEditorFrame &)
TEveElement::HasMainColor
virtual Bool_t HasMainColor() const
Definition: TEveElement.h:271
TEveListTreeItem::TEveListTreeItem
TEveListTreeItem(const TEveListTreeItem &)
TEveListTreeItem::Toggle
virtual void Toggle()
Item's check-box state has been toggled ...
Definition: TEveBrowser.cxx:84
TEveElement::GetListTreeIcon
virtual const TGPicture * GetListTreeIcon(Bool_t open=kFALSE)
Returns pointer to first listtreeicon.
Definition: TEveElement.cxx:2044
TEveListTreeItem::GetText
virtual const char * GetText() const
Definition: TEveBrowser.h:48
TEveGListTreeEditorFrame::ItemKeyPress
void ItemKeyPress(TGListTreeItem *entry, UInt_t keysym, UInt_t mask)
A key has been pressed for an item.
Definition: TEveBrowser.cxx:407
TEveElement::GetElementTitle
virtual const char * GetElementTitle() const
Virtual function for retrieving title of the render-element.
Definition: TEveElement.cxx:278
TEveGListTreeEditorFrame::GetEditor
TEveGedEditor * GetEditor() const
Definition: TEveBrowser.h:115
TEveGListTreeEditorFrame::ReconfToVertical
void ReconfToVertical()
Reconfigure to vertical layout, list-tree above the editor.
Definition: TEveBrowser.cxx:274
TEveListTreeItem::fElement
TEveElement * fElement
Definition: TEveBrowser.h:36
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGListTree.h
TGPopupMenu
This class creates a popup menu object.
Definition: TGMenu.h:110
TEveGListTreeEditorFrame::fCtxMenu
TContextMenu * fCtxMenu
Definition: TEveBrowser.h:98
TEveListTreeItem::SetCheckBoxPictures
virtual void SetCheckBoxPictures(const TGPicture *, const TGPicture *)
Definition: TEveBrowser.h:62
TEveGListTreeEditorFrame
Composite GUI frame for parallel display of a TGListTree and TEveGedEditor.
Definition: TEveBrowser.h:83
TEveListTreeItem::GetCheckBoxPicture
virtual const TGPicture * GetCheckBoxPicture() const
Definition: TEveBrowser.h:59
TGMenuBar
The TGMenu.h header contains all different menu classes.
Definition: TGMenu.h:282
TEveListTreeItem::~TEveListTreeItem
virtual ~TEveListTreeItem()
Definition: TEveBrowser.h:42
TEveGListTreeEditorFrame::ItemClicked
void ItemClicked(TGListTreeItem *entry, Int_t btn, UInt_t mask, Int_t x, Int_t y)
Item has been clicked, based on mouse button do:
Definition: TEveBrowser.cxx:327
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGCanvas
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition: TGCanvas.h:192
TGListTreeItem
Definition: TGListTree.h:27
TEveListTreeItem::GetUserData
virtual void * GetUserData() const
Definition: TEveBrowser.h:56
TEveGListTreeEditorFrame::fLTFrame
TGCompositeFrame * fLTFrame
Definition: TEveBrowser.h:91
TEveListTreeItem::GetColor
virtual Color_t GetColor() const
Definition: TEveBrowser.h:74
TEveListTreeItem::TEveListTreeItem
TEveListTreeItem(TEveElement *el)
Definition: TEveBrowser.h:41
TEveListTreeItem::GetPicture
virtual const TGPicture * GetPicture() const
Definition: TEveBrowser.h:58
int
TRootBrowser
This class creates a ROOT object browser, constituted by three main tabs.
Definition: TRootBrowser.h:54
TEveBrowser::SetupCintExport
void SetupCintExport(TClass *cl)
Add "Export to CINT" into context-menu for class cl.
Definition: TEveBrowser.cxx:471