Logo ROOT  
Reference Guide
No Matches
Go to the documentation of this file.
1// @(#)root/ged:$Id$
2// Author: Marek Biskup, Ilka Antcheva 02/12/2003
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 *************************************************************************/
12#ifndef ROOT_TGedEditor
13#define ROOT_TGedEditor
16// //
17// TGedEditor //
18// //
19// Editor is a composite frame that contains GUI for editting objects //
20// in a canvas. It looks for the class ROOT_classname + 'Editor'. //
21// //
22// It connects to a Canvas and listens for selected objects //
23// //
26#include "TGFrame.h"
27#include "TVirtualPadEditor.h"
28#include "TList.h"
29#include "TMap.h"
31class TCanvas;
32class TGCanvas;
33class TGTab;
34class TGTabElement;
35class TVirtualPad;
36class TGedFrame;
37class TGedNameFrame;
38class TGedTabInfo;
43 TGedEditor(const TGedEditor&) = delete;
44 TGedEditor& operator=(const TGedEditor&) = delete;
47 TMap fFrameMap; //global map of available frames
48 TMap fExclMap; //map of excluded editors for selected model
49 TList fGedFrames; //list visible of frames
51 TGCanvas *fCan; //provides scroll bars
52 TGTab *fTab; //tab widget holding the editor
54 TList fCreatedTabs; //list of created tabs
55 TList fVisibleTabs; //list ofcurrently used tabs
56 TGCompositeFrame *fTabContainer; //main tab container
58 TObject *fModel; //selected object
59 TVirtualPad *fPad; //selected pad
60 TCanvas *fCanvas; //canvas related to the editor
61 TClass *fClass; //class of the selected object
62 Bool_t fGlobal; //true if editor is global
64 void ConfigureGedFrames(Bool_t objChaged);
66 virtual TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name);
71 TGedEditor(TCanvas* canvas = nullptr, UInt_t width = 175, UInt_t height = 20);
72 virtual ~TGedEditor();
74 void PrintFrameStat();
75 virtual void Update(TGedFrame* frame = 0);
76 void ReinitWorkspace();
77 void ActivateEditor (TClass* cl, Bool_t recurse);
78 void ActivateEditors(TList* bcl, Bool_t recurse);
79 void ExcludeClassEditor(TClass* cl, Bool_t recurse = kFALSE);
82 TGCanvas* GetTGCanvas() const { return fCan; }
83 TGTab* GetTab() const { return fTab; }
84 virtual TGCompositeFrame* GetEditorTab(const char* name);
85 virtual TGedTabInfo* GetEditorTabInfo(const char* name);
87 virtual TCanvas* GetCanvas() const { return fCanvas; }
88 virtual TVirtualPad* GetPad() const { return fPad; }
89 virtual TObject* GetModel() const { return fModel; }
92 virtual void CloseWindow();
93 virtual void ConnectToCanvas(TCanvas *c);
94 virtual void DisconnectFromCanvas();
95 virtual Bool_t IsGlobal() const { return fGlobal; }
96 virtual void Hide();
97 virtual void GlobalClosed();
98 virtual void SetCanvas(TCanvas *c);
99 virtual void SetGlobal(Bool_t global);
100 virtual void GlobalSetModel(TVirtualPad *, TObject *, Int_t);
101 virtual void SetModel(TVirtualPad* pad, TObject* obj, Int_t event, Bool_t force=kFALSE);
102 virtual void Show();
103 virtual void RecursiveRemove(TObject* obj);
105 static TGedEditor* GetFrameCreator();
106 static void SetFrameCreator(TGedEditor* e);
108 ClassDef(TGedEditor,0) // ROOT graphics editor
#define f(i)
Definition RSha256.hxx:104
#define c(i)
Definition RSha256.hxx:101
#define e(i)
Definition RSha256.hxx:103
int Int_t
Definition RtypesCore.h:45
const Bool_t kFALSE
Definition RtypesCore.h:92
bool Bool_t
Definition RtypesCore.h:63
#define ClassDef(name, id)
Definition Rtypes.h:325
include TDocParser_001 C image html pict1_TDocParser_001 png width
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:80
Definition TGTab.h:62
virtual void SetCanvas(TCanvas *c)
Change connection to another canvas.
virtual void Hide()
Hide editor. The editor is put into non-active state.
void ConfigureGedFrames(Bool_t objChaged)
Call SetModel in class editors.
TMap fFrameMap
Definition TGedEditor.h:47
void ReinitWorkspace()
Clears windows in editor tab.
virtual void CloseWindow()
Called when closed via WM close button. Calls Hide().
virtual TGCompositeFrame * GetEditorTab(const char *name)
Find or create tab with name.
TGTab * GetTab() const
Definition TGedEditor.h:83
virtual void RecursiveRemove(TObject *obj)
Remove references to fModel in case the fModel is being deleted.
TGCanvas * GetTGCanvas() const
Definition TGedEditor.h:82
static TGedEditor * GetFrameCreator()
Returns TGedEditor that currently creates TGedFrames.
TVirtualPad * fPad
Definition TGedEditor.h:59
void ActivateEditors(TList *bcl, Bool_t recurse)
Searches GedFrames for classes in the given list.
TGCanvas * fCan
Definition TGedEditor.h:51
virtual ~TGedEditor()
Editor destructor.
void PrintFrameStat()
Print contents of fFrameMap.
virtual void Show()
Show editor.
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
Definition TGedEditor.h:52
TMap fExclMap
Definition TGedEditor.h:48
TList fVisibleTabs
Definition TGedEditor.h:55
virtual TCanvas * GetCanvas() const
Definition TGedEditor.h:87
TCanvas * fCanvas
Definition TGedEditor.h:60
virtual void SetGlobal(Bool_t global)
Set editor global.
TList fGedFrames
Definition TGedEditor.h:49
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:88
TGCompositeFrame * fTabContainer
Definition TGedEditor.h:56
TObject * fModel
Definition TGedEditor.h:58
static void SetFrameCreator(TGedEditor *e)
Set the TGedEditor that currently creates TGedFrames.
virtual TObject * GetModel() const
Definition TGedEditor.h:89
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 Bool_t IsGlobal() const
Definition TGedEditor.h:95
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
TClass * fClass
Definition TGedEditor.h:61
virtual void Update(TGedFrame *frame=0)
Virtual method that is called on any change in the dependent frames.
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.
virtual void ConnectToCanvas(TCanvas *c)
Connect this editor to the Selected signal of canvas 'c'.
Bool_t fGlobal
Definition TGedEditor.h:62
static TGedEditor * fgFrameCreator
Definition TGedEditor.h:68
TList fCreatedTabs
Definition TGedEditor.h:54
A doubly linked list.
Definition TList.h:44
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:37
Abstract base class used by ROOT graphics editor.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51