Logo ROOT  
Reference Guide
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 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 {
128 Resize(width, height);
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*)(Long_t)1); // hack, reuse TObject as Bool_t
580 } else {
581 fExclMap.Add(cl, (TObject*)(Long_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
int Int_t
Definition: CPyCppyy.h:43
unsigned int UInt_t
Definition: CPyCppyy.h:44
long Long_t
Definition: CPyCppyy.h:50
void Class()
Definition: Class.C:29
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
const Bool_t kFALSE
Definition: RtypesCore.h:101
bool Bool_t
Definition: RtypesCore.h:63
const Bool_t kTRUE
Definition: RtypesCore.h:100
#define ClassImp(name)
Definition: Rtypes.h:364
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
#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
#define gROOT
Definition: TROOT.h:404
char * Form(const char *fmt,...)
#define gPad
Definition: TVirtualPad.h:287
#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.
Definition: TBaseClass.cxx:63
The Canvas class.
Definition: TCanvas.h:23
UInt_t GetWindowHeight() const
Definition: TCanvas.h:160
Int_t GetWindowTopX()
Returns current top x position of window on screen.
Definition: TCanvas.cxx:1199
TVirtualPad * GetClickSelectedPad() const
Definition: TCanvas.h:145
Int_t GetWindowTopY()
Returns current top y position of window on screen.
Definition: TCanvas.cxx:1210
Bool_t GetShowEditor() const
Definition: TCanvas.h:148
virtual void ToggleEditor()
Toggle editor.
Definition: TCanvas.cxx:2466
UInt_t GetWindowWidth() const
Definition: TCanvas.h:159
TVirtualPad * GetSelectedPad() const override
Definition: TCanvas.h:144
UInt_t GetWh() const override
Definition: TCanvas.h:162
TObject * GetClickSelected() const
Definition: TCanvas.h:140
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:4971
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition: TClass.cxx:3629
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Definition: TClass.cxx:4867
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:2955
virtual Bool_t IsEmpty() const
Definition: TCollection.h:186
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:226
void SetRoot(TGWindow *root=nullptr)
Sets the current root (i.e.
Definition: TGClient.cxx:246
UInt_t GetDisplayWidth() const
Get display width.
Definition: TGClient.cxx:264
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1257
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1072
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
virtual TList * GetList() const
Definition: TGFrame.h:310
TList * fList
container of frame elements
Definition: TGFrame.h:292
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
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
UInt_t GetHeight() const
Definition: TGFrame.h:225
virtual void Layout()
Definition: TGFrame.h:199
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:629
virtual void MapWindow()
map window
Definition: TGFrame.h:204
UInt_t GetWidth() const
Definition: TGFrame.h:224
virtual void MapSubwindows()
map sub windows
Definition: TGFrame.h:200
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:206
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:398
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition: TGFrame.cxx:1855
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1764
TGClient * fClient
Connection to display server.
Definition: TGObject.h:27
Handle_t GetId() const
Definition: TGObject.h:37
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 * GetCurrentTab() const
Definition: TGTab.h:96
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
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
virtual void SetCanvas(TCanvas *c)
Change connection to another canvas.
Definition: TGedEditor.cxx:327
virtual void Hide()
Hide editor. The editor is put into non-active state.
Definition: TGedEditor.cxx:466
void ConfigureGedFrames(Bool_t objChaged)
Call SetModel in class editors.
Definition: TGedEditor.cxx:611
TMap fFrameMap
global map of available frames
Definition: TGedEditor.h:37
void ReinitWorkspace()
Clears windows in editor tab.
Definition: TGedEditor.cxx:239
virtual void CloseWindow()
Called when closed via WM close button. Calls Hide().
Definition: TGedEditor.cxx:229
virtual TGCompositeFrame * GetEditorTab(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:184
virtual void RecursiveRemove(TObject *obj)
Remove references to fModel in case the fModel is being deleted.
Definition: TGedEditor.cxx:480
static TGedEditor * GetFrameCreator()
Returns TGedEditor that currently creates TGedFrames.
Definition: TGedEditor.cxx:81
TVirtualPad * fPad
selected pad
Definition: TGedEditor.h:49
void ActivateEditors(TList *bcl, Bool_t recurse)
Searches GedFrames for classes in the given list.
Definition: TGedEditor.cxx:560
TGCanvas * fCan
provides scroll bars
Definition: TGedEditor.h:41
virtual ~TGedEditor()
Editor destructor.
Definition: TGedEditor.cxx:138
void PrintFrameStat()
Print contents of fFrameMap.
Definition: TGedEditor.cxx:663
virtual void Show()
Show editor.
Definition: TGedEditor.cxx:420
virtual TGedTabInfo * GetEditorTabInfo(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:192
void InsertGedFrame(TGedFrame *f)
Insert GedFrame in fGedFrames list according to priorities.
Definition: TGedEditor.cxx:588
TGTab * fTab
tab widget holding the editor
Definition: TGedEditor.h:42
TMap fExclMap
map of excluded editors for selected model
Definition: TGedEditor.h:38
TList fVisibleTabs
list ofcurrently used tabs
Definition: TGedEditor.h:45
TCanvas * fCanvas
canvas related to the editor
Definition: TGedEditor.h:50
virtual void SetGlobal(Bool_t global)
Set editor global.
Definition: TGedEditor.cxx:267
TList fGedFrames
list visible of frames
Definition: TGedEditor.h:39
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event, Bool_t force=kFALSE)
Activate object editors according to the selected object.
Definition: TGedEditor.cxx:345
TGedEditor(const TGedEditor &)=delete
TGCompositeFrame * fTabContainer
main tab container
Definition: TGedEditor.h:46
TObject * fModel
selected object
Definition: TGedEditor.h:48
static void SetFrameCreator(TGedEditor *e)
Set the TGedEditor that currently creates TGedFrames.
Definition: TGedEditor.cxx:89
virtual void GlobalClosed()
Delete global editor if no canvas exists.
Definition: TGedEditor.cxx:282
void ExcludeClassEditor(TClass *cl, Bool_t recurse=kFALSE)
Exclude editor for class cl from current construction.
Definition: TGedEditor.cxx:574
void ActivateEditor(TClass *cl, Bool_t recurse)
Searches for GedFrames for given class.
Definition: TGedEditor.cxx:499
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
Definition: TGedEditor.cxx:318
TClass * fClass
class of the selected object
Definition: TGedEditor.h:51
virtual void Update(TGedFrame *frame=0)
Virtual method that is called on any change in the dependent frames.
Definition: TGedEditor.cxx:173
virtual TGedFrame * CreateNameFrame(const TGWindow *parent, const char *tab_name)
Virtual function for creation of top name-frame in each tab.
Definition: TGedEditor.cxx:655
virtual void GlobalSetModel(TVirtualPad *, TObject *, Int_t)
Set canvas to global editor.
Definition: TGedEditor.cxx:291
virtual void ConnectToCanvas(TCanvas *c)
Connect this editor to the Selected signal of canvas 'c'.
Definition: TGedEditor.cxx:309
Bool_t fGlobal
true if editor is global
Definition: TGedEditor.h:52
static TGedEditor * fgFrameCreator
Definition: TGedEditor.h:58
TList fCreatedTabs
list of created tabs
Definition: TGedEditor.h:44
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.
Definition: TGedFrame.cxx:167
void SetModelClass(TClass *mcl)
Definition: TGedFrame.h:78
Int_t GetPriority()
Definition: TGedFrame.h:69
TList * GetExtraTabs()
Definition: TGedFrame.h:70
virtual Bool_t AcceptModel(TObject *)
Definition: TGedFrame.h:77
TGedTabInfo(TGTabElement *el, TGCompositeFrame *f)
Definition: TGedEditor.cxx:69
TGTabElement * fElement
Definition: TGedEditor.cxx:66
TGCompositeFrame * fContainer
Definition: TGedEditor.cxx:67
A doubly linked list.
Definition: TList.h:44
virtual TObjLink * FirstLink() const
Definition: TList.h:108
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 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
TObject * Key() const
Definition: TMap.h:120
TObject * Value() const
Definition: TMap.h:121
void SetValue(TObject *val)
Definition: TMap.h:122
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=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1027
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 const std::string name("name")
static uint64_t sum(uint64_t i)
Definition: Factory.cxx:2345