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-2000, 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;
39class TGedTabInfo;
44 TGedEditor(const TGedEditor&); // Not implemented
45 TGedEditor& operator=(const TGedEditor&); // Not implemented
48 TMap fFrameMap; //global map of available frames
49 TMap fExclMap; //map of excluded editors for selected model
50 TList fGedFrames; //list visible of frames
52 TGCanvas *fCan; //provides scroll bars
53 TGTab *fTab; //tab widget holding the editor
55 TList fCreatedTabs; //list of created tabs
56 TList fVisibleTabs; //list ofcurrently used tabs
57 TGCompositeFrame *fTabContainer; //main tab container
59 TObject *fModel; //selected object
60 TVirtualPad *fPad; //selected pad
61 TCanvas *fCanvas; //canvas related to the editor
62 TClass *fClass; //class of the selected object
63 Bool_t fGlobal; //true if editor is global
65 void ConfigureGedFrames(Bool_t objChaged);
67 virtual TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name);
72 TGedEditor(TCanvas* canvas = 0, UInt_t width = 175, UInt_t height = 20);
73 virtual ~TGedEditor();
75 void PrintFrameStat();
76 virtual void Update(TGedFrame* frame = 0);
77 void ReinitWorkspace();
78 void ActivateEditor (TClass* cl, Bool_t recurse);
79 void ActivateEditors(TList* bcl, Bool_t recurse);
80 void ExcludeClassEditor(TClass* cl, Bool_t recurse = kFALSE);
83 TGCanvas* GetTGCanvas() const { return fCan; }
84 TGTab* GetTab() const { return fTab; }
85 virtual TGCompositeFrame* GetEditorTab(const char* name);
86 virtual TGedTabInfo* GetEditorTabInfo(const char* name);
88 virtual TCanvas* GetCanvas() const { return fCanvas; }
89 virtual TVirtualPad* GetPad() const { return fPad; }
90 virtual TObject* GetModel() const { return fModel; }
93 virtual void CloseWindow();
94 virtual void ConnectToCanvas(TCanvas *c);
95 virtual void DisconnectFromCanvas();
96 virtual Bool_t IsGlobal() const { return fGlobal; }
97 virtual void Hide();
98 virtual void GlobalClosed();
99 virtual void SetCanvas(TCanvas *c);
100 virtual void SetGlobal(Bool_t global);
101 virtual void GlobalSetModel(TVirtualPad *, TObject *, Int_t);
102 virtual void SetModel(TVirtualPad* pad, TObject* obj, Int_t event, Bool_t force=kFALSE);
103 virtual void Show();
104 virtual void RecursiveRemove(TObject* obj);
106 static TGedEditor* GetFrameCreator();
107 static void SetFrameCreator(TGedEditor* e);
109 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:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:326
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
char name[80]
Definition: TGX11.cxx:109
The Canvas class.
Definition: TCanvas.h:31
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
Definition: TGTab.h:62
TGedEditor & operator=(const TGedEditor &)
virtual void SetCanvas(TCanvas *c)
Change connection to another canvas.
Definition: TGedEditor.cxx:331
virtual void Hide()
Hide editor. The editor is put into non-active state.
Definition: TGedEditor.cxx:470
void ConfigureGedFrames(Bool_t objChaged)
Call SetModel in class editors.
Definition: TGedEditor.cxx:615
TMap fFrameMap
Definition: TGedEditor.h:48
void ReinitWorkspace()
Clears windows in editor tab.
Definition: TGedEditor.cxx:243
TGedEditor(const TGedEditor &)
virtual void CloseWindow()
Called when closed via WM close button. Calls Hide().
Definition: TGedEditor.cxx:233
virtual TGCompositeFrame * GetEditorTab(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:188
TGTab * GetTab() const
Definition: TGedEditor.h:84
virtual void RecursiveRemove(TObject *obj)
Remove references to fModel in case the fModel is being deleted.
Definition: TGedEditor.cxx:484
TGCanvas * GetTGCanvas() const
Definition: TGedEditor.h:83
static TGedEditor * GetFrameCreator()
Returns TGedEditor that currently creates TGedFrames.
Definition: TGedEditor.cxx:85
TVirtualPad * fPad
Definition: TGedEditor.h:60
void ActivateEditors(TList *bcl, Bool_t recurse)
Searches GedFrames for classes in the given list.
Definition: TGedEditor.cxx:564
TGCanvas * fCan
Definition: TGedEditor.h:52
virtual ~TGedEditor()
Editor destructor.
Definition: TGedEditor.cxx:142
void PrintFrameStat()
Print contents of fFrameMap.
Definition: TGedEditor.cxx:667
virtual void Show()
Show editor.
Definition: TGedEditor.cxx:424
virtual TGedTabInfo * GetEditorTabInfo(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:196
void InsertGedFrame(TGedFrame *f)
Insert GedFrame in fGedFrames list according to priorities.
Definition: TGedEditor.cxx:592
TGTab * fTab
Definition: TGedEditor.h:53
TMap fExclMap
Definition: TGedEditor.h:49
TList fVisibleTabs
Definition: TGedEditor.h:56
virtual TCanvas * GetCanvas() const
Definition: TGedEditor.h:88
TCanvas * fCanvas
Definition: TGedEditor.h:61
virtual void SetGlobal(Bool_t global)
Set editor global.
Definition: TGedEditor.cxx:271
TList fGedFrames
Definition: TGedEditor.h:50
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:349
virtual TVirtualPad * GetPad() const
Definition: TGedEditor.h:89
TGCompositeFrame * fTabContainer
Definition: TGedEditor.h:57
TObject * fModel
Definition: TGedEditor.h:59
static void SetFrameCreator(TGedEditor *e)
Set the TGedEditor that currently creates TGedFrames.
Definition: TGedEditor.cxx:93
virtual TObject * GetModel() const
Definition: TGedEditor.h:90
virtual void GlobalClosed()
Delete global editor if no canvas exists.
Definition: TGedEditor.cxx:286
void ExcludeClassEditor(TClass *cl, Bool_t recurse=kFALSE)
Exclude editor for class cl from current construction.
Definition: TGedEditor.cxx:578
void ActivateEditor(TClass *cl, Bool_t recurse)
Searches for GedFrames for given class.
Definition: TGedEditor.cxx:503
virtual Bool_t IsGlobal() const
Definition: TGedEditor.h:96
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
Definition: TGedEditor.cxx:322
TClass * fClass
Definition: TGedEditor.h:62
virtual void Update(TGedFrame *frame=0)
Virtual method that is called on any change in the dependent frames.
Definition: TGedEditor.cxx:177
virtual TGedFrame * CreateNameFrame(const TGWindow *parent, const char *tab_name)
Virtual function for creation of top name-frame in each tab.
Definition: TGedEditor.cxx:659
virtual void GlobalSetModel(TVirtualPad *, TObject *, Int_t)
Set canvas to global editor.
Definition: TGedEditor.cxx:295
virtual void ConnectToCanvas(TCanvas *c)
Connect this editor to the Selected signal of canvas 'c'.
Definition: TGedEditor.cxx:313
Bool_t fGlobal
Definition: TGedEditor.h:63
static TGedEditor * fgFrameCreator
Definition: TGedEditor.h:69
TList fCreatedTabs
Definition: TGedEditor.h:55
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:50