Logo ROOT  
Reference Guide
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#include "TGFrame.h"
17#include "TVirtualPadEditor.h"
18#include "TList.h"
19#include "TMap.h"
21class TCanvas;
22class TGCanvas;
23class TGTab;
24class TGTabElement;
25class TVirtualPad;
26class TGedFrame;
27class TGedNameFrame;
28class TGedTabInfo;
33 TGedEditor(const TGedEditor&) = delete;
34 TGedEditor& operator=(const TGedEditor&) = delete;
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
41 TGCanvas *fCan; ///< provides scroll bars
42 TGTab *fTab; ///< tab widget holding the editor
44 TList fCreatedTabs; ///< list of created tabs
45 TList fVisibleTabs; ///< list ofcurrently used tabs
46 TGCompositeFrame *fTabContainer; ///< main tab container
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
54 void ConfigureGedFrames(Bool_t objChaged);
56 virtual TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name);
61 TGedEditor(TCanvas* canvas = nullptr, UInt_t width = 175, UInt_t height = 20);
62 virtual ~TGedEditor();
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);
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);
77 virtual TCanvas* GetCanvas() const { return fCanvas; }
78 virtual TVirtualPad* GetPad() const { return fPad; }
79 virtual TObject* GetModel() const { return fModel; }
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);
96 static void SetFrameCreator(TGedEditor* e);
98 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
unsigned int UInt_t
Definition: RtypesCore.h:46
const Bool_t kFALSE
Definition: RtypesCore.h:101
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
Definition: TDocParser.cxx:121
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
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:398
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
virtual void SetCanvas(TCanvas *c)
Change connection to another canvas.
Definition: TGedEditor.cxx:327
virtual void Hide()
Hide editor. The editor is put into non-active state.
Definition: TGedEditor.cxx:466
void ConfigureGedFrames(Bool_t objChaged)
Call SetModel in class editors.
Definition: TGedEditor.cxx:611
TMap fFrameMap
global map of available frames
Definition: TGedEditor.h:37
void ReinitWorkspace()
Clears windows in editor tab.
Definition: TGedEditor.cxx:239
virtual void CloseWindow()
Called when closed via WM close button. Calls Hide().
Definition: TGedEditor.cxx:229
virtual TGCompositeFrame * GetEditorTab(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:184
TGTab * GetTab() const
Definition: TGedEditor.h:73
virtual void RecursiveRemove(TObject *obj)
Remove references to fModel in case the fModel is being deleted.
Definition: TGedEditor.cxx:480
TGCanvas * GetTGCanvas() const
Definition: TGedEditor.h:72
static TGedEditor * GetFrameCreator()
Returns TGedEditor that currently creates TGedFrames.
Definition: TGedEditor.cxx:81
TVirtualPad * fPad
selected pad
Definition: TGedEditor.h:49
void ActivateEditors(TList *bcl, Bool_t recurse)
Searches GedFrames for classes in the given list.
Definition: TGedEditor.cxx:560
TGCanvas * fCan
provides scroll bars
Definition: TGedEditor.h:41
virtual ~TGedEditor()
Editor destructor.
Definition: TGedEditor.cxx:138
void PrintFrameStat()
Print contents of fFrameMap.
Definition: TGedEditor.cxx:663
virtual void Show()
Show editor.
Definition: TGedEditor.cxx:420
virtual TGedTabInfo * GetEditorTabInfo(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:192
void InsertGedFrame(TGedFrame *f)
Insert GedFrame in fGedFrames list according to priorities.
Definition: TGedEditor.cxx:588
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 TCanvas * GetCanvas() const
Definition: TGedEditor.h:77
TCanvas * fCanvas
canvas related to the editor
Definition: TGedEditor.h:50
virtual void SetGlobal(Bool_t global)
Set editor global.
Definition: TGedEditor.cxx:267
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.
Definition: TGedEditor.cxx:345
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.
Definition: TGedEditor.cxx:89
virtual TObject * GetModel() const
Definition: TGedEditor.h:79
virtual void GlobalClosed()
Delete global editor if no canvas exists.
Definition: TGedEditor.cxx:282
void ExcludeClassEditor(TClass *cl, Bool_t recurse=kFALSE)
Exclude editor for class cl from current construction.
Definition: TGedEditor.cxx:574
void ActivateEditor(TClass *cl, Bool_t recurse)
Searches for GedFrames for given class.
Definition: TGedEditor.cxx:499
virtual Bool_t IsGlobal() const
Definition: TGedEditor.h:85
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
Definition: TGedEditor.cxx:318
TClass * fClass
class of the selected object
Definition: TGedEditor.h:51
virtual void Update(TGedFrame *frame=0)
Virtual method that is called on any change in the dependent frames.
Definition: TGedEditor.cxx:173
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 & operator=(const TGedEditor &)=delete
virtual void GlobalSetModel(TVirtualPad *, TObject *, Int_t)
Set canvas to global editor.
Definition: TGedEditor.cxx:291
virtual void ConnectToCanvas(TCanvas *c)
Connect this editor to the Selected signal of canvas 'c'.
Definition: TGedEditor.cxx:309
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: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