ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 "TRootBrowser.h"
18 #include "TGListTree.h"
19 
20 #include "TContextMenu.h"
21 
22 class TGFileBrowser;
23 class TGSplitter;
24 
25 class TEveGedEditor;
26 
27 
29 {
30 private:
31  TEveListTreeItem(const TEveListTreeItem&); // not implemented
32  TEveListTreeItem& operator=(const TEveListTreeItem&); // not implemented
33 
34 protected:
36 
37  void NotSupported(const char* func) const;
38 
39 public:
41  virtual ~TEveListTreeItem() {}
42 
43  virtual Bool_t IsActive() const { return fElement->GetSelectedLevel() != 0; }
44  virtual Pixel_t GetActiveColor() const;
45  virtual void SetActive(Bool_t) { NotSupported("SetActive"); }
46 
47  virtual const char *GetText() const { return fElement->GetElementName(); }
48  virtual Int_t GetTextLength() const { return strlen(fElement->GetElementName()); }
49  virtual const char *GetTipText() const { return fElement->GetElementTitle(); }
50  virtual Int_t GetTipTextLength() const { return strlen(fElement->GetElementTitle()); }
51  virtual void SetText(const char *) { NotSupported("SetText"); }
52  virtual void SetTipText(const char *) { NotSupported("SetTipText"); }
53 
54  virtual void SetUserData(void *, Bool_t=kFALSE) { NotSupported("SetUserData"); }
55  virtual void *GetUserData() const { return fElement; }
56 
57  virtual const TGPicture*GetPicture() const { return fElement->GetListTreeIcon(fOpen); }
58  virtual const TGPicture*GetCheckBoxPicture() const { return fElement->GetListTreeCheckBoxIcon(); }
59 
60  virtual void SetPictures(const TGPicture*, const TGPicture*) { NotSupported("SetUserData"); }
61  virtual void SetCheckBoxPictures(const TGPicture*, const TGPicture*) { NotSupported("SetUserData"); }
62 
63  virtual void SetCheckBox(Bool_t=kTRUE) { NotSupported("SetCheckBox"); }
64  virtual Bool_t HasCheckBox() const { return kTRUE; }
65  virtual void CheckItem(Bool_t=kTRUE) { printf("TEveListTreeItem::CheckItem - to be ignored ... all done via signal Checked().\n"); }
66  virtual void Toggle();
67  virtual Bool_t IsChecked() const { return fElement->GetRnrState(); }
68 
69  // Propagation of checked-state form children to parents. Not needed, ignore.
70 
71  // Item coloration (underline + minibox)
72  virtual Bool_t HasColor() const { return fElement->HasMainColor(); }
73  virtual Color_t GetColor() const { return fElement->GetMainColor(); }
74  virtual void SetColor(Color_t) { NotSupported("SetColor"); }
75  virtual void ClearColor() { NotSupported("ClearColor"); }
76 
77  ClassDef(TEveListTreeItem,0); // Special llist-tree-item for Eve.
78 };
79 
80 
82 {
83  TEveGListTreeEditorFrame(const TEveGListTreeEditorFrame&); // Not implemented
85 
86  friend class TEveManager;
87 
88 protected:
91 
96 
98 
100 
102 
103 public:
104  TEveGListTreeEditorFrame(const TGWindow* p=0, Int_t width=250, Int_t height=700);
105  virtual ~TEveGListTreeEditorFrame();
106 
107  void ConnectSignals();
108  void DisconnectSignals();
109 
110  void ReconfToHorizontal();
111  void ReconfToVertical();
112 
113  TGListTree* GetListTree() const { return fListTree; }
114  TEveGedEditor* GetEditor() const { return fEditor; }
115 
117  void ItemClicked(TGListTreeItem *entry, Int_t btn, UInt_t mask, Int_t x, Int_t y);
118  void ItemDblClicked(TGListTreeItem* item, Int_t btn);
119  void ItemKeyPress(TGListTreeItem *entry, UInt_t keysym, UInt_t mask);
120 
121  static void SetEditorClass(const char* edclass);
122 
123  ClassDef(TEveGListTreeEditorFrame, 0); // Composite GUI frame for parallel display of a TGListTree and TEveGedEditor.
124 };
125 
126 // ----------------------------------------------------------------
127 
128 class TEveBrowser : public TRootBrowser
129 {
130  TEveBrowser(const TEveBrowser&); // Not implemented
131  TEveBrowser& operator=(const TEveBrowser&); // Not implemented
132 
133 protected:
134  void SetupCintExport(TClass* cl);
135  void CalculateReparentXY(TGObject* parent, Int_t& x, Int_t& y);
136 
141 
142 public:
144  virtual ~TEveBrowser() {}
145 
146  virtual void ReallyDelete();
147  virtual void CloseTab(Int_t id);
148  virtual void CloseWindow();
149 
150  void InitPlugins(Option_t *opt="FI");
151 
153  TGFileBrowser* GetFileBrowser() const;
154  void SetFileBrowser(TGFileBrowser* b);
155 
156  void EveMenu(Int_t id);
157 
158  // Some getters missing in TRootBrowser
159  TGMenuBar* GetMenuBar() const { return fMenuBar; }
161 
162  void HideBottomTab();
163 
164  void SanitizeTabCounts();
165 
166  ClassDef(TEveBrowser, 0); // Specialization of TRootBrowser for Eve.
167 };
168 
169 #endif
TContextMenu * fCtxMenu
Definition: TEveBrowser.h:97
virtual Bool_t GetRnrState() const
Definition: TEveElement.h:256
virtual void CheckItem(Bool_t=kTRUE)
Definition: TEveBrowser.h:65
virtual void SetPictures(const TGPicture *, const TGPicture *)
Definition: TEveBrowser.h:60
virtual const TGPicture * GetPicture() const
Definition: TEveBrowser.h:57
virtual UChar_t GetSelectedLevel() const
Get selection level, needed for rendering selection and highlight feedback.
virtual void ReallyDelete()
Override from TRootBrowser.
virtual void ClearColor()
Definition: TEveBrowser.h:75
virtual const char * GetElementTitle() const
Virtual function for retrieving title of the render-element.
const char Option_t
Definition: RtypesCore.h:62
Specialization of TGedEditor for proper update propagation to TEveManager.
Definition: TEveGedEditor.h:26
void NotSupported(const char *func) const
Warn about access to function members that should never be called.
Definition: TEveBrowser.cxx:75
TGListTree * GetListTree() const
Definition: TEveBrowser.h:113
TH1 * h
Definition: legend2.C:5
TGPopupMenu * fSelPopup
Definition: TEveBrowser.h:139
void HideBottomTab()
Hide the bottom tab (usually holding command-line widget).
void ItemKeyPress(TGListTreeItem *entry, UInt_t keysym, UInt_t mask)
A key has been pressed for an item.
Specialization of TRootBrowser for Eve.
Definition: TEveBrowser.h:128
virtual Int_t GetTextLength() const
Definition: TEveBrowser.h:48
Bool_t fOpen
Definition: TGListTree.h:65
Basic string class.
Definition: TString.h:137
virtual Bool_t HasColor() const
Definition: TEveBrowser.h:72
TGFileBrowser * fFileBrowser
Definition: TEveBrowser.h:137
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition: TEveBrowser.h:54
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
void ReconfToHorizontal()
Reconfigure to horizontal layout, list-tree and editor side by side.
void SetFileBrowser(TGFileBrowser *b)
Set the default file browser.
TGMenuBar * GetMenuBar() const
Definition: TEveBrowser.h:159
virtual const char * GetElementName() const
Virtual function for retrieving name of the element.
TGHorizontalFrame * GetTopMenuFrame() const
Definition: TEveBrowser.h:160
static TString fgEditorClass
Definition: TEveBrowser.h:101
void DisconnectSignals()
Disconnect list-tree signals.
TEveGedEditor * GetEditor() const
Definition: TEveBrowser.h:114
virtual ~TEveListTreeItem()
Definition: TEveBrowser.h:41
Double_t x[n]
Definition: legend1.C:17
virtual Bool_t IsActive() const
Definition: TEveBrowser.h:43
ULong_t Pixel_t
Definition: GuiTypes.h:41
virtual void Toggle()
Item's check-box state has been toggled ...
Definition: TEveBrowser.cxx:99
TGPopupMenu * fEvePopup
Definition: TEveBrowser.h:138
TGHorizontalFrame * fTopMenuFrame
Definition: TRootBrowser.h:81
TGPopupMenu * fHilPopup
Definition: TEveBrowser.h:140
virtual Color_t GetMainColor() const
Definition: TEveElement.h:270
TGFileBrowser * MakeFileBrowser(Bool_t make_default=kFALSE)
Create a file-browser.
TEveBrowser & operator=(const TEveBrowser &)
TEveElement * fElement
Definition: TEveBrowser.h:35
virtual ~TEveBrowser()
Definition: TEveBrowser.h:144
TGCompositeFrame * fFrame
Definition: TEveBrowser.h:89
TGCompositeFrame * fLTFrame
Definition: TEveBrowser.h:90
TEveBrowser(const TEveBrowser &)
void CalculateReparentXY(TGObject *parent, Int_t &x, Int_t &y)
Calculate position of a widget for reparenting into parent.
virtual void SetColor(Color_t)
Definition: TEveBrowser.h:74
short Color_t
Definition: RtypesCore.h:79
virtual void CloseWindow()
Virtual from TGMainFrame. Calls TEveManager::Terminate().
TEveListTreeItem & operator=(const TEveListTreeItem &)
void SanitizeTabCounts()
TRootBrowser keeps (somewhat unnecessarily) counters for number ob tabs on each position.
virtual Int_t GetTipTextLength() const
Definition: TEveBrowser.h:50
TEveGListTreeEditorFrame(const TEveGListTreeEditorFrame &)
TGSplitter * fSplitter
Definition: TEveBrowser.h:94
virtual const char * GetTipText() const
Definition: TEveBrowser.h:49
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:44
ClassDef(TEveGListTreeEditorFrame, 0)
unsigned int UInt_t
Definition: RtypesCore.h:42
TGListTree * fListTree
Definition: TEveBrowser.h:93
tuple w
Definition: qtexample.py:51
void ReconfToVertical()
Reconfigure to vertical layout, list-tree above the editor.
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
Long64_t entry
TEveGListTreeEditorFrame & operator=(const TEveGListTreeEditorFrame &)
TGFileBrowser * GetFileBrowser() const
Returns the default file-browser.
ClassDef(TEveBrowser, 0)
static void SetEditorClass(const char *edclass)
Set GED editor class.
virtual void SetTipText(const char *)
Definition: TEveBrowser.h:52
void InitPlugins(Option_t *opt="FI")
Initialize standard plugins.
TEveListTreeItem(const TEveListTreeItem &)
virtual const char * GetText() const
Definition: TEveBrowser.h:47
virtual void SetCheckBox(Bool_t=kTRUE)
Definition: TEveBrowser.h:63
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:
void ItemDblClicked(TGListTreeItem *item, Int_t btn)
Item has been double-clicked, potentially expand the children.
void EveMenu(Int_t id)
Handle events from Eve menu.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
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 ~TEveGListTreeEditorFrame()
Destructor.
virtual const TGPicture * GetListTreeIcon(Bool_t open=kFALSE)
Returns pointer to first listtreeicon.
virtual const TGPicture * GetCheckBoxPicture() const
Definition: TEveBrowser.h:58
virtual void SetCheckBoxPictures(const TGPicture *, const TGPicture *)
Definition: TEveBrowser.h:61
virtual void SetText(const char *)
Definition: TEveBrowser.h:51
TEveGedEditor * fEditor
Definition: TEveBrowser.h:95
Special list-tree-item for Eve.
Definition: TEveBrowser.h:28
void SetupCintExport(TClass *cl)
Add "Export to CINT" into context-menu for class cl.
void ConnectSignals()
Connect list-tree signals.
virtual Bool_t HasMainColor() const
Definition: TEveElement.h:269
Composite GUI frame for parallel display of a TGListTree and TEveGedEditor.
Definition: TEveBrowser.h:81
TEveListTreeItem(TEveElement *el)
Definition: TEveBrowser.h:40
virtual Bool_t IsChecked() const
Definition: TEveBrowser.h:67
virtual void SetActive(Bool_t)
Definition: TEveBrowser.h:45
virtual void CloseTab(Int_t id)
Virtual from TRootBrowser. Need to intercept closing of Eve tabs.
virtual void * GetUserData() const
Definition: TEveBrowser.h:55
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual Bool_t HasCheckBox() const
Definition: TEveBrowser.h:64
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
virtual Color_t GetColor() const
Definition: TEveBrowser.h:73
virtual Pixel_t GetActiveColor() const
Return highlight color corresponding to current state of TEveElement.
Definition: TEveBrowser.cxx:83
ClassDef(TEveListTreeItem, 0)
TGMenuBar * fMenuBar
Definition: TRootBrowser.h:85
void ItemBelowMouse(TGListTreeItem *entry, UInt_t mask)
Different item is below mouse.