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
70 fElement(el), fContainer(f) {}
71};
72
73
75
77
78////////////////////////////////////////////////////////////////////////////////
79/// Returns TGedEditor that currently creates TGedFrames.
80
82{
83 return fgFrameCreator;
84}
85
86////////////////////////////////////////////////////////////////////////////////
87/// Set the TGedEditor that currently creates TGedFrames.
88
90{
92}
93
94////////////////////////////////////////////////////////////////////////////////
95/// Constructor of graphics editor.
96
98 TGMainFrame(gClient->GetRoot(), width, height),
99 fCan (0),
100 fTab (0),
101 fTabContainer (0),
102 fModel (0),
103 fPad (0),
104 fCanvas (0),
105 fClass (0),
106 fGlobal (kTRUE)
107{
108 fCan = new TGCanvas(this, 170, 10, kFixedWidth);
110
111 fTab = new TGTab(fCan->GetViewPort(), 10, 10);
115
116 fTabContainer = GetEditorTab("Style");
117
118 gROOT->GetListOfCleanups()->Add(this);
119
120 SetCanvas(canvas);
121 if (fCanvas) {
123 if (ch)
124 Resize(GetWidth(), ch > 700 ? 700 : ch);
125 else
126 Resize(GetWidth(), fCanvas->GetWh()<450 ? 450 : fCanvas->GetWh() + 4);
127 } else {
129 }
130
132 MapWindow();
133}
134
135////////////////////////////////////////////////////////////////////////////////
136/// Editor destructor.
137
139{
140 Hide();
141
142 if(fGlobal){
143 TQObject::Disconnect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)");
144 TQObject::Disconnect("TCanvas", "Closed()");
145 }
146
147 // delete class editors
148 TIter next(fFrameMap.GetTable());
149 TPair* pair;
150 while ((pair = (TPair*) next())) {
151 if (pair->Value() != 0) {
152 TGedFrame* frame = (TGedFrame*) pair->Value();
153 delete frame;
154 }
155 }
156
157 TGedTabInfo* ti;
158 TIter it1(&fCreatedTabs);
159 while ((ti = (TGedTabInfo*) it1())) {
160 fTab->AddFrame(ti->fElement,0);
161 fTab->AddFrame(ti->fContainer,0);
162 }
163
164 delete fTab;
165 delete ((TGFrameElement*)fList->First())->fLayout;
166 delete fCan;
167}
168
169////////////////////////////////////////////////////////////////////////////////
170/// Virtual method that is called on any change in the dependent frames.
171/// This implementation simply calls fPad Modified()/Update().
172
174{
175 if (fPad) {
176 fPad->Modified();
177 fPad->Update();
178 }
179}
180
181////////////////////////////////////////////////////////////////////////////////
182/// Find or create tab with name.
183
185{
187}
188
189////////////////////////////////////////////////////////////////////////////////
190/// Find or create tab with name.
191
193{
194 // look in list of created tabs
195 if ( ! fCreatedTabs.IsEmpty()) {
196 TIter next(&fCreatedTabs);
197 TGedTabInfo* ti;
198 while ((ti = (TGedTabInfo *) next())) {
199 if (*ti->fElement->GetText() == name)
200 return ti;
201 }
202 }
203
204 // create tab
206
207 // remove created frame end tab element from the fTab frame
209 fTab->RemoveFrame(tc);
210 fTab->RemoveFrame(te);
211
212 // create a title frame for each tab
213 TGedFrame* nf = CreateNameFrame(tc, name);
214 if (nf) {
215 nf->SetGedEditor(this);
216 nf->SetModelClass(0);
217 tc->AddFrame(nf, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 2, 2));
218 }
219 // add to list of created tabs
220 TGedTabInfo* ti = new TGedTabInfo(te, tc);
221 fCreatedTabs.Add(ti);
222
223 return ti;
224}
225
226////////////////////////////////////////////////////////////////////////////////
227/// Called when closed via WM close button. Calls Hide().
228
230{
231 Hide();
232}
233
234////////////////////////////////////////////////////////////////////////////////
235/// Clears windows in editor tab.
236/// Unmap and withdraw currently shown frames and thus prepare for
237/// construction of a new class layout or destruction.
238
240{
241 TIter next(&fVisibleTabs);
242 TGedTabInfo* ti;
243 while ((ti = (TGedTabInfo*)next())) {
244 TGTabElement *te = ti->fElement;
246
247 fTab->RemoveFrame(te);
248 fTab->RemoveFrame(tc);
249
250 TIter frames(tc->GetList());
251 frames(); // skip name-frame
252 TGFrameElement* fr;
253 while ((fr = (TGFrameElement *) frames()) != 0) {
254 TGFrame *f = fr->fFrame;
255 tc->RemoveFrame(f);
256 f->UnmapWindow();
257 te->UnmapWindow();
258 tc->UnmapWindow();
259 }
261 }
262}
263
264////////////////////////////////////////////////////////////////////////////////
265/// Set editor global.
266
268{
269 fGlobal = global;
270 if (fGlobal) {
271 TQObject::Connect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)",
272 "TGedEditor", this, "GlobalSetModel(TVirtualPad *, TObject *, Int_t)");
273
274 TQObject::Connect("TCanvas", "Closed()",
275 "TGedEditor", this, "GlobalClosed()");
276 }
277}
278
279////////////////////////////////////////////////////////////////////////////////
280/// Delete global editor if no canvas exists.
281
283{
284 if (gROOT->GetListOfCanvases()->IsEmpty())
286}
287
288////////////////////////////////////////////////////////////////////////////////
289/// Set canvas to global editor.
290
292{
293 if ((ev != kButton1Down) || !IsMapped() ||
294 (obj && obj->InheritsFrom("TColorWheel")))
295 return;
296
297 TCanvas* can = pad->GetCanvas();
298 // Do nothing if canvas is the same as before or
299 // local editor of the canvas is active.
300 if (!can || (can == fCanvas || can->GetShowEditor()))
301 return;
302
303 Show();
304}
305
306////////////////////////////////////////////////////////////////////////////////
307/// Connect this editor to the Selected signal of canvas 'c'.
308
310{
311 c->Connect("Selected(TVirtualPad*,TObject*,Int_t)", "TGedEditor",
312 this, "SetModel(TVirtualPad*,TObject*,Int_t)");
313}
314
315////////////////////////////////////////////////////////////////////////////////
316/// Disconnect this editor from the Selected signal of fCanvas.
317
319{
320 if (fCanvas)
321 Disconnect(fCanvas, "Selected(TVirtualPad*,TObject*,Int_t)", this, "SetModel(TVirtualPad*,TObject*,Int_t)");
322}
323
324////////////////////////////////////////////////////////////////////////////////
325/// Change connection to another canvas.
326
328{
329 if (fCanvas == newcan) return;
330
332 fCanvas = newcan;
333
334 if (!newcan) return;
335
336 SetWindowName(Form("%s_Editor", fCanvas->GetName()));
338 if (fPad == 0) fPad = fCanvas;
340}
341
342////////////////////////////////////////////////////////////////////////////////
343/// Activate object editors according to the selected object.
344
346{
347 if ((event != kButton1Down) || (obj && obj->InheritsFrom("TColorWheel")))
348 return;
349
350 if (gPad && gPad->GetVirtCanvas()) gPad->GetVirtCanvas()->SetCursor(kWatch);
351 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
352
353 fPad = pad;
354 if (obj == 0) obj = fPad;
355
356 // keep selected by name
357 TGTabElement* seltab = fTab->GetCurrentTab();
358
359 Bool_t mapTabs = kFALSE;
360 if (fModel != obj || force) {
361 fModel = obj;
362 if (fModel == 0 || fModel->IsA() != fClass) {
364 mapTabs = kTRUE;
365 // add Style tab to list of visible tabs
367 if (fModel) {
368 fClass = fModel->IsA();
369 // build a list of editors
371 } else {
372 fClass = 0;
373 }
374
375 // add class editors to fTabContainer
376 TGedFrame* gfr;
377 TIter ngf(&fGedFrames);
378 while ((gfr = (TGedFrame*) ngf()))
380
381 fExclMap.Clear();
383
384 // add visible tabs in fTab
385 TIter next(&fVisibleTabs);
386 TGedTabInfo* ti;
387 while ((ti = (TGedTabInfo *) next())) {
388 fTab->AddFrame(ti->fElement,0);
389 fTab->AddFrame(ti->fContainer,0);
390 }
391 }
393 } else {
395 } // end fModel != obj
396
397 if (mapTabs) { // selected object is different class
398 TGedTabInfo* ti;
399 TIter next(&fVisibleTabs);
400 while ((ti = (TGedTabInfo *) next())) {
401 ti->fElement->MapWindow();
402 ti->fContainer->MapWindow();
403 }
404 if (seltab == 0 || fTab->SetTab(seltab->GetString(), kFALSE) == kFALSE)
405 fTab->SetTab(0, kFALSE);
406 }
407
408 if (fGlobal)
409 Layout();
410 else
411 ((TGMainFrame*)GetMainFrame())->Layout();
412
413 if (gPad && gPad->GetVirtCanvas()) gPad->GetVirtCanvas()->SetCursor(kPointer);
414 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kPointer));
415}
416
417////////////////////////////////////////////////////////////////////////////////
418/// Show editor.
419
421{
422 // gPad is setup properly in calling code for global and canvas editor.
423 if (gPad) SetCanvas(gPad->GetCanvas());
424
425 if (fCanvas && fGlobal) {
427
428 if (fCanvas->GetShowEditor())
430
436 if (!ch)
437 cy = cy + 20; // embedded canvas protection
438
439 Int_t gedx = 0, gedy = 0;
440
441 if (cw + GetWidth() > dw) {
442 gedx = cx + cw - GetWidth();
443 gedy = ch - GetHeight();
444 } else {
445 if (cx > GetWidth())
446 gedx = cx - GetWidth() - 20;
447 else
448 gedx = cx + cw + 10;
449 gedy = cy - 20;
450 }
451 MoveResize(gedx, gedy, GetWidth(), ch > 700 ? 700 : ch);
452 SetWMPosition(gedx, gedy);
453 } else if (fCanvas) {
455 }
456 MapWindow();
457 gVirtualX->RaiseWindow(GetId());
458
459 if (!gROOT->GetListOfCleanups()->FindObject(this))
460 gROOT->GetListOfCleanups()->Add(this);
461}
462
463////////////////////////////////////////////////////////////////////////////////
464/// Hide editor. The editor is put into non-active state.
465
467{
468 UnmapWindow();
470 fModel = 0; fClass = 0;
472 fCanvas = 0; fPad = 0;
473 gROOT->GetListOfCleanups()->Remove(this);
474}
475
476////////////////////////////////////////////////////////////////////////////////
477/// Remove references to fModel in case the fModel is being deleted.
478/// Deactivate attribute frames if they point to obj.
479
481{
482 if (obj == fPad) {
483 // printf("TGedEditor::RecursiveRemove: %s - pad deleted.\n", locglob);
485 return;
486 }
487
488 if (obj == fModel) {
489 // printf("TGedEditor::RecursiveRemove: %s - model deleted.\n", locglob);
491 return;
492 }
493}
494
495////////////////////////////////////////////////////////////////////////////////
496/// Searches for GedFrames for given class. In recursive mode look for class
497/// editor in its list of bases.
498
500{
501 TPair *pair = (TPair*) fFrameMap.FindObject(cl);
502 TClass *edClass = 0;
503 TGedFrame *frame = 0;
504
505 if (pair == 0) {
506 edClass = TClass::GetClass(Form("%sEditor", cl->GetName()));
507
508 if (edClass && edClass->InheritsFrom(TGedFrame::Class())) {
509 TGWindow *exroot = (TGWindow*) fClient->GetRoot();
511 fgFrameCreator = this;
512 frame = reinterpret_cast<TGedFrame*>(edClass->New());
513 frame->SetModelClass(cl);
514 fgFrameCreator = 0;
515 fClient->SetRoot(exroot);
516 }
517 fFrameMap.Add(cl, frame);
518 } else {
519 frame = (TGedFrame*)pair->Value();
520 }
521
522 Bool_t exclfr = kFALSE;
523 Bool_t exclbases = kFALSE;
524
525 if (frame) {
526 TPair* exclpair = (TPair*) fExclMap.FindObject(cl);
527 if (exclpair) {
528 exclfr = kTRUE;
529 exclbases = (exclpair->Value() != 0);
530 }
531
532 if (!exclfr && frame->AcceptModel(fModel)){
533 // handle extra tabs in the gedframe
534 if (frame->GetExtraTabs()) {
535 TIter next(frame->GetExtraTabs());
537 while ((subf = (TGedFrame::TGedSubFrame*)next())) {
538 // locate the composite frame on created tabs
541 if (fVisibleTabs.FindObject(ti) == 0)
542 fVisibleTabs.Add(ti);
543 }
544 }
545 InsertGedFrame(frame);
546 }
547 }
548
549 if (recurse && !exclbases) {
550 if (frame)
551 frame->ActivateBaseClassEditors(cl);
552 else
553 ActivateEditors(cl->GetListOfBases(), recurse);
554 }
555}
556
557////////////////////////////////////////////////////////////////////////////////
558/// Searches GedFrames for classes in the given list.
559
561{
562 TBaseClass *base;
563 TIter next(bcl);
564
565 while ((base = (TBaseClass*) next())) {
566 ActivateEditor(base->GetClassPointer(), recurse);
567 }
568}
569
570////////////////////////////////////////////////////////////////////////////////
571/// Exclude editor for class cl from current construction.
572/// If recurse is true the base-class editors of cl are also excluded.
573
575{
576 TPair* pair = (TPair*) fExclMap.FindObject(cl);
577 if (pair) {
578 if (recurse && pair->Value() == 0)
579 pair->SetValue((TObject*)(Longptr_t)1); // hack, reuse TObject as Bool_t
580 } else {
581 fExclMap.Add(cl, (TObject*)(Longptr_t)(recurse ? 1 : 0));
582 }
583}
584
585////////////////////////////////////////////////////////////////////////////////
586/// Insert GedFrame in fGedFrames list according to priorities.
587
589{
590 // printf("%s %s insert gedframe %s \n", fModel->GetName(), fModel->IsA()->GetName(),f->GetModelClass()->GetName());
592 if (lnk == 0) {
594 return;
595 }
596 TGedFrame* cf;
597 while (lnk) {
598 cf = (TGedFrame*) lnk->GetObject();
599 if (f->GetPriority() < cf->GetPriority()) {
600 fGedFrames.AddBefore(lnk, f);
601 return;
602 }
603 lnk = lnk->Next();
604 }
606}
607
608////////////////////////////////////////////////////////////////////////////////
609/// Call SetModel in class editors.
610
612{
613 TGFrameElement *el;
614
615 // Call SetModel on TGedNameFrames (first in the container list)
616 // and map extra-tabs.
617 TIter vistabs(&fVisibleTabs);
618 vistabs(); // skip Style tab
619 TGedTabInfo* ti;
620 while ((ti = (TGedTabInfo *) vistabs())) {
621 TIter fr(ti->fContainer->GetList());
622 el = (TGFrameElement*) fr();
623 if (el) {
624 ((TGedFrame*) el->fFrame)->SetModel(fModel);
625 if (objChanged) {
626 do {
627 el->fFrame->MapSubwindows();
628 el->fFrame->Layout();
629 el->fFrame->MapWindow();
630 } while((el = (TGFrameElement *) fr()));
631 }
632 }
633 ti->fContainer->Layout();
634 }
635
636 TIter next(fTabContainer->GetList());
637 while ((el = (TGFrameElement *) next())) {
638 if ((el->fFrame)->InheritsFrom(TGedFrame::Class())) {
639 if (objChanged) {
640 el->fFrame->MapSubwindows();
641 ((TGedFrame *)(el->fFrame))->SetModel(fModel);
642 el->fFrame->Layout();
643 el->fFrame->MapWindow();
644 } else {
645 ((TGedFrame *)(el->fFrame))->SetModel(fModel);
646 }
647 }
648 }
650}
651
652////////////////////////////////////////////////////////////////////////////////
653/// Virtual function for creation of top name-frame in each tab.
654
655TGedFrame* TGedEditor::CreateNameFrame(const TGWindow* parent, const char* /*tab_name*/)
656{
657 return new TGedNameFrame(parent);
658}
659
660////////////////////////////////////////////////////////////////////////////////
661/// Print contents of fFrameMap.
662
664{
665 printf("TGedEditor::PrintFrameStat()\n");
666 Int_t sum = 0;
667 TIter next(fFrameMap.GetTable());
668 TPair* pair;
669 while ((pair = (TPair*) next())) {
670 if (pair->Value() != 0) {
671 TClass* cl = (TClass*) pair->Key();
672 printf("TGedFrame created for %s \n", cl->GetName());
673 sum ++;
674 }
675 }
676 printf("SUMMARY: %d editors stored in the local map.\n", sum);
677}
@ 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
Definition RtypesCore.h:82
unsigned int UInt_t
Definition RtypesCore.h:46
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
#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:405
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
#define gPad
#define gVirtualX
Definition TVirtualX.h:338
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:161
TObject * GetClickSelected() const
Definition TCanvas.h:141
TVirtualPad * GetClickSelectedPad() const
Definition TCanvas.h:146
Int_t GetWindowTopX()
Returns current top x position of window on screen.
Definition TCanvas.cxx:1199
Int_t GetWindowTopY()
Returns current top y position of window on screen.
Definition TCanvas.cxx:1210
Bool_t GetShowEditor() const
Definition TCanvas.h:149
virtual void ToggleEditor()
Toggle editor.
Definition TCanvas.cxx:2432
TVirtualPad * GetSelectedPad() const override
Definition TCanvas.h:145
UInt_t GetWindowWidth() const
Definition TCanvas.h:160
UInt_t GetWh() const override
Definition TCanvas.h:163
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Definition TClass.cxx:4978
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition TClass.cxx:3636
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
Definition TClass.cxx:4874
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:2968
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:224
void SetRoot(TGWindow *root=nullptr)
Sets the current root (i.e.
Definition TGClient.cxx:244
UInt_t GetDisplayWidth() const
Get display width.
Definition TGClient.cxx:262
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual TList * GetList() const
Definition TGFrame.h:310
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1257
TList * fList
container of frame elements
Definition TGFrame.h:292
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1072
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1149
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:629
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
void MapWindow() override
map window
Definition TGFrame.h:204
void UnmapWindow() override
unmap window
Definition TGFrame.h:206
UInt_t GetHeight() const
Definition TGFrame.h:225
void MapSubwindows() override
map sub windows
Definition TGFrame.h:200
virtual void Layout()
Definition TGFrame.h:199
UInt_t GetWidth() const
Definition TGFrame.h:224
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:397
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1788
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
const char * GetString() const
Definition TGTab.h:146
const TGString * GetText() const
Definition TGTab.h:145
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:663
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition TGTab.cxx:709
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:558
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition TGTab.cxx:376
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:152
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Definition TGWindow.cxx:295
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.
virtual ~TGedEditor()
Editor destructor.
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'.
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
TGCompositeFrame * fFrame
Definition TGedFrame.h:37
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
virtual void SetGedEditor(TGedEditor *ed)
Definition TGedFrame.h:80
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
Int_t GetPriority()
Definition TGedFrame.h:69
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:402
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
Definition TList.cxx:578
void Add(TObject *obj) override
Definition TList.h:81
TObject * Remove(TObject *obj) override
Remove object from the list.
Definition TList.cxx:822
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:659
void AddBefore(const TObject *before, TObject *obj) override
Insert object before object before in the list.
Definition TList.cxx:196
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:54
TObject * FindObject(const char *keyname) const override
Check if a (key,value) pair exists with keyname as name of the key.
Definition TMap.cxx:215
void Clear(Option_t *option="") override
Remove all (key,value) pairs from the map.
Definition TMap.cxx:97
const THashTable * GetTable() const
Definition TMap.h:75
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
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:525
virtual TClass * IsA() const
Definition TObject.h:245
const char * GetName() const override
Returns name of object.
Definition TPad.h:258
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:869
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 void Update()=0
virtual TCanvas * GetCanvas() const =0
static uint64_t sum(uint64_t i)
Definition Factory.cxx:2345