Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
21class TCanvas;
22class TGCanvas;
23class TGTab;
24class TGTabElement;
25class TVirtualPad;
26class TGedFrame;
27class TGedNameFrame;
28class TGedTabInfo;
29
31{
32private:
33 TGedEditor(const TGedEditor&) = delete;
34 TGedEditor& operator=(const TGedEditor&) = delete;
35
36protected:
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
60public:
61 TGedEditor(TCanvas* canvas = nullptr, UInt_t width = 175, UInt_t height = 20);
62 ~TGedEditor() override;
63
64 void PrintFrameStat();
65 virtual void Update(TGedFrame* frame = nullptr);
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);
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 TCanvas* GetCanvas() const override { return fCanvas; }
78 virtual TVirtualPad* GetPad() const { return fPad; }
79 virtual TObject* GetModel() const { return fModel; }
80
81
82 void CloseWindow() override;
83 virtual void ConnectToCanvas(TCanvas *c);
84 virtual void DisconnectFromCanvas();
85 Bool_t IsGlobal() const override { return fGlobal; }
86 void Hide() override;
87 virtual void GlobalClosed();
88 virtual void SetCanvas(TCanvas *c);
89 void SetGlobal(Bool_t global) override;
90 virtual void GlobalSetModel(TVirtualPad *, TObject *, Int_t);
91 virtual void SetModel(TVirtualPad* pad, TObject* obj, Int_t event, Bool_t force=kFALSE);
92 void Show() override;
93 void RecursiveRemove(TObject* obj) override;
94
96 static void SetFrameCreator(TGedEditor* e);
97
98 ClassDefOverride(TGedEditor,0) // ROOT graphics editor
99};
100
101#endif
#define f(i)
Definition RSha256.hxx:104
#define c(i)
Definition RSha256.hxx:101
#define e(i)
Definition RSha256.hxx:103
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
char name[80]
Definition TGX11.cxx:110
The Canvas class.
Definition TCanvas.h:23
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:397
Service classes of the tab widget.
Definition TGTab.h:117
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
ROOT GUI Window base class.
Definition TGWindow.h:23
void Show() override
Show editor.
Bool_t IsGlobal() const override
Definition TGedEditor.h:85
void Hide() override
Hide editor. The editor is put into non-active state.
virtual void SetCanvas(TCanvas *c)
Change connection to another canvas.
void ConfigureGedFrames(Bool_t objChaged)
Call SetModel in class editors.
TMap fFrameMap
global map of available frames
Definition TGedEditor.h:37
void ReinitWorkspace()
Clears windows in editor tab.
TCanvas * GetCanvas() const override
Definition TGedEditor.h:77
virtual TGCompositeFrame * GetEditorTab(const char *name)
Find or create tab with name.
TGTab * GetTab() const
Definition TGedEditor.h:73
TGCanvas * GetTGCanvas() const
Definition TGedEditor.h:72
void SetGlobal(Bool_t global) override
Set editor global.
static TGedEditor * GetFrameCreator()
Returns TGedEditor that currently creates TGedFrames.
TVirtualPad * fPad
selected pad
Definition TGedEditor.h:49
void ActivateEditors(TList *bcl, Bool_t recurse)
Searches GedFrames for classes in the given list.
TGCanvas * fCan
provides scroll bars
Definition TGedEditor.h:41
void RecursiveRemove(TObject *obj) override
Remove references to fModel in case the fModel is being deleted.
void PrintFrameStat()
Print contents of fFrameMap.
virtual TGedTabInfo * GetEditorTabInfo(const char *name)
Find or create tab with name.
void InsertGedFrame(TGedFrame *f)
Insert GedFrame in fGedFrames list according to priorities.
TGTab * fTab
tab widget holding the editor
Definition TGedEditor.h:42
TMap fExclMap
map of excluded editors for selected model
Definition TGedEditor.h:38
TList fVisibleTabs
list ofcurrently used tabs
Definition TGedEditor.h:45
virtual void Update(TGedFrame *frame=nullptr)
Virtual method that is called on any change in the dependent frames.
TCanvas * fCanvas
canvas related to the editor
Definition TGedEditor.h:50
TList fGedFrames
list visible of frames
Definition TGedEditor.h:39
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event, Bool_t force=kFALSE)
Activate object editors according to the selected object.
TGedEditor(const TGedEditor &)=delete
virtual TVirtualPad * GetPad() const
Definition TGedEditor.h:78
TGCompositeFrame * fTabContainer
main tab container
Definition TGedEditor.h:46
TObject * fModel
selected object
Definition TGedEditor.h:48
static void SetFrameCreator(TGedEditor *e)
Set the TGedEditor that currently creates TGedFrames.
virtual TObject * GetModel() const
Definition TGedEditor.h:79
virtual void GlobalClosed()
Delete global editor if no canvas exists.
void ExcludeClassEditor(TClass *cl, Bool_t recurse=kFALSE)
Exclude editor for class cl from current construction.
void ActivateEditor(TClass *cl, Bool_t recurse)
Searches for GedFrames for given class.
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
TClass * fClass
class of the selected object
Definition TGedEditor.h:51
virtual TGedFrame * CreateNameFrame(const TGWindow *parent, const char *tab_name)
Virtual function for creation of top name-frame in each tab.
TGedEditor & operator=(const TGedEditor &)=delete
virtual void GlobalSetModel(TVirtualPad *, TObject *, Int_t)
Set canvas to global editor.
void CloseWindow() override
Called when closed via WM close button. Calls Hide().
virtual void ConnectToCanvas(TCanvas *c)
Connect this editor to the Selected signal of canvas 'c'.
~TGedEditor() override
Editor destructor.
Bool_t fGlobal
true if editor is global
Definition TGedEditor.h:52
static TGedEditor * fgFrameCreator
Definition TGedEditor.h:58
TList fCreatedTabs
list of created tabs
Definition TGedEditor.h:44
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
A doubly linked list.
Definition TList.h:38
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition TMap.h:40
Mother of all ROOT objects.
Definition TObject.h:41
Abstract base class used by ROOT graphics editor.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51