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//////////////////////////////////////////////////////////////////////////
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 "TGLabel.h"
63#include "TROOT.h"
64#include "TClass.h"
65#include "TBaseClass.h"
66#include "TVirtualX.h"
67
68
69class TGedTabInfo : public TObject {
70 // Helper class for managing visibility and order of created tabs.
71public:
72 TGTabElement *fElement;
73 TGCompositeFrame *fContainer;
74
75 TGedTabInfo(TGTabElement* el, TGCompositeFrame* f) :
76 fElement(el), fContainer(f) {}
77};
78
79
81
83
84////////////////////////////////////////////////////////////////////////////////
85/// Returns TGedEditor that currently creates TGedFrames.
86
88{
89 return fgFrameCreator;
90}
91
92////////////////////////////////////////////////////////////////////////////////
93/// Set the TGedEditor that currently creates TGedFrames.
94
96{
98}
99
100////////////////////////////////////////////////////////////////////////////////
101/// Constructor of graphics editor.
102
104 TGMainFrame(gClient->GetRoot(), width, height),
105 fCan (0),
106 fTab (0),
107 fTabContainer (0),
108 fModel (0),
109 fPad (0),
110 fCanvas (0),
111 fClass (0),
112 fGlobal (kTRUE)
113{
114 fCan = new TGCanvas(this, 170, 10, kFixedWidth);
116
117 fTab = new TGTab(fCan->GetViewPort(), 10, 10);
121
122 fTabContainer = GetEditorTab("Style");
123
124 gROOT->GetListOfCleanups()->Add(this);
125
126 SetCanvas(canvas);
127 if (fCanvas) {
129 if (ch)
130 Resize(GetWidth(), ch > 700 ? 700 : ch);
131 else
132 Resize(GetWidth(), fCanvas->GetWh()<450 ? 450 : fCanvas->GetWh() + 4);
133 } else {
134 Resize(width, height);
135 }
136
138 MapWindow();
139}
140
141////////////////////////////////////////////////////////////////////////////////
142/// Editor destructor.
143
145{
146 Hide();
147
148 if(fGlobal){
149 TQObject::Disconnect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)");
150 TQObject::Disconnect("TCanvas", "Closed()");
151 }
152
153 // delete class editors
154 TIter next(fFrameMap.GetTable());
155 TPair* pair;
156 while ((pair = (TPair*) next())) {
157 if (pair->Value() != 0) {
158 TGedFrame* frame = (TGedFrame*) pair->Value();
159 delete frame;
160 }
161 }
162
163 TGedTabInfo* ti;
164 TIter it1(&fCreatedTabs);
165 while ((ti = (TGedTabInfo*) it1())) {
166 fTab->AddFrame(ti->fElement,0);
167 fTab->AddFrame(ti->fContainer,0);
168 }
169
170 delete fTab;
171 delete ((TGFrameElement*)fList->First())->fLayout;
172 delete fCan;
173}
174
175////////////////////////////////////////////////////////////////////////////////
176/// Virtual method that is called on any change in the dependent frames.
177/// This implementation simply calls fPad Modified()/Update().
178
180{
181 if (fPad) {
182 fPad->Modified();
183 fPad->Update();
184 }
185}
186
187////////////////////////////////////////////////////////////////////////////////
188/// Find or create tab with name.
189
191{
192 return GetEditorTabInfo(name)->fContainer;
193}
194
195////////////////////////////////////////////////////////////////////////////////
196/// Find or create tab with name.
197
198TGedTabInfo* TGedEditor::GetEditorTabInfo(const char* name)
199{
200 // look in list of created tabs
201 if ( ! fCreatedTabs.IsEmpty()) {
202 TIter next(&fCreatedTabs);
203 TGedTabInfo* ti;
204 while ((ti = (TGedTabInfo *) next())) {
205 if (*ti->fElement->GetText() == name)
206 return ti;
207 }
208 }
209
210 // create tab
212
213 // remove created frame end tab element from the fTab frame
215 fTab->RemoveFrame(tc);
216 fTab->RemoveFrame(te);
217
218 // create a title frame for each tab
219 TGedFrame* nf = CreateNameFrame(tc, name);
220 if (nf) {
221 nf->SetGedEditor(this);
222 nf->SetModelClass(0);
223 tc->AddFrame(nf, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 2, 2));
224 }
225 // add to list of created tabs
226 TGedTabInfo* ti = new TGedTabInfo(te, tc);
227 fCreatedTabs.Add(ti);
228
229 return ti;
230}
231
232////////////////////////////////////////////////////////////////////////////////
233/// Called when closed via WM close button. Calls Hide().
234
236{
237 Hide();
238}
239
240////////////////////////////////////////////////////////////////////////////////
241/// Clears windows in editor tab.
242/// Unmap and withdraw currently shown frames and thus prepare for
243/// construction of a new class layout or destruction.
244
246{
247 TIter next(&fVisibleTabs);
248 TGedTabInfo* ti;
249 while ((ti = (TGedTabInfo*)next())) {
250 TGTabElement *te = ti->fElement;
251 TGCompositeFrame *tc = ti->fContainer;
252
253 fTab->RemoveFrame(te);
254 fTab->RemoveFrame(tc);
255
256 TIter frames(tc->GetList());
257 frames(); // skip name-frame
258 TGFrameElement* fr;
259 while ((fr = (TGFrameElement *) frames()) != 0) {
260 TGFrame *f = fr->fFrame;
261 tc->RemoveFrame(f);
262 f->UnmapWindow();
263 te->UnmapWindow();
264 tc->UnmapWindow();
265 }
267 }
268}
269
270////////////////////////////////////////////////////////////////////////////////
271/// Set editor global.
272
274{
275 fGlobal = global;
276 if (fGlobal) {
277 TQObject::Connect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)",
278 "TGedEditor", this, "GlobalSetModel(TVirtualPad *, TObject *, Int_t)");
279
280 TQObject::Connect("TCanvas", "Closed()",
281 "TGedEditor", this, "GlobalClosed()");
282 }
283}
284
285////////////////////////////////////////////////////////////////////////////////
286/// Delete global editor if no canvas exists.
287
289{
290 if (gROOT->GetListOfCanvases()->IsEmpty())
292}
293
294////////////////////////////////////////////////////////////////////////////////
295/// Set canvas to global editor.
296
298{
299 if ((ev != kButton1Down) || !IsMapped() ||
300 (obj && obj->InheritsFrom("TColorWheel")))
301 return;
302
303 TCanvas* can = pad->GetCanvas();
304 // Do nothing if canvas is the same as before or
305 // local editor of the canvas is active.
306 if (!can || (can == fCanvas || can->GetShowEditor()))
307 return;
308
309 Show();
310}
311
312////////////////////////////////////////////////////////////////////////////////
313/// Connect this editor to the Selected signal of canvas 'c'.
314
316{
317 c->Connect("Selected(TVirtualPad*,TObject*,Int_t)", "TGedEditor",
318 this, "SetModel(TVirtualPad*,TObject*,Int_t)");
319}
320
321////////////////////////////////////////////////////////////////////////////////
322/// Disconnect this editor from the Selected signal of fCanvas.
323
325{
326 if (fCanvas)
327 Disconnect(fCanvas, "Selected(TVirtualPad*,TObject*,Int_t)", this, "SetModel(TVirtualPad*,TObject*,Int_t)");
328}
329
330////////////////////////////////////////////////////////////////////////////////
331/// Change connection to another canvas.
332
334{
335 if (fCanvas == newcan) return;
336
338 fCanvas = newcan;
339
340 if (!newcan) return;
341
342 SetWindowName(Form("%s_Editor", fCanvas->GetName()));
344 if (fPad == 0) fPad = fCanvas;
346}
347
348////////////////////////////////////////////////////////////////////////////////
349/// Activate object editors according to the selected object.
350
352{
353 if ((event != kButton1Down) || (obj && obj->InheritsFrom("TColorWheel")))
354 return;
355
356 if (gPad && gPad->GetVirtCanvas()) gPad->GetVirtCanvas()->SetCursor(kWatch);
357 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
358
359 fPad = pad;
360 if (obj == 0) obj = fPad;
361
362 // keep selected by name
363 TGTabElement* seltab = fTab->GetCurrentTab();
364
365 Bool_t mapTabs = kFALSE;
366 if (fModel != obj || force) {
367 fModel = obj;
368 if (fModel == 0 || fModel->IsA() != fClass) {
370 mapTabs = kTRUE;
371 // add Sytle tab to list of visible tabs
373 if (fModel) {
374 fClass = fModel->IsA();
375 // build a list of editors
377 } else {
378 fClass = 0;
379 }
380
381 // add class editors to fTabContainer
382 TGedFrame* gfr;
383 TIter ngf(&fGedFrames);
384 while ((gfr = (TGedFrame*) ngf()))
386
387 fExclMap.Clear();
389
390 // add visible tabs in fTab
391 TIter next(&fVisibleTabs);
392 TGedTabInfo* ti;
393 while ((ti = (TGedTabInfo *) next())) {
394 fTab->AddFrame(ti->fElement,0);
395 fTab->AddFrame(ti->fContainer,0);
396 }
397 }
399 } else {
401 } // end fModel != obj
402
403 if (mapTabs) { // selected object is different class
404 TGedTabInfo* ti;
405 TIter next(&fVisibleTabs);
406 while ((ti = (TGedTabInfo *) next())) {
407 ti->fElement->MapWindow();
408 ti->fContainer->MapWindow();
409 }
410 if (seltab == 0 || fTab->SetTab(seltab->GetString(), kFALSE) == kFALSE)
411 fTab->SetTab(0, kFALSE);
412 }
413
414 if (fGlobal)
415 Layout();
416 else
417 ((TGMainFrame*)GetMainFrame())->Layout();
418
419 if (gPad && gPad->GetVirtCanvas()) gPad->GetVirtCanvas()->SetCursor(kPointer);
420 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kPointer));
421}
422
423////////////////////////////////////////////////////////////////////////////////
424/// Show editor.
425
427{
428 // gPad is setup properly in calling code for global and canvas editor.
429 if (gPad) SetCanvas(gPad->GetCanvas());
430
431 if (fCanvas && fGlobal) {
433
434 if (fCanvas->GetShowEditor())
436
442 if (!ch)
443 cy = cy + 20; // embeded canvas protection
444
445 Int_t gedx = 0, gedy = 0;
446
447 if (cw + GetWidth() > dw) {
448 gedx = cx + cw - GetWidth();
449 gedy = ch - GetHeight();
450 } else {
451 if (cx > GetWidth())
452 gedx = cx - GetWidth() - 20;
453 else
454 gedx = cx + cw + 10;
455 gedy = cy - 20;
456 }
457 MoveResize(gedx, gedy, GetWidth(), ch > 700 ? 700 : ch);
458 SetWMPosition(gedx, gedy);
459 } else if (fCanvas) {
461 }
462 MapWindow();
463 gVirtualX->RaiseWindow(GetId());
464
465 if (!gROOT->GetListOfCleanups()->FindObject(this))
466 gROOT->GetListOfCleanups()->Add(this);
467}
468
469////////////////////////////////////////////////////////////////////////////////
470/// Hide editor. The editor is put into non-active state.
471
473{
474 UnmapWindow();
476 fModel = 0; fClass = 0;
478 fCanvas = 0; fPad = 0;
479 gROOT->GetListOfCleanups()->Remove(this);
480}
481
482////////////////////////////////////////////////////////////////////////////////
483/// Remove references to fModel in case the fModel is being deleted.
484/// Deactivate attribute frames if they point to obj.
485
487{
488 if (obj == fPad) {
489 // printf("TGedEditor::RecursiveRemove: %s - pad deleted.\n", locglob);
491 return;
492 }
493
494 if (obj == fModel) {
495 // printf("TGedEditor::RecursiveRemove: %s - model deleted.\n", locglob);
497 return;
498 }
499}
500
501////////////////////////////////////////////////////////////////////////////////
502/// Searches for GedFrames for given class. In recursive mode look for class
503/// editor in its list of bases.
504
506{
507 TPair *pair = (TPair*) fFrameMap.FindObject(cl);
508 TClass *edClass = 0;
509 TGedFrame *frame = 0;
510
511 if (pair == 0) {
512 edClass = TClass::GetClass(Form("%sEditor", cl->GetName()));
513
514 if (edClass && edClass->InheritsFrom(TGedFrame::Class())) {
515 TGWindow *exroot = (TGWindow*) fClient->GetRoot();
517 fgFrameCreator = this;
518 frame = reinterpret_cast<TGedFrame*>(edClass->New());
519 frame->SetModelClass(cl);
520 fgFrameCreator = 0;
521 fClient->SetRoot(exroot);
522 }
523 fFrameMap.Add(cl, frame);
524 } else {
525 frame = (TGedFrame*)pair->Value();
526 }
527
528 Bool_t exclfr = kFALSE;
529 Bool_t exclbases = kFALSE;
530
531 if (frame) {
532 TPair* exclpair = (TPair*) fExclMap.FindObject(cl);
533 if (exclpair) {
534 exclfr = kTRUE;
535 exclbases = (exclpair->Value() != 0);
536 }
537
538 if (!exclfr && frame->AcceptModel(fModel)){
539 // handle extra tabs in the gedframe
540 if (frame->GetExtraTabs()) {
541 TIter next(frame->GetExtraTabs());
543 while ((subf = (TGedFrame::TGedSubFrame*)next())) {
544 // locate the composite frame on created tabs
545 TGedTabInfo* ti = GetEditorTabInfo(subf->fName);
546 ti->fContainer->AddFrame(subf->fFrame, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
547 if (fVisibleTabs.FindObject(ti) == 0)
548 fVisibleTabs.Add(ti);
549 }
550 }
551 InsertGedFrame(frame);
552 }
553 }
554
555 if (recurse && !exclbases) {
556 if (frame)
557 frame->ActivateBaseClassEditors(cl);
558 else
559 ActivateEditors(cl->GetListOfBases(), recurse);
560 }
561}
562
563////////////////////////////////////////////////////////////////////////////////
564/// Searches GedFrames for classes in the given list.
565
567{
568 TBaseClass *base;
569 TIter next(bcl);
570
571 while ((base = (TBaseClass*) next())) {
572 ActivateEditor(base->GetClassPointer(), recurse);
573 }
574}
575
576////////////////////////////////////////////////////////////////////////////////
577/// Exclude editor for class cl from current construction.
578/// If recurse is true the base-class editors of cl are also excluded.
579
581{
582 TPair* pair = (TPair*) fExclMap.FindObject(cl);
583 if (pair) {
584 if (recurse && pair->Value() == 0)
585 pair->SetValue((TObject*)(Long_t)1); // hack, reuse TObject as Bool_t
586 } else {
587 fExclMap.Add(cl, (TObject*)(Long_t)(recurse ? 1 : 0));
588 }
589}
590
591////////////////////////////////////////////////////////////////////////////////
592/// Insert GedFrame in fGedFrames list according to priorities.
593
595{
596 // printf("%s %s insert gedframe %s \n", fModel->GetName(), fModel->IsA()->GetName(),f->GetModelClass()->GetName());
598 if (lnk == 0) {
600 return;
601 }
602 TGedFrame* cf;
603 while (lnk) {
604 cf = (TGedFrame*) lnk->GetObject();
605 if (f->GetPriority() < cf->GetPriority()) {
606 fGedFrames.AddBefore(lnk, f);
607 return;
608 }
609 lnk = lnk->Next();
610 }
612}
613
614////////////////////////////////////////////////////////////////////////////////
615/// Call SetModel in class editors.
616
618{
619 TGFrameElement *el;
620
621 // Call SetModel on TGedNameFrames (first in the container list)
622 // and map extra-tabs.
623 TIter vistabs(&fVisibleTabs);
624 vistabs(); // skip Style tab
625 TGedTabInfo* ti;
626 while ((ti = (TGedTabInfo *) vistabs())) {
627 TIter fr(ti->fContainer->GetList());
628 el = (TGFrameElement*) fr();
629 if (el) {
630 ((TGedFrame*) el->fFrame)->SetModel(fModel);
631 if (objChanged) {
632 do {
633 el->fFrame->MapSubwindows();
634 el->fFrame->Layout();
635 el->fFrame->MapWindow();
636 } while((el = (TGFrameElement *) fr()));
637 }
638 }
639 ti->fContainer->Layout();
640 }
641
642 TIter next(fTabContainer->GetList());
643 while ((el = (TGFrameElement *) next())) {
644 if ((el->fFrame)->InheritsFrom(TGedFrame::Class())) {
645 if (objChanged) {
646 el->fFrame->MapSubwindows();
647 ((TGedFrame *)(el->fFrame))->SetModel(fModel);
648 el->fFrame->Layout();
649 el->fFrame->MapWindow();
650 } else {
651 ((TGedFrame *)(el->fFrame))->SetModel(fModel);
652 }
653 }
654 }
656}
657
658////////////////////////////////////////////////////////////////////////////////
659/// Virtual function for creation of top name-frame in each tab.
660
661TGedFrame* TGedEditor::CreateNameFrame(const TGWindow* parent, const char* /*tab_name*/)
662{
663 return new TGedNameFrame(parent);
664}
665
666////////////////////////////////////////////////////////////////////////////////
667/// Print contents of fFrameMap.
668
670{
671 printf("TGedEditor::PrintFrameStat()\n");
672 Int_t sum = 0;
673 TIter next(fFrameMap.GetTable());
674 TPair* pair;
675 while ((pair = (TPair*) next())) {
676 if (pair->Value() != 0) {
677 TClass* cl = (TClass*) pair->Key();
678 printf("TGedFrame created for %s \n", cl->GetName());
679 sum ++;
680 }
681 }
682 printf("SUMMARY: %d editors stored in the local map.\n", sum);
683}
@ kButton1Down
Definition: Buttons.h:17
void Class()
Definition: Class.C:29
Cppyy::TCppType_t fClass
@ kFixedWidth
Definition: GuiTypes.h:387
@ kWatch
Definition: GuiTypes.h:374
@ kPointer
Definition: GuiTypes.h:374
#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:44
const Bool_t kFALSE
Definition: RtypesCore.h:90
long Long_t
Definition: RtypesCore.h:52
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
#define gClient
Definition: TGClient.h:166
@ kDeepCleanup
Definition: TGFrame.h:51
@ 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:109
#define gROOT
Definition: TROOT.h:406
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:27
UInt_t GetWindowHeight() const
Definition: TCanvas.h:164
TObject * GetClickSelected() const
Definition: TCanvas.h:144
TVirtualPad * GetClickSelectedPad() const
Definition: TCanvas.h:149
UInt_t GetWh() const
Get Wh.
Definition: TCanvas.h:166
Int_t GetWindowTopX()
Returns current top x position of window on screen.
Definition: TCanvas.cxx:1186
Int_t GetWindowTopY()
Returns current top y position of window on screen.
Definition: TCanvas.cxx:1197
Bool_t GetShowEditor() const
Definition: TCanvas.h:152
virtual void ToggleEditor()
Toggle editor.
Definition: TCanvas.cxx:2397
TVirtualPad * GetSelectedPad() const
Definition: TCanvas.h:148
UInt_t GetWindowWidth() const
Definition: TCanvas.h:163
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:4941
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition: TClass.cxx:3604
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Definition: TClass.cxx:4837
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:2948
virtual Bool_t IsEmpty() const
Definition: TCollection.h:186
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:224
void SetRoot(TGWindow *root=0)
Sets the current root (i.e.
Definition: TGClient.cxx:244
UInt_t GetDisplayWidth() const
Get display width.
Definition: TGClient.cxx:262
virtual TList * GetList() const
Definition: TGFrame.h:347
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1056
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
TList * fList
Definition: TGFrame.h:329
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1133
TGFrame * fFrame
Definition: TGLayout.h:119
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
UInt_t GetHeight() const
Definition: TGFrame.h:250
virtual void Layout()
Definition: TGFrame.h:224
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:613
virtual void MapWindow()
map window
Definition: TGFrame.h:229
UInt_t GetWidth() const
Definition: TGFrame.h:249
virtual void MapSubwindows()
map sub windows
Definition: TGFrame.h:225
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition: TGFrame.cxx:1839
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1748
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:613
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition: TGTab.cxx:659
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:508
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition: TGTab.cxx:342
TGTabElement * GetCurrentTab() const
Definition: TGTab.h:111
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition: TGWindow.cxx:142
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Definition: TGWindow.cxx:285
virtual void SetCanvas(TCanvas *c)
Change connection to another canvas.
Definition: TGedEditor.cxx:333
virtual void Hide()
Hide editor. The editor is put into non-active state.
Definition: TGedEditor.cxx:472
void ConfigureGedFrames(Bool_t objChaged)
Call SetModel in class editors.
Definition: TGedEditor.cxx:617
TMap fFrameMap
Definition: TGedEditor.h:48
void ReinitWorkspace()
Clears windows in editor tab.
Definition: TGedEditor.cxx:245
TGedEditor(const TGedEditor &)
virtual void CloseWindow()
Called when closed via WM close button. Calls Hide().
Definition: TGedEditor.cxx:235
virtual TGCompositeFrame * GetEditorTab(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:190
virtual void RecursiveRemove(TObject *obj)
Remove references to fModel in case the fModel is being deleted.
Definition: TGedEditor.cxx:486
static TGedEditor * GetFrameCreator()
Returns TGedEditor that currently creates TGedFrames.
Definition: TGedEditor.cxx:87
TVirtualPad * fPad
Definition: TGedEditor.h:60
void ActivateEditors(TList *bcl, Bool_t recurse)
Searches GedFrames for classes in the given list.
Definition: TGedEditor.cxx:566
TGCanvas * fCan
Definition: TGedEditor.h:52
virtual ~TGedEditor()
Editor destructor.
Definition: TGedEditor.cxx:144
void PrintFrameStat()
Print contents of fFrameMap.
Definition: TGedEditor.cxx:669
virtual void Show()
Show editor.
Definition: TGedEditor.cxx:426
virtual TGedTabInfo * GetEditorTabInfo(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:198
void InsertGedFrame(TGedFrame *f)
Insert GedFrame in fGedFrames list according to priorities.
Definition: TGedEditor.cxx:594
TGTab * fTab
Definition: TGedEditor.h:53
TMap fExclMap
Definition: TGedEditor.h:49
TList fVisibleTabs
Definition: TGedEditor.h:56
TCanvas * fCanvas
Definition: TGedEditor.h:61
virtual void SetGlobal(Bool_t global)
Set editor global.
Definition: TGedEditor.cxx:273
TList fGedFrames
Definition: TGedEditor.h:50
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event, Bool_t force=kFALSE)
Activate object editors according to the selected object.
Definition: TGedEditor.cxx:351
TGCompositeFrame * fTabContainer
Definition: TGedEditor.h:57
TObject * fModel
Definition: TGedEditor.h:59
static void SetFrameCreator(TGedEditor *e)
Set the TGedEditor that currently creates TGedFrames.
Definition: TGedEditor.cxx:95
virtual void GlobalClosed()
Delete global editor if no canvas exists.
Definition: TGedEditor.cxx:288
void ExcludeClassEditor(TClass *cl, Bool_t recurse=kFALSE)
Exclude editor for class cl from current construction.
Definition: TGedEditor.cxx:580
void ActivateEditor(TClass *cl, Bool_t recurse)
Searches for GedFrames for given class.
Definition: TGedEditor.cxx:505
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
Definition: TGedEditor.cxx:324
TClass * fClass
Definition: TGedEditor.h:62
virtual void Update(TGedFrame *frame=0)
Virtual method that is called on any change in the dependent frames.
Definition: TGedEditor.cxx:179
virtual TGedFrame * CreateNameFrame(const TGWindow *parent, const char *tab_name)
Virtual function for creation of top name-frame in each tab.
Definition: TGedEditor.cxx:661
virtual void GlobalSetModel(TVirtualPad *, TObject *, Int_t)
Set canvas to global editor.
Definition: TGedEditor.cxx:297
virtual void ConnectToCanvas(TCanvas *c)
Connect this editor to the Selected signal of canvas 'c'.
Definition: TGedEditor.cxx:315
Bool_t fGlobal
Definition: TGedEditor.h:63
static TGedEditor * fgFrameCreator
Definition: TGedEditor.h:69
TList fCreatedTabs
Definition: TGedEditor.h:55
TGCompositeFrame * fFrame
Definition: TGedFrame.h:43
virtual void SetGedEditor(TGedEditor *ed)
Definition: TGedFrame.h:86
virtual void ActivateBaseClassEditors(TClass *cl)
Provide list of editors for base-classes.
Definition: TGedFrame.cxx:168
TList * GetExtraTabs()
Definition: TGedFrame.h:76
void SetModelClass(TClass *mcl)
Definition: TGedFrame.h:84
Int_t GetPriority()
Definition: TGedFrame.h:75
virtual Bool_t AcceptModel(TObject *)
Definition: TGedFrame.h:83
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:821
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:577
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:195
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:401
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:443
const char * GetName() const
Returns name of object.
Definition: TPad.h:257
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.
Definition: TQObject.cxx:1024
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 long int sum(long int i)
Definition: Factory.cxx:2275