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