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 
16 The main class of ROOT graphics editor. It manages the appearance
17 of objects editors according to the selected object in the canvas
18 (an object became selected after the user click on it using the
19 left-mouse button).
20 
21 Every object editor provides an object specific GUI and follows a
22 simple naming convention: it has as a name the object class name
23 concatenated with 'Editor' (e.g. for TGraph objects the object
24 editor is TGraphEditor).
25 
26 The ROOT graphics editor can be activated by selecting 'Editor'
27 from the View canvas menu, or SetLine/Fill/Text/MarkerAttributes
28 from the context menu. The algorithm in use is simple: according to
29 the 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
31 that this class derives from the base editor class TGedFrame.
32 It makes an instance of the object editor, scans all object base
33 classes searching the corresponding object editors and makes an
34 instance of the base class editor too. Once the object editor is in
35 place, it sets the user interface elements according to the object
36 state and is ready for interactions. When a new object of a
37 different class is selected, a new object editor is loaded in the
38 editor frame. The old one is cached in memory for potential reuse.
39 
40 Any created canvas will be shown with the editor if you have a
41 .rootrc file in your working directory containing the the line:
42 Canvas.ShowEditor: true
43 
44 An created object can be set as selected in a macro by:
45 canvas->Selected(parent_pad_of_object, object, 1);
46 The 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 
63 class TGedTabInfo : public TObject {
64  // Helper class for managing visibility and order of created tabs.
65 public:
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 {
91  fgFrameCreator = e;
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);
112  fTab->Associate(fCan);
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 
131  MapSubwindows();
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;
245  TGCompositeFrame *tc = ti->fContainer;
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  }
260  fVisibleTabs.Remove(ti);
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) {
363  ReinitWorkspace();
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();
382  fGedFrames.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 
432  UInt_t cw = fCanvas->GetWindowWidth();
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();
469  ReinitWorkspace();
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
539  TGedTabInfo* ti = GetEditorTabInfo(subf->fName);
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());
591  TObjLink* lnk = fGedFrames.FirstLink();
592  if (lnk == 0) {
593  fGedFrames.Add(f);
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  }
605  fGedFrames.Add(f);
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 
655 TGedFrame* 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 }
TGedEditor::GetEditorTabInfo
virtual TGedTabInfo * GetEditorTabInfo(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:192
TGTab::GetCurrentTab
TGTabElement * GetCurrentTab() const
Definition: TGTab.h:96
TPair
Class used by TMap to store (key,value) pairs.
Definition: TMap.h:102
TGedEditor::Show
virtual void Show()
Show editor.
Definition: TGedEditor.cxx:420
TGedEditor::fTab
TGTab * fTab
tab widget holding the editor
Definition: TGedEditor.h:42
c
#define c(i)
Definition: RSha256.hxx:101
TVirtualPadEditor::Terminate
static void Terminate()
Close the global pad editor. Static method.
Definition: TVirtualPadEditor.cxx:118
TGFrame::GetHeight
UInt_t GetHeight() const
Definition: TGFrame.h:225
TVirtualPad::GetCanvas
virtual TCanvas * GetCanvas() const =0
TGedEditor::TGedEditor
TGedEditor(const TGedEditor &)=delete
TQObject::Disconnect
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
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TGClient::GetDisplayWidth
UInt_t GetDisplayWidth() const
Get display width.
Definition: TGClient.cxx:264
e
#define e(i)
Definition: RSha256.hxx:103
kFixedWidth
@ kFixedWidth
Definition: GuiTypes.h:387
TGCompositeFrame::GetList
virtual TList * GetList() const
Definition: TGFrame.h:310
TGMainFrame
Defines top level windows that interact with the system Window Manager.
Definition: TGFrame.h:398
TGedEditor::RecursiveRemove
virtual void RecursiveRemove(TObject *obj)
Remove references to fModel in case the fModel is being deleted.
Definition: TGedEditor.cxx:480
TGedFrame::ActivateBaseClassEditors
virtual void ActivateBaseClassEditors(TClass *cl)
Provide list of editors for base-classes.
Definition: TGedFrame.cxx:167
TGedNameFrame
Definition: TGedFrame.h:86
f
#define f(i)
Definition: RSha256.hxx:104
TVirtualPad::Update
virtual void Update()=0
TGedFrame::GetPriority
Int_t GetPriority()
Definition: TGedFrame.h:69
TMap::Clear
void Clear(Option_t *option="")
Remove all (key,value) pairs from the map.
Definition: TMap.cxx:97
TGedEditor::SetModel
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::fCreatedTabs
TList fCreatedTabs
list of created tabs
Definition: TGedEditor.h:44
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TList::FindObject
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:578
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:27
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
TGedFrame::GetExtraTabs
TList * GetExtraTabs()
Definition: TGedFrame.h:70
TGedEditor::fGlobal
Bool_t fGlobal
true if editor is global
Definition: TGedEditor.h:52
sum
static uint64_t sum(uint64_t i)
Definition: Factory.cxx:2345
TGedEditor.h
TGedEditor::Hide
virtual void Hide()
Hide editor. The editor is put into non-active state.
Definition: TGedEditor.cxx:466
TBaseClass
Each class (see TClass) has a linked list of its base class(es).
Definition: TBaseClass.h:33
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TCanvas::GetClickSelected
TObject * GetClickSelected() const
Definition: TCanvas.h:140
TGedEditor::GlobalClosed
virtual void GlobalClosed()
Delete global editor if no canvas exists.
Definition: TGedEditor.cxx:282
TGedEditor::fClass
TClass * fClass
class of the selected object
Definition: TGedEditor.h:51
event
Definition: triangle.c:553
TGTabElement::GetText
const TGString * GetText() const
Definition: TGTab.h:145
TBaseClass.h
TClass.h
TGedFrame::SetModelClass
void SetModelClass(TClass *mcl)
Definition: TGedFrame.h:78
TGMainFrame::SetWindowName
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1764
TGedEditor::CloseWindow
virtual void CloseWindow()
Called when closed via WM close button. Calls Hide().
Definition: TGedEditor.cxx:229
TVirtualX.h
TCanvas::GetWh
UInt_t GetWh() const override
Definition: TCanvas.h:162
TGedFrame::SetGedEditor
virtual void SetGedEditor(TGedEditor *ed)
Definition: TGedFrame.h:80
TCanvas.h
TMap::Add
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
TBaseClass::GetClassPointer
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
Definition: TBaseClass.cxx:63
TGFrame
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
TGFrame::MapSubwindows
virtual void MapSubwindows()
map sub windows
Definition: TGFrame.h:200
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:37
TGedEditor::fTabContainer
TGCompositeFrame * fTabContainer
main tab container
Definition: TGedEditor.h:46
TGTabElement
Service classes of the tab widget.
Definition: TGTab.h:117
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
TGedEditor::ReinitWorkspace
void ReinitWorkspace()
Clears windows in editor tab.
Definition: TGedEditor.cxx:239
TGFrame::MapWindow
virtual void MapWindow()
map window
Definition: TGFrame.h:204
bool
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:224
TCanvas::GetClickSelectedPad
TVirtualPad * GetClickSelectedPad() const
Definition: TCanvas.h:145
TGCompositeFrame::fList
TList * fList
container of frame elements
Definition: TGFrame.h:292
TGFrameElement::fFrame
TGFrame * fFrame
Definition: TGLayout.h:112
kWatch
@ kWatch
Definition: GuiTypes.h:375
TPair::Key
TObject * Key() const
Definition: TMap.h:120
TROOT.h
gClient
#define gClient
Definition: TGClient.h:157
TList::First
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:659
TGedEditor::fVisibleTabs
TList fVisibleTabs
list ofcurrently used tabs
Definition: TGedEditor.h:45
TMap::GetTable
const THashTable * GetTable() const
Definition: TMap.h:75
TGedEditor::ConfigureGedFrames
void ConfigureGedFrames(Bool_t objChaged)
Call SetModel in class editors.
Definition: TGedEditor.cxx:611
TGedEditor::SetCanvas
virtual void SetCanvas(TCanvas *c)
Change connection to another canvas.
Definition: TGedEditor.cxx:327
TGedEditor::fModel
TObject * fModel
selected object
Definition: TGedEditor.h:48
TGClient::SetRoot
void SetRoot(TGWindow *root=nullptr)
Sets the current root (i.e.
Definition: TGClient.cxx:246
TClass::InheritsFrom
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Definition: TClass.cxx:4867
kLHintsNormal
@ kLHintsNormal
Definition: TGLayout.h:32
TList::FirstLink
virtual TObjLink * FirstLink() const
Definition: TList.h:108
TGedFrame.h
TClass::New
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
TCanvas::GetSelectedPad
TVirtualPad * GetSelectedPad() const override
Definition: TCanvas.h:144
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
TClass::GetListOfBases
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition: TClass.cxx:3629
TGTab::AddTab
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition: TGTab.cxx:376
TGWidget::Associate
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:72
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
TGedEditor::DisconnectFromCanvas
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
Definition: TGedEditor.cxx:318
TList::AddBefore
virtual void AddBefore(const TObject *before, TObject *obj)
Insert object before object before in the list.
Definition: TList.cxx:196
TPair::SetValue
void SetValue(TObject *val)
Definition: TMap.h:122
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TGTabElement::GetString
const char * GetString() const
Definition: TGTab.h:146
Long_t
long Long_t
Definition: RtypesCore.h:54
TMap::FindObject
TObject * FindObject(const char *keyname) const
Check if a (key,value) pair exists with keyname as name of the key.
Definition: TMap.cxx:215
TGedEditor::fgFrameCreator
static TGedEditor * fgFrameCreator
Definition: TGedEditor.h:58
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TGedEditor::GetEditorTab
virtual TGCompositeFrame * GetEditorTab(const char *name)
Find or create tab with name.
Definition: TGedEditor.cxx:184
TGTab
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
TPair::Value
TObject * Value() const
Definition: TMap.h:121
TGedEditor::ActivateEditor
void ActivateEditor(TClass *cl, Bool_t recurse)
Searches for GedFrames for given class.
Definition: TGedEditor.cxx:499
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TCanvas::GetWindowWidth
UInt_t GetWindowWidth() const
Definition: TCanvas.h:159
TGTab.h
TClass::GetClass
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
TCanvas::GetWindowHeight
UInt_t GetWindowHeight() const
Definition: TCanvas.h:160
kLHintsExpandY
@ kLHintsExpandY
Definition: TGLayout.h:31
TGTab::SetTab
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
TGedFrame::TGedSubFrame::fName
TString fName
Definition: TGedFrame.h:36
TGedEditor::~TGedEditor
virtual ~TGedEditor()
Editor destructor.
Definition: TGedEditor.cxx:138
TGCompositeFrame::RemoveFrame
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1149
TCollection::IsEmpty
virtual Bool_t IsEmpty() const
Definition: TCollection.h:186
kPointer
@ kPointer
Definition: GuiTypes.h:375
fClass
Cppyy::TCppType_t fClass
Definition: DeclareConverters.h:260
TGedEditor::ConnectToCanvas
virtual void ConnectToCanvas(TCanvas *c)
Connect this editor to the Selected signal of canvas 'c'.
Definition: TGedEditor.cxx:309
unsigned int
TGedEditor::fCanvas
TCanvas * fCanvas
canvas related to the editor
Definition: TGedEditor.h:50
TGedEditor::CreateNameFrame
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
TGedTabInfo::fContainer
TGCompositeFrame * fContainer
Definition: TGedEditor.cxx:67
TGedTabInfo::TGedTabInfo
TGedTabInfo(TGTabElement *el, TGCompositeFrame *f)
Definition: TGedEditor.cxx:69
TGedEditor::PrintFrameStat
void PrintFrameStat()
Print contents of fFrameMap.
Definition: TGedEditor.cxx:663
TGedFrame
Base frame for implementing GUI - a service class.
Definition: TGedFrame.h:27
TGedEditor::fCan
TGCanvas * fCan
provides scroll bars
Definition: TGedEditor.h:41
TGedEditor::ActivateEditors
void ActivateEditors(TList *bcl, Bool_t recurse)
Searches GedFrames for classes in the given list.
Definition: TGedEditor.cxx:560
kButton1Down
@ kButton1Down
Definition: Buttons.h:17
TGedEditor::fExclMap
TMap fExclMap
map of excluded editors for selected model
Definition: TGedEditor.h:38
TQObject::Connect
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
TVirtualPad
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
TGFrame::UnmapWindow
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:206
TGedEditor::SetGlobal
virtual void SetGlobal(Bool_t global)
Set editor global.
Definition: TGedEditor.cxx:267
TCanvas
The Canvas class.
Definition: TCanvas.h:23
TGedEditor::fFrameMap
TMap fFrameMap
global map of available frames
Definition: TGedEditor.h:37
TList::Remove
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:822
TGObject::fClient
TGClient * fClient
Connection to display server.
Definition: TGObject.h:27
TGedTabInfo
Definition: TGedEditor.cxx:63
TGFrame::MoveResize
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
TGedTabInfo::fElement
TGTabElement * fElement
Definition: TGedEditor.cxx:66
TGWindow::GetMainFrame
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition: TGWindow.cxx:152
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TGedEditor::ExcludeClassEditor
void ExcludeClassEditor(TClass *cl, Bool_t recurse=kFALSE)
Exclude editor for class cl from current construction.
Definition: TGedEditor.cxx:574
TGedEditor::InsertGedFrame
void InsertGedFrame(TGedFrame *f)
Insert GedFrame in fGedFrames list according to priorities.
Definition: TGedEditor.cxx:588
TGedFrame::TGedSubFrame::fFrame
TGCompositeFrame * fFrame
Definition: TGedFrame.h:37
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TList::Clear
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:402
name
char name[80]
Definition: TGX11.cxx:110
kDeepCleanup
@ kDeepCleanup
Definition: TGFrame.h:42
TGCanvas.h
TGCanvas::SetContainer
virtual void SetContainer(TGFrame *f)
Definition: TGCanvas.h:222
TGFrameElement
Definition: TGLayout.h:105
TVirtualPad::Modified
virtual void Modified(Bool_t flag=1)=0
gPad
#define gPad
Definition: TVirtualPad.h:287
TIter
Definition: TCollection.h:233
TGedEditor::fGedFrames
TList fGedFrames
list visible of frames
Definition: TGedEditor.h:39
TPad::GetName
const char * GetName() const override
Returns name of object.
Definition: TPad.h:254
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:30
TGCompositeFrame::SetCleanup
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1072
TCanvas::GetWindowTopX
Int_t GetWindowTopX()
Returns current top x position of window on screen.
Definition: TCanvas.cxx:1199
TGTab::GetNumberOfTabs
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition: TGTab.cxx:709
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
TGedEditor::GetFrameCreator
static TGedEditor * GetFrameCreator()
Returns TGedEditor that currently creates TGedFrames.
Definition: TGedEditor.cxx:81
TGFrame::Layout
virtual void Layout()
Definition: TGFrame.h:199
TGedFrame::AcceptModel
virtual Bool_t AcceptModel(TObject *)
Definition: TGedFrame.h:77
TGCanvas::GetViewPort
TGViewPort * GetViewPort() const
Definition: TGCanvas.h:217
Class
void Class()
Definition: Class.C:29
TGedEditor::SetFrameCreator
static void SetFrameCreator(TGedEditor *e)
Set the TGedEditor that currently creates TGedFrames.
Definition: TGedEditor.cxx:89
TGTab::GetTabTab
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition: TGTab.cxx:663
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGClient::GetRoot
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:226
TGCanvas
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition: TGCanvas.h:192
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
TGString
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition: TGString.h:20
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1257
TGedFrame::TGedSubFrame
Definition: TGedFrame.h:31
TGedEditor
Definition: TGedEditor.h:31
TCanvas::GetShowEditor
Bool_t GetShowEditor() const
Definition: TCanvas.h:148
TList
A doubly linked list.
Definition: TList.h:44
TGMainFrame::SetWMPosition
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition: TGFrame.cxx:1855
TGedEditor::Update
virtual void Update(TGedFrame *frame=0)
Virtual method that is called on any change in the dependent frames.
Definition: TGedEditor.cxx:173
gROOT
#define gROOT
Definition: TROOT.h:404
int
TGedEditor::GlobalSetModel
virtual void GlobalSetModel(TVirtualPad *, TObject *, Int_t)
Set canvas to global editor.
Definition: TGedEditor.cxx:291
TGedEditor::fPad
TVirtualPad * fPad
selected pad
Definition: TGedEditor.h:49
TCanvas::GetWindowTopY
Int_t GetWindowTopY()
Returns current top y position of window on screen.
Definition: TCanvas.cxx:1210
TCanvas::ToggleEditor
virtual void ToggleEditor()
Toggle editor.
Definition: TCanvas.cxx:2466
TGWindow::IsMapped
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Definition: TGWindow.cxx:295