Logo ROOT  
Reference Guide
TGedEditor.h
Go to the documentation of this file.
1 // @(#)root/ged:$Id$
2 // Author: Marek Biskup, Ilka Antcheva 02/12/2003
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2021, 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_TGedEditor
13 #define ROOT_TGedEditor
14 
15 
16 #include "TGFrame.h"
17 #include "TVirtualPadEditor.h"
18 #include "TList.h"
19 #include "TMap.h"
20 
21 class TCanvas;
22 class TGCanvas;
23 class TGTab;
24 class TGTabElement;
25 class TVirtualPad;
26 class TGedFrame;
27 class TGedNameFrame;
28 class TGedTabInfo;
29 
31 {
32 private:
33  TGedEditor(const TGedEditor&) = delete;
34  TGedEditor& operator=(const TGedEditor&) = delete;
35 
36 protected:
37  TMap fFrameMap; ///< global map of available frames
38  TMap fExclMap; ///< map of excluded editors for selected model
39  TList fGedFrames; ///< list visible of frames
40 
41  TGCanvas *fCan; ///< provides scroll bars
42  TGTab *fTab; ///< tab widget holding the editor
43 
44  TList fCreatedTabs; ///< list of created tabs
45  TList fVisibleTabs; ///< list ofcurrently used tabs
46  TGCompositeFrame *fTabContainer; ///< main tab container
47 
48  TObject *fModel; ///< selected object
49  TVirtualPad *fPad; ///< selected pad
50  TCanvas *fCanvas; ///< canvas related to the editor
51  TClass *fClass; ///< class of the selected object
52  Bool_t fGlobal; ///< true if editor is global
53 
54  void ConfigureGedFrames(Bool_t objChaged);
55 
56  virtual TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name);
57 
59 
60 public:
61  TGedEditor(TCanvas* canvas = nullptr, UInt_t width = 175, UInt_t height = 20);
62  virtual ~TGedEditor();
63 
64  void PrintFrameStat();
65  virtual void Update(TGedFrame* frame = 0);
66  void ReinitWorkspace();
67  void ActivateEditor (TClass* cl, Bool_t recurse);
68  void ActivateEditors(TList* bcl, Bool_t recurse);
69  void ExcludeClassEditor(TClass* cl, Bool_t recurse = kFALSE);
70  void InsertGedFrame(TGedFrame* f);
71 
72  TGCanvas* GetTGCanvas() const { return fCan; }
73  TGTab* GetTab() const { return fTab; }
74  virtual TGCompositeFrame* GetEditorTab(const char* name);
75  virtual TGedTabInfo* GetEditorTabInfo(const char* name);
76 
77  virtual TCanvas* GetCanvas() const { return fCanvas; }
78  virtual TVirtualPad* GetPad() const { return fPad; }
79  virtual TObject* GetModel() const { return fModel; }
80 
81 
82  virtual void CloseWindow();
83  virtual void ConnectToCanvas(TCanvas *c);
84  virtual void DisconnectFromCanvas();
85  virtual Bool_t IsGlobal() const { return fGlobal; }
86  virtual void Hide();
87  virtual void GlobalClosed();
88  virtual void SetCanvas(TCanvas *c);
89  virtual void SetGlobal(Bool_t global);
90  virtual void GlobalSetModel(TVirtualPad *, TObject *, Int_t);
91  virtual void SetModel(TVirtualPad* pad, TObject* obj, Int_t event, Bool_t force=kFALSE);
92  virtual void Show();
93  virtual void RecursiveRemove(TObject* obj);
94 
95  static TGedEditor* GetFrameCreator();
96  static void SetFrameCreator(TGedEditor* e);
97 
98  ClassDef(TGedEditor,0) // ROOT graphics editor
99 };
100 
101 #endif
TGedEditor::GetEditorTabInfo
virtual TGedTabInfo * GetEditorTabInfo(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:192
TGedEditor::Show
virtual void Show()
Show editor.
Definition: TGedEditor.cxx:420
TGedEditor::fTab
TGTab * fTab
tab widget holding the editor
Definition: TGedEditor.h:42
c
#define c(i)
Definition: RSha256.hxx:101
TGedEditor::operator=
TGedEditor & operator=(const TGedEditor &)=delete
TGedEditor::TGedEditor
TGedEditor(const TGedEditor &)=delete
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
e
#define e(i)
Definition: RSha256.hxx:103
TGMainFrame
Defines top level windows that interact with the system Window Manager.
Definition: TGFrame.h:398
TGedEditor::RecursiveRemove
virtual void RecursiveRemove(TObject *obj)
Remove references to fModel in case the fModel is being deleted.
Definition: TGedEditor.cxx:480
TGedNameFrame
Definition: TGedFrame.h:86
f
#define f(i)
Definition: RSha256.hxx:104
TGedEditor::SetModel
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event, Bool_t force=kFALSE)
Activate object editors according to the selected object.
Definition: TGedEditor.cxx:345
TGedEditor::fCreatedTabs
TList fCreatedTabs
list of created tabs
Definition: TGedEditor.h:44
TGedEditor::fGlobal
Bool_t fGlobal
true if editor is global
Definition: TGedEditor.h:52
TGedEditor::Hide
virtual void Hide()
Hide editor. The editor is put into non-active state.
Definition: TGedEditor.cxx:466
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
Int_t
int Int_t
Definition: RtypesCore.h:45
TGedEditor::GlobalClosed
virtual void GlobalClosed()
Delete global editor if no canvas exists.
Definition: TGedEditor.cxx:282
TGedEditor::fClass
TClass * fClass
class of the selected object
Definition: TGedEditor.h:51
TList.h
TGedEditor::CloseWindow
virtual void CloseWindow()
Called when closed via WM close button. Calls Hide().
Definition: TGedEditor.cxx:229
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGedEditor::fTabContainer
TGCompositeFrame * fTabContainer
main tab container
Definition: TGedEditor.h:46
TGTabElement
Service classes of the tab widget.
Definition: TGTab.h:117
TGedEditor::ReinitWorkspace
void ReinitWorkspace()
Clears windows in editor tab.
Definition: TGedEditor.cxx:239
bool
TGedEditor::fVisibleTabs
TList fVisibleTabs
list ofcurrently used tabs
Definition: TGedEditor.h:45
TGedEditor::GetPad
virtual TVirtualPad * GetPad() const
Definition: TGedEditor.h:78
TGedEditor::ConfigureGedFrames
void ConfigureGedFrames(Bool_t objChaged)
Call SetModel in class editors.
Definition: TGedEditor.cxx:611
TGedEditor::SetCanvas
virtual void SetCanvas(TCanvas *c)
Change connection to another canvas.
Definition: TGedEditor.cxx:327
TGedEditor::fModel
TObject * fModel
selected object
Definition: TGedEditor.h:48
TVirtualPadEditor.h
TGedEditor::DisconnectFromCanvas
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
Definition: TGedEditor.cxx:318
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TGFrame.h
TGedEditor::fgFrameCreator
static TGedEditor * fgFrameCreator
Definition: TGedEditor.h:58
TGedEditor::GetTab
TGTab * GetTab() const
Definition: TGedEditor.h:73
TGedEditor::GetEditorTab
virtual TGCompositeFrame * GetEditorTab(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:184
TGTab
A tab widget contains a set of composite frames each with a little tab with a name (like a set of fol...
Definition: TGTab.h:46
TGedEditor::ActivateEditor
void ActivateEditor(TClass *cl, Bool_t recurse)
Searches for GedFrames for given class.
Definition: TGedEditor.cxx:499
TGedEditor::~TGedEditor
virtual ~TGedEditor()
Editor destructor.
Definition: TGedEditor.cxx:138
TGedEditor::GetCanvas
virtual TCanvas * GetCanvas() const
Definition: TGedEditor.h:77
TGedEditor::ConnectToCanvas
virtual void ConnectToCanvas(TCanvas *c)
Connect this editor to the Selected signal of canvas 'c'.
Definition: TGedEditor.cxx:309
unsigned int
TGedEditor::fCanvas
TCanvas * fCanvas
canvas related to the editor
Definition: TGedEditor.h:50
TGedEditor::CreateNameFrame
virtual TGedFrame * CreateNameFrame(const TGWindow *parent, const char *tab_name)
Virtual function for creation of top name-frame in each tab.
Definition: TGedEditor.cxx:655
TGedEditor::PrintFrameStat
void PrintFrameStat()
Print contents of fFrameMap.
Definition: TGedEditor.cxx:663
TGedFrame
Base frame for implementing GUI - a service class.
Definition: TGedFrame.h:27
TGedEditor::GetModel
virtual TObject * GetModel() const
Definition: TGedEditor.h:79
TGedEditor::fCan
TGCanvas * fCan
provides scroll bars
Definition: TGedEditor.h:41
TGedEditor::ActivateEditors
void ActivateEditors(TList *bcl, Bool_t recurse)
Searches GedFrames for classes in the given list.
Definition: TGedEditor.cxx:560
TGedEditor::fExclMap
TMap fExclMap
map of excluded editors for selected model
Definition: TGedEditor.h:38
TVirtualPad
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
TGedEditor::SetGlobal
virtual void SetGlobal(Bool_t global)
Set editor global.
Definition: TGedEditor.cxx:267
TCanvas
The Canvas class.
Definition: TCanvas.h:23
TGedEditor::fFrameMap
TMap fFrameMap
global map of available frames
Definition: TGedEditor.h:37
TGedEditor::IsGlobal
virtual Bool_t IsGlobal() const
Definition: TGedEditor.h:85
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TGedEditor::ExcludeClassEditor
void ExcludeClassEditor(TClass *cl, Bool_t recurse=kFALSE)
Exclude editor for class cl from current construction.
Definition: TGedEditor.cxx:574
TGedEditor::InsertGedFrame
void InsertGedFrame(TGedFrame *f)
Insert GedFrame in fGedFrames list according to priorities.
Definition: TGedEditor.cxx:588
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TGedEditor::GetTGCanvas
TGCanvas * GetTGCanvas() const
Definition: TGedEditor.h:72
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMap.h
name
char name[80]
Definition: TGX11.cxx:110
TGedEditor::fGedFrames
TList fGedFrames
list visible of frames
Definition: TGedEditor.h:39
TVirtualPadEditor
Abstract base class used by ROOT graphics editor.
Definition: TVirtualPadEditor.h:27
TGedEditor::GetFrameCreator
static TGedEditor * GetFrameCreator()
Returns TGedEditor that currently creates TGedFrames.
Definition: TGedEditor.cxx:81
TGedEditor::SetFrameCreator
static void SetFrameCreator(TGedEditor *e)
Set the TGedEditor that currently creates TGedFrames.
Definition: TGedEditor.cxx:89
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
TGedEditor
Definition: TGedEditor.h:31
TList
A doubly linked list.
Definition: TList.h:44
TGedEditor::Update
virtual void Update(TGedFrame *frame=0)
Virtual method that is called on any change in the dependent frames.
Definition: TGedEditor.cxx:173
TGedEditor::GlobalSetModel
virtual void GlobalSetModel(TVirtualPad *, TObject *, Int_t)
Set canvas to global editor.
Definition: TGedEditor.cxx:291
TGedEditor::fPad
TVirtualPad * fPad
selected pad
Definition: TGedEditor.h:49
TMap
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40