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//////////////////////////////////////////////////////////////////////////
14// //
15// TGedEditor //
16// //
17// The main class of ROOT graphics editor. It manages the appearance //
18// of objects editors according to the selected object in the canvas //
19// (an object became selected after the user click on it using the //
20// left-mouse button). //
21// //
22// Every object editor provides an object specific GUI and follows a //
23// simple naming convention: it has as a name the object class name //
24// concatinated with 'Editor' (e.g. for TGraph objects the object //
25// editor is TGraphEditor). //
26// //
27// The ROOT graphics editor can be activated by selecting 'Editor' //
28// from the View canvas menu, or SetLine/Fill/Text/MarkerAttributes //
29// from the context menu. The algorithm in use is simple: according to //
30// the selected object <obj> in the canvas it looks for a class name //
31// <obj>Editor. If a class with this name exists, the editor verifies //
32// that this class derives from the base editor class TGedFrame. //
33// It makes an instance of the object editor, scans all object base //
34// classes searching the corresponding object editors and makes an //
35// instance of the base class editor too. Once the object editor is in //
36// place, it sets the user interface elements according to the object //
37// state and is ready for interactions. When a new object of a //
38// different class is selected, a new object editor is loaded in the //
39// editor frame. The old one is cached in memory for potential reuse. //
40// //
41// Any created canvas will be shown with the editor if you have a //
42// .rootrc file in your working directory containing the the line: //
43// Canvas.ShowEditor: true //
44// //
45// An created object can be set as selected in a macro by: //
46// canvas->Selected(parent_pad_of_object, object, 1); //
47// The first parameter can be the canvas itself or the pad containing //
48// 'object'. //
49// //
50// Begin_Html //
51/*
52<img src="gif/TGedEditor.gif">
53*/
54//End_Html
55//////////////////////////////////////////////////////////////////////////
56
57#include "TGedEditor.h"
58#include "TCanvas.h"
59#include "TGCanvas.h"
60#include "TGTab.h"
61#include "TGedFrame.h"
62#include "TROOT.h"
63#include "TClass.h"
64#include "TBaseClass.h"
65#include "TVirtualX.h"
66
67
68class TGedTabInfo : public TObject {
69 // Helper class for managing visibility and order of created tabs.
70public:
71 TGTabElement *fElement;
72 TGCompositeFrame *fContainer;
73
74 TGedTabInfo(TGTabElement* el, TGCompositeFrame* f) :
75 fElement(el), fContainer(f) {}
76};
77
78
80
82
83////////////////////////////////////////////////////////////////////////////////
84/// Returns TGedEditor that currently creates TGedFrames.
85
87{
88 return fgFrameCreator;
89}
90
91////////////////////////////////////////////////////////////////////////////////
92/// Set the TGedEditor that currently creates TGedFrames.
93
95{
97}
98
99////////////////////////////////////////////////////////////////////////////////
100/// Constructor of graphics editor.
101
103 TGMainFrame(gClient->GetRoot(), width, height),
104 fCan (0),
105 fTab (0),
106 fTabContainer (0),
107 fModel (0),
108 fPad (0),
109 fCanvas (0),
110 fClass (0),
111 fGlobal (kTRUE)
112{
113 fCan = new TGCanvas(this, 170, 10, kFixedWidth);
115
116 fTab = new TGTab(fCan->GetViewPort(), 10, 10);
120
121 fTabContainer = GetEditorTab("Style");
122
123 gROOT->GetListOfCleanups()->Add(this);
124
125 SetCanvas(canvas);
126 if (fCanvas) {
128 if (ch)
129 Resize(GetWidth(), ch > 700 ? 700 : ch);
130 else
131 Resize(GetWidth(), fCanvas->GetWh()<450 ? 450 : fCanvas->GetWh() + 4);
132 } else {
133 Resize(width, height);
134 }
135
137 MapWindow();
138}
139
140////////////////////////////////////////////////////////////////////////////////
141/// Editor destructor.
142
144{
145 Hide();
146
147 if(fGlobal){
148 TQObject::Disconnect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)");
149 TQObject::Disconnect("TCanvas", "Closed()");
150 }
151
152 // delete class editors
153 TIter next(fFrameMap.GetTable());
154 TPair* pair;
155 while ((pair = (TPair*) next())) {
156 if (pair->Value() != 0) {
157 TGedFrame* frame = (TGedFrame*) pair->Value();
158 delete frame;
159 }
160 }
161
162 TGedTabInfo* ti;
163 TIter it1(&fCreatedTabs);
164 while ((ti = (TGedTabInfo*) it1())) {
165 fTab->AddFrame(ti->fElement,0);
166 fTab->AddFrame(ti->fContainer,0);
167 }
168
169 delete fTab;
170 delete ((TGFrameElement*)fList->First())->fLayout;
171 delete fCan;
172}
173
174////////////////////////////////////////////////////////////////////////////////
175/// Virtual method that is called on any change in the dependent frames.
176/// This implementation simply calls fPad Modified()/Update().
177
179{
180 if (fPad) {
181 fPad->Modified();
182 fPad->Update();
183 }
184}
185
186////////////////////////////////////////////////////////////////////////////////
187/// Find or create tab with name.
188
190{
191 return GetEditorTabInfo(name)->fContainer;
192}
193
194////////////////////////////////////////////////////////////////////////////////
195/// Find or create tab with name.
196
197TGedTabInfo* TGedEditor::GetEditorTabInfo(const char* name)
198{
199 // look in list of created tabs
200 if ( ! fCreatedTabs.IsEmpty()) {
201 TIter next(&fCreatedTabs);
202 TGedTabInfo* ti;
203 while ((ti = (TGedTabInfo *) next())) {
204 if (*ti->fElement->GetText() == name)
205 return ti;
206 }
207 }
208
209 // create tab
211
212 // remove created frame end tab element from the fTab frame
214 fTab->RemoveFrame(tc);
215 fTab->RemoveFrame(te);
216
217 // create a title frame for each tab
218 TGedFrame* nf = CreateNameFrame(tc, name);
219 if (nf) {
220 nf->SetGedEditor(this);
221 nf->SetModelClass(0);
222 tc->AddFrame(nf, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 2, 2));
223 }
224 // add to list of created tabs
225 TGedTabInfo* ti = new TGedTabInfo(te, tc);
226 fCreatedTabs.Add(ti);
227
228 return ti;
229}
230
231////////////////////////////////////////////////////////////////////////////////
232/// Called when closed via WM close button. Calls Hide().
233
235{
236 Hide();
237}
238
239////////////////////////////////////////////////////////////////////////////////
240/// Clears windows in editor tab.
241/// Unmap and withdraw currently shown frames and thus prepare for
242/// construction of a new class layout or destruction.
243
245{
246 TIter next(&fVisibleTabs);
247 TGedTabInfo* ti;
248 while ((ti = (TGedTabInfo*)next())) {
249 TGTabElement *te = ti->fElement;
250 TGCompositeFrame *tc = ti->fContainer;
251
252 fTab->RemoveFrame(te);
253 fTab->RemoveFrame(tc);
254
255 TIter frames(tc->GetList());
256 frames(); // skip name-frame
257 TGFrameElement* fr;
258 while ((fr = (TGFrameElement *) frames()) != 0) {
259 TGFrame *f = fr->fFrame;
260 tc->RemoveFrame(f);
261 f->UnmapWindow();
262 te->UnmapWindow();
263 tc->UnmapWindow();
264 }
266 }
267}
268
269////////////////////////////////////////////////////////////////////////////////
270/// Set editor global.
271
273{
274 fGlobal = global;
275 if (fGlobal) {
276 TQObject::Connect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)",
277 "TGedEditor", this, "GlobalSetModel(TVirtualPad *, TObject *, Int_t)");
278
279 TQObject::Connect("TCanvas", "Closed()",
280 "TGedEditor", this, "GlobalClosed()");
281 }
282}
283
284////////////////////////////////////////////////////////////////////////////////
285/// Delete global editor if no canvas exists.
286
288{
289 if (gROOT->GetListOfCanvases()->IsEmpty())
291}
292
293////////////////////////////////////////////////////////////////////////////////
294/// Set canvas to global editor.
295
297{
298 if ((ev != kButton1Down) || !IsMapped() ||
299 (obj && obj->InheritsFrom("TColorWheel")))
300 return;
301
302 TCanvas* can = pad->GetCanvas();
303 // Do nothing if canvas is the same as before or
304 // local editor of the canvas is active.
305 if (!can || (can == fCanvas || can->GetShowEditor()))
306 return;
307
308 Show();
309}
310
311////////////////////////////////////////////////////////////////////////////////
312/// Connect this editor to the Selected signal of canvas 'c'.
313
315{
316 c->Connect("Selected(TVirtualPad*,TObject*,Int_t)", "TGedEditor",
317 this, "SetModel(TVirtualPad*,TObject*,Int_t)");
318}
319
320////////////////////////////////////////////////////////////////////////////////
321/// Disconnect this editor from the Selected signal of fCanvas.
322
324{
325 if (fCanvas)
326 Disconnect(fCanvas, "Selected(TVirtualPad*,TObject*,Int_t)", this, "SetModel(TVirtualPad*,TObject*,Int_t)");
327}
328
329////////////////////////////////////////////////////////////////////////////////
330/// Change connection to another canvas.
331
333{
334 if (fCanvas == newcan) return;
335
337 fCanvas = newcan;
338
339 if (!newcan) return;
340
341 SetWindowName(Form("%s_Editor", fCanvas->GetName()));
343 if (fPad == 0) fPad = fCanvas;
345}
346
347////////////////////////////////////////////////////////////////////////////////
348/// Activate object editors according to the selected object.
349
351{
352 if ((event != kButton1Down) || (obj && obj->InheritsFrom("TColorWheel")))
353 return;
354
355 if (gPad && gPad->GetVirtCanvas()) gPad->GetVirtCanvas()->SetCursor(kWatch);
356 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
357
358 fPad = pad;
359 if (obj == 0) obj = fPad;
360
361 // keep selected by name
362 TGTabElement* seltab = fTab->GetCurrentTab();
363
364 Bool_t mapTabs = kFALSE;
365 if (fModel != obj || force) {
366 fModel = obj;
367 if (fModel == 0 || fModel->IsA() != fClass) {
369 mapTabs = kTRUE;
370 // add Sytle tab to list of visible tabs
372 if (fModel) {
373 fClass = fModel->IsA();
374 // build a list of editors
376 } else {
377 fClass = 0;
378 }
379
380 // add class editors to fTabContainer
381 TGedFrame* gfr;
382 TIter ngf(&fGedFrames);
383 while ((gfr = (TGedFrame*) ngf()))
385
386 fExclMap.Clear();
388
389 // add visible tabs in fTab
390 TIter next(&fVisibleTabs);
391 TGedTabInfo* ti;
392 while ((ti = (TGedTabInfo *) next())) {
393 fTab->AddFrame(ti->fElement,0);
394 fTab->AddFrame(ti->fContainer,0);
395 }
396 }
398 } else {
400 } // end fModel != obj
401
402 if (mapTabs) { // selected object is different class
403 TGedTabInfo* ti;
404 TIter next(&fVisibleTabs);
405 while ((ti = (TGedTabInfo *) next())) {
406 ti->fElement->MapWindow();
407 ti->fContainer->MapWindow();
408 }
409 if (seltab == 0 || fTab->SetTab(seltab->GetString(), kFALSE) == kFALSE)
410 fTab->SetTab(0, kFALSE);
411 }
412
413 if (fGlobal)
414 Layout();
415 else
416 ((TGMainFrame*)GetMainFrame())->Layout();
417
418 if (gPad && gPad->GetVirtCanvas()) gPad->GetVirtCanvas()->SetCursor(kPointer);
419 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kPointer));
420}
421
422////////////////////////////////////////////////////////////////////////////////
423/// Show editor.
424
426{
427 // gPad is setup properly in calling code for global and canvas editor.
428 if (gPad) SetCanvas(gPad->GetCanvas());
429
430 if (fCanvas && fGlobal) {
432
433 if (fCanvas->GetShowEditor())
435
441 if (!ch)
442 cy = cy + 20; // embeded canvas protection
443
444 Int_t gedx = 0, gedy = 0;
445
446 if (cw + GetWidth() > dw) {
447 gedx = cx + cw - GetWidth();
448 gedy = ch - GetHeight();
449 } else {
450 if (cx > GetWidth())
451 gedx = cx - GetWidth() - 20;
452 else
453 gedx = cx + cw + 10;
454 gedy = cy - 20;
455 }
456 MoveResize(gedx, gedy, GetWidth(), ch > 700 ? 700 : ch);
457 SetWMPosition(gedx, gedy);
458 } else if (fCanvas) {
460 }
461 MapWindow();
462 gVirtualX->RaiseWindow(GetId());
463
464 if (!gROOT->GetListOfCleanups()->FindObject(this))
465 gROOT->GetListOfCleanups()->Add(this);
466}
467
468////////////////////////////////////////////////////////////////////////////////
469/// Hide editor. The editor is put into non-active state.
470
472{
473 UnmapWindow();
475 fModel = 0; fClass = 0;
477 fCanvas = 0; fPad = 0;
478 gROOT->GetListOfCleanups()->Remove(this);
479}
480
481////////////////////////////////////////////////////////////////////////////////
482/// Remove references to fModel in case the fModel is being deleted.
483/// Deactivate attribute frames if they point to obj.
484
486{
487 if (obj == fPad) {
488 // printf("TGedEditor::RecursiveRemove: %s - pad deleted.\n", locglob);
490 return;
491 }
492
493 if (obj == fModel) {
494 // printf("TGedEditor::RecursiveRemove: %s - model deleted.\n", locglob);
496 return;
497 }
498}
499
500////////////////////////////////////////////////////////////////////////////////
501/// Searches for GedFrames for given class. In recursive mode look for class
502/// editor in its list of bases.
503
505{
506 TPair *pair = (TPair*) fFrameMap.FindObject(cl);
507 TClass *edClass = 0;
508 TGedFrame *frame = 0;
509
510 if (pair == 0) {
511 edClass = TClass::GetClass(Form("%sEditor", cl->GetName()));
512
513 if (edClass && edClass->InheritsFrom(TGedFrame::Class())) {
514 TGWindow *exroot = (TGWindow*) fClient->GetRoot();
516 fgFrameCreator = this;
517 frame = reinterpret_cast<TGedFrame*>(edClass->New());
518 frame->SetModelClass(cl);
519 fgFrameCreator = 0;
520 fClient->SetRoot(exroot);
521 }
522 fFrameMap.Add(cl, frame);
523 } else {
524 frame = (TGedFrame*)pair->Value();
525 }
526
527 Bool_t exclfr = kFALSE;
528 Bool_t exclbases = kFALSE;
529
530 if (frame) {
531 TPair* exclpair = (TPair*) fExclMap.FindObject(cl);
532 if (exclpair) {
533 exclfr = kTRUE;
534 exclbases = (exclpair->Value() != 0);
535 }
536
537 if (!exclfr && frame->AcceptModel(fModel)){
538 // handle extra tabs in the gedframe
539 if (frame->GetExtraTabs()) {
540 TIter next(frame->GetExtraTabs());
542 while ((subf = (TGedFrame::TGedSubFrame*)next())) {
543 // locate the composite frame on created tabs
544 TGedTabInfo* ti = GetEditorTabInfo(subf->fName);
545 ti->fContainer->AddFrame(subf->fFrame, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
546 if (fVisibleTabs.FindObject(ti) == 0)
547 fVisibleTabs.Add(ti);
548 }
549 }
550 InsertGedFrame(frame);
551 }
552 }
553
554 if (recurse && !exclbases) {
555 if (frame)
556 frame->ActivateBaseClassEditors(cl);
557 else
558 ActivateEditors(cl->GetListOfBases(), recurse);
559 }
560}
561
562////////////////////////////////////////////////////////////////////////////////
563/// Searches GedFrames for classes in the given list.
564
566{
567 TBaseClass *base;
568 TIter next(bcl);
569
570 while ((base = (TBaseClass*) next())) {
571 ActivateEditor(base->GetClassPointer(), recurse);
572 }
573}
574
575////////////////////////////////////////////////////////////////////////////////
576/// Exclude editor for class cl from current construction.
577/// If recurse is true the base-class editors of cl are also excluded.
578
580{
581 TPair* pair = (TPair*) fExclMap.FindObject(cl);
582 if (pair) {
583 if (recurse && pair->Value() == 0)
584 pair->SetValue((TObject*)(Long_t)1); // hack, reuse TObject as Bool_t
585 } else {
586 fExclMap.Add(cl, (TObject*)(Long_t)(recurse ? 1 : 0));
587 }
588}
589
590////////////////////////////////////////////////////////////////////////////////
591/// Insert GedFrame in fGedFrames list according to priorities.
592
594{
595 // printf("%s %s insert gedframe %s \n", fModel->GetName(), fModel->IsA()->GetName(),f->GetModelClass()->GetName());
597 if (lnk == 0) {
599 return;
600 }
601 TGedFrame* cf;
602 while (lnk) {
603 cf = (TGedFrame*) lnk->GetObject();
604 if (f->GetPriority() < cf->GetPriority()) {
605 fGedFrames.AddBefore(lnk, f);
606 return;
607 }
608 lnk = lnk->Next();
609 }
611}
612
613////////////////////////////////////////////////////////////////////////////////
614/// Call SetModel in class editors.
615
617{
618 TGFrameElement *el;
619
620 // Call SetModel on TGedNameFrames (first in the container list)
621 // and map extra-tabs.
622 TIter vistabs(&fVisibleTabs);
623 vistabs(); // skip Style tab
624 TGedTabInfo* ti;
625 while ((ti = (TGedTabInfo *) vistabs())) {
626 TIter fr(ti->fContainer->GetList());
627 el = (TGFrameElement*) fr();
628 if (el) {
629 ((TGedFrame*) el->fFrame)->SetModel(fModel);
630 if (objChanged) {
631 do {
632 el->fFrame->MapSubwindows();
633 el->fFrame->Layout();
634 el->fFrame->MapWindow();
635 } while((el = (TGFrameElement *) fr()));
636 }
637 }
638 ti->fContainer->Layout();
639 }
640
641 TIter next(fTabContainer->GetList());
642 while ((el = (TGFrameElement *) next())) {
643 if ((el->fFrame)->InheritsFrom(TGedFrame::Class())) {
644 if (objChanged) {
645 el->fFrame->MapSubwindows();
646 ((TGedFrame *)(el->fFrame))->SetModel(fModel);
647 el->fFrame->Layout();
648 el->fFrame->MapWindow();
649 } else {
650 ((TGedFrame *)(el->fFrame))->SetModel(fModel);
651 }
652 }
653 }
655}
656
657////////////////////////////////////////////////////////////////////////////////
658/// Virtual function for creation of top name-frame in each tab.
659
660TGedFrame* TGedEditor::CreateNameFrame(const TGWindow* parent, const char* /*tab_name*/)
661{
662 return new TGedNameFrame(parent);
663}
664
665////////////////////////////////////////////////////////////////////////////////
666/// Print contents of fFrameMap.
667
669{
670 printf("TGedEditor::PrintFrameStat()\n");
671 Int_t sum = 0;
672 TIter next(fFrameMap.GetTable());
673 TPair* pair;
674 while ((pair = (TPair*) next())) {
675 if (pair->Value() != 0) {
676 TClass* cl = (TClass*) pair->Key();
677 printf("TGedFrame created for %s \n", cl->GetName());
678 sum ++;
679 }
680 }
681 printf("SUMMARY: %d editors stored in the local map.\n", sum);
682}
@ kButton1Down
Definition Buttons.h:17
Cppyy::TCppType_t fClass
@ kFixedWidth
Definition GuiTypes.h:387
@ kWatch
Definition GuiTypes.h:375
@ kPointer
Definition GuiTypes.h:375
#define f(i)
Definition RSha256.hxx:104
#define c(i)
Definition RSha256.hxx:101
#define e(i)
Definition RSha256.hxx:103
unsigned int UInt_t
Definition RtypesCore.h:46
const Bool_t kFALSE
Definition RtypesCore.h:92
long Long_t
Definition RtypesCore.h:54
const Bool_t kTRUE
Definition RtypesCore.h:91
#define ClassImp(name)
Definition Rtypes.h:364
include TDocParser_001 C image html pict1_TDocParser_001 png width
#define gClient
Definition TGClient.h:166
@ kDeepCleanup
Definition TGFrame.h:50
@ kLHintsExpandY
Definition TGLayout.h:38
@ kLHintsNormal
Definition TGLayout.h:39
@ kLHintsTop
Definition TGLayout.h:34
@ kLHintsExpandX
Definition TGLayout.h:37
char name[80]
Definition TGX11.cxx:110
#define gROOT
Definition TROOT.h:406
char * Form(const char *fmt,...)
#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:160
TObject * GetClickSelected() const
Definition TCanvas.h:140
TVirtualPad * GetClickSelectedPad() const
Definition TCanvas.h:145
Int_t GetWindowTopX()
Returns current top x position of window on screen.
Definition TCanvas.cxx:1201
Int_t GetWindowTopY()
Returns current top y position of window on screen.
Definition TCanvas.cxx:1212
Bool_t GetShowEditor() const
Definition TCanvas.h:148
virtual void ToggleEditor()
Toggle editor.
Definition TCanvas.cxx:2468
TVirtualPad * GetSelectedPad() const override
Definition TCanvas.h:144
UInt_t GetWindowWidth() const
Definition TCanvas.h:159
UInt_t GetWh() const override
Definition TCanvas.h:162
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:80
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Definition TClass.cxx:4955
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition TClass.cxx:3613
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Definition TClass.cxx:4851
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:2957
virtual Bool_t IsEmpty() const
virtual void SetContainer(TGFrame *f)
Definition TGCanvas.h:232
TGViewPort * GetViewPort() const
Definition TGCanvas.h:227
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
virtual TList * GetList() const
Definition TGFrame.h:346
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1102
virtual void Layout()
Layout the elements of the composite frame.
Definition TGFrame.cxx:1242
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1057
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1149
TList * fList
Definition TGFrame.h:328
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1134
TGFrame * fFrame
Definition TGLayout.h:119
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:590
UInt_t GetHeight() const
Definition TGFrame.h:249
virtual void Layout()
Definition TGFrame.h:223
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition TGFrame.cxx:614
virtual void MapWindow()
map window
Definition TGFrame.h:228
UInt_t GetWidth() const
Definition TGFrame.h:248
virtual void MapSubwindows()
map sub windows
Definition TGFrame.h:224
virtual void UnmapWindow()
unmap window
Definition TGFrame.h:230
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition TGFrame.cxx:1840
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1749
TGClient * fClient
Definition TGObject.h:37
Handle_t GetId() const
Definition TGObject.h:47
const char * GetString() const
Definition TGTab.h:159
Definition TGTab.h:62
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition TGTab.cxx:614
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition TGTab.cxx:660
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:509
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition TGTab.cxx:343
TGTabElement * GetCurrentTab() const
Definition TGTab.h:111
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:82
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition TGWindow.cxx:151
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Definition TGWindow.cxx:294
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.
virtual void RecursiveRemove(TObject *obj)
Remove references to fModel in case the fModel is being deleted.
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
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
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 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
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.
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
TGCompositeFrame * fFrame
Definition TGedFrame.h:44
virtual void SetGedEditor(TGedEditor *ed)
Definition TGedFrame.h:87
virtual void ActivateBaseClassEditors(TClass *cl)
Provide list of editors for base-classes.
TList * GetExtraTabs()
Definition TGedFrame.h:77
void SetModelClass(TClass *mcl)
Definition TGedFrame.h:85
Int_t GetPriority()
Definition TGedFrame.h:76
virtual Bool_t AcceptModel(TObject *)
Definition TGedFrame.h:84
A doubly linked list.
Definition TList.h:44
virtual void Add(TObject *obj)
Definition TList.h:87
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition TList.cxx:822
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition TList.cxx:578
virtual TObjLink * FirstLink() const
Definition TList.h:108
virtual void AddBefore(const TObject *before, TObject *obj)
Insert object before object before in the list.
Definition TList.cxx:196
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:659
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition TList.cxx:402
void Add(TObject *obj)
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
Check if a (key,value) pair exists with keyname as name of the key.
Definition TMap.cxx:215
const THashTable * GetTable() const
Definition TMap.h:75
void Clear(Option_t *option="")
Remove all (key,value) pairs from the map.
Definition TMap.cxx:97
virtual const char * GetName() const
Returns name of object.
Definition TNamed.h:47
Mother of all ROOT objects.
Definition TObject.h:37
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:445
const char * GetName() const override
Returns name of object.
Definition TPad.h:254
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:866
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
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