Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGedEditor.cxx
Go to the documentation of this file.
1// @(#)root/ged:$Id$
2// Author: Marek Biskup, Ilka Antcheva 02/08/2003
3
4/*************************************************************************
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 *************************************************************************/
11
12
13/* \class TGedEditor
14 \ingroup ged
15
16The main class of ROOT graphics editor. It manages the appearance
17of objects editors according to the selected object in the canvas
18(an object became selected after the user click on it using the
19left-mouse button).
20
21Every object editor provides an object specific GUI and follows a
22simple naming convention: it has as a name the object class name
23concatenated with 'Editor' (e.g. for TGraph objects the object
24editor is TGraphEditor).
25
26The ROOT graphics editor can be activated by selecting 'Editor'
27from the View canvas menu, or SetLine/Fill/Text/MarkerAttributes
28from the context menu. The algorithm in use is simple: according to
29the selected object <obj> in the canvas it looks for a class name
30<obj>Editor. If a class with this name exists, the editor verifies
31that this class derives from the base editor class TGedFrame.
32It makes an instance of the object editor, scans all object base
33classes searching the corresponding object editors and makes an
34instance of the base class editor too. Once the object editor is in
35place, it sets the user interface elements according to the object
36state and is ready for interactions. When a new object of a
37different class is selected, a new object editor is loaded in the
38editor frame. The old one is cached in memory for potential reuse.
39
40Any created canvas will be shown with the editor if you have a
41.rootrc file in your working directory containing the line:
42Canvas.ShowEditor: true
43
44An created object can be set as selected in a macro by:
45canvas->Selected(parent_pad_of_object, object, 1);
46The first parameter can be the canvas itself or the pad containing
47'object'.
48
49*/
50
51
52#include "TGedEditor.h"
53#include "TCanvas.h"
54#include "TGCanvas.h"
55#include "TGTab.h"
56#include "TGedFrame.h"
57#include "TROOT.h"
58#include "TClass.h"
59#include "TBaseClass.h"
60#include "TVirtualX.h"
61
62
63class TGedTabInfo : public TObject {
64 // Helper class for managing visibility and order of created tabs.
65public:
68
71};
72
73
74
76
77////////////////////////////////////////////////////////////////////////////////
78/// Returns TGedEditor that currently creates TGedFrames.
79
84
85////////////////////////////////////////////////////////////////////////////////
86/// Set the TGedEditor that currently creates TGedFrames.
87
92
93////////////////////////////////////////////////////////////////////////////////
94/// Constructor of graphics editor.
95
97 TGMainFrame(gClient->GetRoot(), width, height),
98 fCan (0),
99 fTab (0),
100 fTabContainer (0),
101 fModel (0),
102 fPad (0),
103 fCanvas (0),
104 fClass (0),
105 fGlobal (kTRUE)
106{
107 fCan = new TGCanvas(this, 170, 10, kFixedWidth);
109
110 fTab = new TGTab(fCan->GetViewPort(), 10, 10);
114
115 fTabContainer = GetEditorTab("Style");
116
117 gROOT->GetListOfCleanups()->Add(this);
118
119 SetCanvas(canvas);
120 if (fCanvas) {
122 if (ch)
123 Resize(GetWidth(), ch > 700 ? 700 : ch);
124 else
125 Resize(GetWidth(), fCanvas->GetWh()<450 ? 450 : fCanvas->GetWh() + 4);
126 } else {
128 }
129
131 MapWindow();
132}
133
134////////////////////////////////////////////////////////////////////////////////
135/// Editor destructor.
136
138{
139 Hide();
140
141 if(fGlobal){
142 TQObject::Disconnect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)");
143 TQObject::Disconnect("TCanvas", "Closed()");
144 }
145
146 // delete class editors
147 TIter next(fFrameMap.GetTable());
148 TPair* pair;
149 while ((pair = (TPair*) next())) {
150 if (pair->Value() != 0) {
151 TGedFrame* frame = (TGedFrame*) pair->Value();
152 delete frame;
153 }
154 }
155
158 while ((ti = (TGedTabInfo*) it1())) {
159 fTab->AddFrame(ti->fElement,0);
160 fTab->AddFrame(ti->fContainer,0);
161 }
162
163 delete fTab;
164 delete ((TGFrameElement*)fList->First())->fLayout;
165 delete fCan;
166}
167
168////////////////////////////////////////////////////////////////////////////////
169/// Virtual method that is called on any change in the dependent frames.
170/// This implementation simply calls fPad Modified()/Update().
171
173{
174 if (fPad) {
175 fPad->Modified();
176 fPad->Update();
177 }
178}
179
180////////////////////////////////////////////////////////////////////////////////
181/// Find or create tab with name.
182
184{
185 return GetEditorTabInfo(name)->fContainer;
186}
187
188////////////////////////////////////////////////////////////////////////////////
189/// Find or create tab with name.
190
192{
193 // look in list of created tabs
194 if ( ! fCreatedTabs.IsEmpty()) {
195 TIter next(&fCreatedTabs);
197 while ((ti = (TGedTabInfo *) next())) {
198 if (*ti->fElement->GetText() == name)
199 return ti;
200 }
201 }
202
203 // create tab
205
206 // remove created frame end tab element from the fTab frame
210
211 // create a title frame for each tab
213 if (nf) {
214 nf->SetGedEditor(this);
215 nf->SetModelClass(0);
216 tc->AddFrame(nf, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 2, 2));
217 }
218 // add to list of created tabs
219 TGedTabInfo* ti = new TGedTabInfo(te, tc);
221
222 return ti;
223}
224
225////////////////////////////////////////////////////////////////////////////////
226/// Called when closed via WM close button. Calls Hide().
227
229{
230 Hide();
231}
232
233////////////////////////////////////////////////////////////////////////////////
234/// Clears windows in editor tab.
235/// Unmap and withdraw currently shown frames and thus prepare for
236/// construction of a new class layout or destruction.
237
239{
240 TIter next(&fVisibleTabs);
242 while ((ti = (TGedTabInfo*)next())) {
243 TGTabElement *te = ti->fElement;
244 TGCompositeFrame *tc = ti->fContainer;
245
248
249 TIter frames(tc->GetList());
250 frames(); // skip name-frame
251 TGFrameElement* fr;
252 while ((fr = (TGFrameElement *) frames()) != 0) {
253 TGFrame *f = fr->fFrame;
254 tc->RemoveFrame(f);
255 f->UnmapWindow();
256 te->UnmapWindow();
257 tc->UnmapWindow();
258 }
260 }
261}
262
263////////////////////////////////////////////////////////////////////////////////
264/// Set editor global.
265
267{
268 fGlobal = global;
269 if (fGlobal) {
270 TQObject::Connect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)",
271 "TGedEditor", this, "GlobalSetModel(TVirtualPad *, TObject *, Int_t)");
272
273 TQObject::Connect("TCanvas", "Closed()",
274 "TGedEditor", this, "GlobalClosed()");
275 }
276}
277
278////////////////////////////////////////////////////////////////////////////////
279/// Delete global editor if no canvas exists.
280
282{
283 if (gROOT->GetListOfCanvases()->IsEmpty())
285}
286
287////////////////////////////////////////////////////////////////////////////////
288/// Set canvas to global editor.
289
291{
292 if ((ev != kButton1Down) || !IsMapped() ||
293 (obj && obj->InheritsFrom("TColorWheel")))
294 return;
295
296 TCanvas* can = pad->GetCanvas();
297 // Do nothing if canvas is the same as before or
298 // local editor of the canvas is active.
299 if (!can || (can == fCanvas || can->GetShowEditor()))
300 return;
301
302 Show();
303}
304
305////////////////////////////////////////////////////////////////////////////////
306/// Connect this editor to the Selected signal of canvas 'c'.
307
309{
310 c->Connect("Selected(TVirtualPad*,TObject*,Int_t)", "TGedEditor",
311 this, "SetModel(TVirtualPad*,TObject*,Int_t)");
312}
313
314////////////////////////////////////////////////////////////////////////////////
315/// Disconnect this editor from the Selected signal of fCanvas.
316
318{
319 if (fCanvas)
320 Disconnect(fCanvas, "Selected(TVirtualPad*,TObject*,Int_t)", this, "SetModel(TVirtualPad*,TObject*,Int_t)");
321}
322
323////////////////////////////////////////////////////////////////////////////////
324/// Change connection to another canvas.
325
327{
328 if (fCanvas == newcan) return;
329
331 fCanvas = newcan;
332
333 if (!newcan) return;
334
335 SetWindowName(Form("%s_Editor", fCanvas->GetName()));
337 if (fPad == 0) fPad = fCanvas;
339}
340
341////////////////////////////////////////////////////////////////////////////////
342/// Activate object editors according to the selected object.
343
345{
346 if ((event != kButton1Down) || (obj && obj->InheritsFrom("TColorWheel")))
347 return;
348
349 if (gPad && gPad->GetVirtCanvas()) gPad->GetVirtCanvas()->SetCursor(kWatch);
350 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
351
352 fPad = pad;
353 if (obj == 0) obj = fPad;
354
355 // keep selected by name
357
359 if (fModel != obj || force) {
360 fModel = obj;
361 if (fModel == 0 || fModel->IsA() != fClass) {
363 mapTabs = kTRUE;
364 // add Style tab to list of visible tabs
366 if (fModel) {
367 fClass = fModel->IsA();
368 // build a list of editors
370 } else {
371 fClass = 0;
372 }
373
374 // add class editors to fTabContainer
375 TGedFrame* gfr;
377 while ((gfr = (TGedFrame*) ngf()))
379
380 fExclMap.Clear();
382
383 // add visible tabs in fTab
384 TIter next(&fVisibleTabs);
386 while ((ti = (TGedTabInfo *) next())) {
387 fTab->AddFrame(ti->fElement,0);
388 fTab->AddFrame(ti->fContainer,0);
389 }
390 }
392 } else {
394 } // end fModel != obj
395
396 if (mapTabs) { // selected object is different class
398 TIter next(&fVisibleTabs);
399 while ((ti = (TGedTabInfo *) next())) {
400 ti->fElement->MapWindow();
401 ti->fContainer->MapWindow();
402 }
403 if (seltab == 0 || fTab->SetTab(seltab->GetString(), kFALSE) == kFALSE)
404 fTab->SetTab(0, kFALSE);
405 }
406
407 if (fGlobal)
408 Layout();
409 else
410 ((TGMainFrame*)GetMainFrame())->Layout();
411
412 if (gPad && gPad->GetVirtCanvas()) gPad->GetVirtCanvas()->SetCursor(kPointer);
413 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kPointer));
414}
415
416////////////////////////////////////////////////////////////////////////////////
417/// Show editor.
418
420{
421 // gPad is setup properly in calling code for global and canvas editor.
422 if (gPad) SetCanvas(gPad->GetCanvas());
423
424 if (fCanvas && fGlobal) {
426
427 if (fCanvas->GetShowEditor())
429
435 if (!ch)
436 cy = cy + 20; // embedded canvas protection
437
438 Int_t gedx = 0, gedy = 0;
439
440 if (cw + GetWidth() > dw) {
441 gedx = cx + cw - GetWidth();
442 gedy = ch - GetHeight();
443 } else {
444 if (cx > GetWidth())
445 gedx = cx - GetWidth() - 20;
446 else
447 gedx = cx + cw + 10;
448 gedy = cy - 20;
449 }
450 MoveResize(gedx, gedy, GetWidth(), ch > 700 ? 700 : ch);
452 } else if (fCanvas) {
454 }
455 MapWindow();
456 gVirtualX->RaiseWindow(GetId());
457
458 if (!gROOT->GetListOfCleanups()->FindObject(this))
459 gROOT->GetListOfCleanups()->Add(this);
460}
461
462////////////////////////////////////////////////////////////////////////////////
463/// Hide editor. The editor is put into non-active state.
464
466{
467 UnmapWindow();
469 fModel = 0; fClass = 0;
471 fCanvas = 0; fPad = 0;
472 gROOT->GetListOfCleanups()->Remove(this);
473}
474
475////////////////////////////////////////////////////////////////////////////////
476/// Remove references to fModel in case the fModel is being deleted.
477/// Deactivate attribute frames if they point to obj.
478
480{
481 if (obj == fPad) {
482 // printf("TGedEditor::RecursiveRemove: %s - pad deleted.\n", locglob);
484 return;
485 }
486
487 if (obj == fModel) {
488 // printf("TGedEditor::RecursiveRemove: %s - model deleted.\n", locglob);
490 return;
491 }
492}
493
494////////////////////////////////////////////////////////////////////////////////
495/// Searches for GedFrames for given class. In recursive mode look for class
496/// editor in its list of bases.
497
499{
500 TPair *pair = (TPair*) fFrameMap.FindObject(cl);
501 TClass *edClass = 0;
502 TGedFrame *frame = 0;
503
504 if (pair == 0) {
505 edClass = TClass::GetClass(Form("%sEditor", cl->GetName()));
506
507 if (edClass && edClass->InheritsFrom(TGedFrame::Class())) {
510 fgFrameCreator = this;
511 frame = reinterpret_cast<TGedFrame*>(edClass->New());
512 frame->SetModelClass(cl);
513 fgFrameCreator = 0;
515 }
516 fFrameMap.Add(cl, frame);
517 } else {
518 frame = (TGedFrame*)pair->Value();
519 }
520
523
524 if (frame) {
526 if (exclpair) {
527 exclfr = kTRUE;
528 exclbases = (exclpair->Value() != 0);
529 }
530
531 if (!exclfr && frame->AcceptModel(fModel)){
532 // handle extra tabs in the gedframe
533 if (frame->GetExtraTabs()) {
534 TIter next(frame->GetExtraTabs());
536 while ((subf = (TGedFrame::TGedSubFrame*)next())) {
537 // locate the composite frame on created tabs
539 ti->fContainer->AddFrame(subf->fFrame, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
540 if (fVisibleTabs.FindObject(ti) == 0)
542 }
543 }
544 InsertGedFrame(frame);
545 }
546 }
547
548 if (recurse && !exclbases) {
549 if (frame)
550 frame->ActivateBaseClassEditors(cl);
551 else
553 }
554}
555
556////////////////////////////////////////////////////////////////////////////////
557/// Searches GedFrames for classes in the given list.
558
560{
561 TBaseClass *base;
562 TIter next(bcl);
563
564 while ((base = (TBaseClass*) next())) {
566 }
567}
568
569////////////////////////////////////////////////////////////////////////////////
570/// Exclude editor for class cl from current construction.
571/// If recurse is true the base-class editors of cl are also excluded.
572
574{
575 TPair* pair = (TPair*) fExclMap.FindObject(cl);
576 if (pair) {
577 if (recurse && pair->Value() == 0)
578 pair->SetValue((TObject*)(Longptr_t)1); // hack, reuse TObject as Bool_t
579 } else {
580 fExclMap.Add(cl, (TObject*)(Longptr_t)(recurse ? 1 : 0));
581 }
582}
583
584////////////////////////////////////////////////////////////////////////////////
585/// Insert GedFrame in fGedFrames list according to priorities.
586
588{
589 // printf("%s %s insert gedframe %s \n", fModel->GetName(), fModel->IsA()->GetName(),f->GetModelClass()->GetName());
591 if (lnk == 0) {
593 return;
594 }
595 TGedFrame* cf;
596 while (lnk) {
597 cf = (TGedFrame*) lnk->GetObject();
598 if (f->GetPriority() < cf->GetPriority()) {
600 return;
601 }
602 lnk = lnk->Next();
603 }
605}
606
607////////////////////////////////////////////////////////////////////////////////
608/// Call SetModel in class editors.
609
611{
613
614 // Call SetModel on TGedNameFrames (first in the container list)
615 // and map extra-tabs.
617 vistabs(); // skip Style tab
619 while ((ti = (TGedTabInfo *) vistabs())) {
620 TIter fr(ti->fContainer->GetList());
621 el = (TGFrameElement*) fr();
622 if (el) {
623 ((TGedFrame*) el->fFrame)->SetModel(fModel);
624 if (objChanged) {
625 do {
626 el->fFrame->MapSubwindows();
627 el->fFrame->Layout();
628 el->fFrame->MapWindow();
629 } while((el = (TGFrameElement *) fr()));
630 }
631 }
632 ti->fContainer->Layout();
633 }
634
635 TIter next(fTabContainer->GetList());
636 while ((el = (TGFrameElement *) next())) {
637 if ((el->fFrame)->InheritsFrom(TGedFrame::Class())) {
638 if (objChanged) {
639 el->fFrame->MapSubwindows();
640 ((TGedFrame *)(el->fFrame))->SetModel(fModel);
641 el->fFrame->Layout();
642 el->fFrame->MapWindow();
643 } else {
644 ((TGedFrame *)(el->fFrame))->SetModel(fModel);
645 }
646 }
647 }
649}
650
651////////////////////////////////////////////////////////////////////////////////
652/// Virtual function for creation of top name-frame in each tab.
653
654TGedFrame* TGedEditor::CreateNameFrame(const TGWindow* parent, const char* /*tab_name*/)
655{
656 return new TGedNameFrame(parent);
657}
658
659////////////////////////////////////////////////////////////////////////////////
660/// Print contents of fFrameMap.
661
663{
664 printf("TGedEditor::PrintFrameStat()\n");
665 Int_t sum = 0;
666 TIter next(fFrameMap.GetTable());
667 TPair* pair;
668 while ((pair = (TPair*) next())) {
669 if (pair->Value() != 0) {
670 TClass* cl = (TClass*) pair->Key();
671 printf("TGedFrame created for %s \n", cl->GetName());
672 sum ++;
673 }
674 }
675 printf("SUMMARY: %d editors stored in the local map.\n", sum);
676}
@ kButton1Down
Definition Buttons.h:17
Cppyy::TCppType_t fClass
@ kWatch
Definition GuiTypes.h:375
@ kPointer
Definition GuiTypes.h:375
@ kFixedWidth
Definition GuiTypes.h:387
#define f(i)
Definition RSha256.hxx:104
#define c(i)
Definition RSha256.hxx:101
#define e(i)
Definition RSha256.hxx:103
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define gClient
Definition TGClient.h:157
@ kDeepCleanup
Definition TGFrame.h:42
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsNormal
Definition TGLayout.h:32
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetWMPosition
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
#define gROOT
Definition TROOT.h:411
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2495
#define gPad
#define gVirtualX
Definition TVirtualX.h:337
Each class (see TClass) has a linked list of its base class(es).
Definition TBaseClass.h:33
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
The Canvas class.
Definition TCanvas.h:23
UInt_t GetWindowHeight() const
Definition TCanvas.h:162
TObject * GetClickSelected() const
Definition TCanvas.h:142
TVirtualPad * GetClickSelectedPad() const
Definition TCanvas.h:147
Int_t GetWindowTopX()
Returns current top x position of window on screen.
Definition TCanvas.cxx:1208
Int_t GetWindowTopY()
Returns current top y position of window on screen.
Definition TCanvas.cxx:1219
Bool_t GetShowEditor() const
Definition TCanvas.h:150
virtual void ToggleEditor()
Toggle editor.
Definition TCanvas.cxx:2450
TVirtualPad * GetSelectedPad() const override
Definition TCanvas.h:146
UInt_t GetWindowWidth() const
Definition TCanvas.h:161
UInt_t GetWh() const override
Definition TCanvas.h:164
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition TClass.cxx:3663
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition TClass.cxx:2973
virtual Bool_t IsEmpty() const
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
virtual void SetContainer(TGFrame *f)
Definition TGCanvas.h:222
TGViewPort * GetViewPort() const
Definition TGCanvas.h:217
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:223
void SetRoot(TGWindow *root=nullptr)
Sets the current root (i.e.
Definition TGClient.cxx:243
UInt_t GetDisplayWidth() const
Get display width.
Definition TGClient.cxx:261
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
virtual TList * GetList() const
Definition TGFrame.h:312
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1249
TList * fList
container of frame elements
Definition TGFrame.h:294
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1064
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1141
TGFrame * fFrame
Definition TGLayout.h:112
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
Definition TGFrame.cxx:621
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
void MapWindow() override
map window
Definition TGFrame.h:206
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
UInt_t GetHeight() const
Definition TGFrame.h:227
UInt_t GetWidth() const
Definition TGFrame.h:226
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:399
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1780
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t GetId() const
Definition TGObject.h:41
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition TGString.h:20
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
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition TGTab.cxx:660
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition TGTab.cxx:706
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
Definition TGTab.cxx:555
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition TGTab.cxx:373
TGTabElement * GetCurrentTab() const
Definition TGTab.h:96
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition TGWindow.cxx:150
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Definition TGWindow.cxx:293
void Show() override
Show editor.
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.
virtual TGCompositeFrame * GetEditorTab(const char *name)
Find or create tab with name.
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
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 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.
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
virtual void ActivateBaseClassEditors(TClass *cl)
Provide list of editors for base-classes.
TList * GetExtraTabs()
Definition TGedFrame.h:70
void SetModelClass(TClass *mcl)
Definition TGedFrame.h:78
virtual Bool_t AcceptModel(TObject *)
Definition TGedFrame.h:77
TGedTabInfo(TGTabElement *el, TGCompositeFrame *f)
TGTabElement * fElement
TGCompositeFrame * fContainer
A doubly linked list.
Definition TList.h:38
void Clear(Option_t *option="") override
Remove all objects from the list.
Definition TList.cxx:399
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
Definition TList.cxx:575
void Add(TObject *obj) override
Definition TList.h:81
TObject * Remove(TObject *obj) override
Remove object from the list.
Definition TList.cxx:819
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:656
void AddBefore(const TObject *before, TObject *obj) override
Insert object before object before in the list.
Definition TList.cxx:193
virtual TObjLink * FirstLink() const
Definition TList.h:102
void Add(TObject *obj) override
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
Definition TMap.cxx:53
TObject * FindObject(const char *keyname) const override
Check if a (key,value) pair exists with keyname as name of the key.
Definition TMap.cxx:214
void Clear(Option_t *option="") override
Remove all (key,value) pairs from the map.
Definition TMap.cxx:96
const THashTable * GetTable() const
Definition TMap.h:75
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
Mother of all ROOT objects.
Definition TObject.h:41
static TClass * Class()
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:543
virtual TClass * IsA() const
Definition TObject.h:246
const char * GetName() const override
Returns name of object.
Definition TPad.h:261
Class used by TMap to store (key,value) pairs.
Definition TMap.h:102
void SetValue(TObject *val)
Definition TMap.h:122
TObject * Value() const
Definition TMap.h:121
TObject * Key() const
Definition TMap.h:120
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:865
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
static void Terminate()
Close the global pad editor. Static method.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
virtual void Modified(Bool_t flag=1)=0
virtual TObject * Remove(TObject *obj, Bool_t modified=kTRUE)=0
virtual void Update()=0
static uint64_t sum(uint64_t i)
Definition Factory.cxx:2339