TGedEditor.cxx

Go to the documentation of this file.
00001 // @(#)root/ged:$Id: TGedEditor.cxx 33756 2010-06-07 07:39:43Z bellenot $
00002 // Author: Marek Biskup, Ilka Antcheva 02/08/2003
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 
00013 //////////////////////////////////////////////////////////////////////////
00014 //                                                                      //
00015 // TGedEditor                                                           //
00016 //                                                                      //
00017 // The main class of ROOT graphics editor. It manages the appearance    //
00018 // of objects editors according to the selected object in the canvas    //
00019 // (an object became selected after the user click on it using the      //
00020 // left-mouse button).                                                  //
00021 //                                                                      //
00022 // Every object editor provides an object specific GUI and follows a    //
00023 // simple naming convention: it has as a name the object class name     //
00024 // concatinated with 'Editor' (e.g. for TGraph objects the object       //
00025 // editor is TGraphEditor).                                             //
00026 //                                                                      //
00027 // The ROOT graphics editor can be activated by selecting 'Editor'      //
00028 // from the View canvas menu, or SetLine/Fill/Text/MarkerAttributes     //
00029 // from the context menu. The algorithm in use is simple: according to  //
00030 // the selected object <obj> in the canvas it looks for a class name    //
00031 // <obj>Editor. If a class with this name exists, the editor verifies   //
00032 // that this class derives from the base editor class TGedFrame.        //
00033 // It makes an instance of the object editor, scans all object base     //
00034 // classes searching the corresponding object editors and makes an      //
00035 // instance of the base class editor too. Once the object editor is in  //
00036 // place, it sets the user interface elements according to the object   //
00037 // state and is ready for interactions. When a new object of a          //
00038 // different class is selected, a new object editor is loaded in the    //
00039 // editor frame. The old one is cached in memory for potential reuse.   //
00040 //                                                                      //
00041 // Any created canvas will be shown with the editor if you have a       //
00042 // .rootrc file in your working directory containing the the line:      //
00043 // Canvas.ShowEditor:      true                                         //
00044 //                                                                      //
00045 // An created object can be set as selected in a macro by:              //
00046 // canvas->Selected(parent_pad_of_object, object, 1);                   //
00047 // The first parameter can be the canvas itself or the pad containing   //
00048 // 'object'.                                                            //
00049 //                                                                      //
00050 // Begin_Html                                                           //
00051 /*
00052 <img src="gif/TGedEditor.gif">
00053 */
00054 //End_Html
00055 //////////////////////////////////////////////////////////////////////////
00056 
00057 #include "TGedEditor.h"
00058 #include "TCanvas.h"
00059 #include "TGCanvas.h"
00060 #include "TGTab.h"
00061 #include "TGedFrame.h"
00062 #include "TGLabel.h"
00063 #include "TROOT.h"
00064 #include "TClass.h"
00065 #include "TBaseClass.h"
00066 
00067 class TGedTabInfo : public TObject {
00068    // Helper class for managing visibility and order of created tabs.
00069 public:
00070    TGTabElement      *fElement;
00071    TGCompositeFrame  *fContainer;
00072 
00073    TGedTabInfo(TGTabElement* el, TGCompositeFrame* f) :
00074       fElement(el), fContainer(f) {}
00075 };
00076 
00077 
00078 ClassImp(TGedEditor)
00079 
00080 TGedEditor* TGedEditor::fgFrameCreator = 0;
00081 
00082 //______________________________________________________________________________
00083 TGedEditor* TGedEditor::GetFrameCreator()
00084 {
00085    // Returns TGedEditor that currently creates TGedFrames.
00086 
00087    return fgFrameCreator;
00088 }
00089 
00090 //______________________________________________________________________________
00091 void TGedEditor::SetFrameCreator(TGedEditor* e)
00092 {
00093    // Set the TGedEditor that currently creates TGedFrames.
00094 
00095    fgFrameCreator = e;
00096 }
00097 
00098 //______________________________________________________________________________
00099 TGedEditor::TGedEditor(TCanvas* canvas, UInt_t width, UInt_t height) :
00100    TGMainFrame(gClient->GetRoot(), width, height),
00101    fCan          (0),
00102    fTab          (0),
00103    fTabContainer (0),
00104    fModel        (0),
00105    fPad          (0),
00106    fCanvas       (0),
00107    fClass        (0),
00108    fGlobal       (kTRUE)
00109 {
00110    // Constructor of graphics editor.
00111 
00112    fCan = new TGCanvas(this, 170, 10, kFixedWidth);
00113    AddFrame(fCan, new TGLayoutHints(kLHintsExpandY | kLHintsExpandX));
00114 
00115    fTab = new TGTab(fCan->GetViewPort(), 10, 10);
00116    fTab->Associate(fCan);
00117    fTab->SetCleanup(kDeepCleanup);
00118    fCan->SetContainer(fTab);
00119 
00120    fTabContainer = GetEditorTab("Style");
00121 
00122    gROOT->GetListOfCleanups()->Add(this);
00123 
00124    SetCanvas(canvas);
00125    if (fCanvas) {
00126       UInt_t ch = fCanvas->GetWindowHeight();
00127       if (ch)
00128          Resize(GetWidth(), ch > 700 ? 700 : ch);
00129       else
00130          Resize(GetWidth(), fCanvas->GetWh()<450 ? 450 : fCanvas->GetWh() + 4);
00131    } else {
00132       Resize(width, height);
00133    }
00134 
00135    MapSubwindows();
00136    MapWindow();
00137 }
00138 
00139 //______________________________________________________________________________
00140 TGedEditor::~TGedEditor()
00141 {
00142    // Editor destructor.
00143 
00144    Hide();
00145 
00146    if(fGlobal){
00147       TQObject::Disconnect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)");
00148       TQObject::Disconnect("TCanvas", "Closed()");
00149    }
00150 
00151    // delete class editors
00152    TIter next(fFrameMap.GetTable());
00153    TPair* pair;
00154    while ((pair = (TPair*) next())) {
00155       if (pair->Value() != 0) {
00156          TGedFrame* frame  = (TGedFrame*) pair->Value();
00157          delete frame;
00158       }
00159    }
00160 
00161    TGedTabInfo* ti;
00162    TIter it1(&fCreatedTabs);
00163    while ((ti = (TGedTabInfo*) it1())) {
00164       fTab->AddFrame(ti->fElement,0);
00165       fTab->AddFrame(ti->fContainer,0);
00166    }
00167 
00168    delete fTab;
00169    delete ((TGFrameElement*)fList->First())->fLayout;
00170    delete fCan;
00171 }
00172 
00173 //______________________________________________________________________________
00174 void TGedEditor::Update(TGedFrame* /*frame*/)
00175 {
00176    // Virtual method that is called on any change in the dependent frames.
00177    // This implementation simply calls fPad Modified()/Update().
00178 
00179    if (fPad) {
00180       fPad->Modified();
00181       fPad->Update();
00182    }
00183 }
00184 
00185 //______________________________________________________________________________
00186 TGCompositeFrame* TGedEditor::GetEditorTab(const char* name)
00187 {
00188    // Find or create tab with name.
00189 
00190    return GetEditorTabInfo(name)->fContainer;
00191 }
00192 
00193 //______________________________________________________________________________
00194 TGedTabInfo* TGedEditor::GetEditorTabInfo(const char* name)
00195 {
00196    // Find or create tab with name.
00197 
00198    // look in list of created tabs
00199    if ( ! fCreatedTabs.IsEmpty()) {
00200       TIter next(&fCreatedTabs);
00201       TGedTabInfo* ti;
00202       while ((ti = (TGedTabInfo *) next())) {
00203          if (*ti->fElement->GetText() == name)
00204             return ti;
00205       }
00206    }
00207 
00208    // create tab
00209    TGCompositeFrame* tc = fTab->AddTab(new TGString(name));
00210 
00211    // remove created frame end tab element from the fTab frame
00212    TGTabElement *te = fTab->GetTabTab(fTab->GetNumberOfTabs() - 1);
00213    fTab->RemoveFrame(tc);
00214    fTab->RemoveFrame(te);
00215 
00216    // create a title frame for each tab
00217    TGedFrame* nf = CreateNameFrame(tc, name);
00218    nf->SetGedEditor(this);
00219    nf->SetModelClass(0);
00220    tc->AddFrame(nf, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 2, 2));
00221 
00222    // add to list of created tabs
00223    TGedTabInfo* ti = new TGedTabInfo(te, tc);
00224    fCreatedTabs.Add(ti);
00225 
00226    return ti;
00227 }
00228 
00229 //______________________________________________________________________________
00230 void TGedEditor::CloseWindow()
00231 {
00232    // Called when closed via WM close button. Calls Hide().
00233 
00234    Hide();
00235 }
00236 
00237 //______________________________________________________________________________
00238 void TGedEditor::ReinitWorkspace()
00239 {
00240    // Clears windows in editor tab.
00241    // Unmap and withdraw currently shown frames and thus prepare for
00242    // construction of a new class layout or destruction.
00243 
00244    TIter next(&fVisibleTabs);
00245    TGedTabInfo* ti;
00246    while ((ti = (TGedTabInfo*)next())) {
00247       TGTabElement     *te = ti->fElement;
00248       TGCompositeFrame *tc = ti->fContainer;
00249 
00250       fTab->RemoveFrame(te);
00251       fTab->RemoveFrame(tc);
00252 
00253       TIter frames(tc->GetList());
00254       frames(); // skip name-frame
00255       TGFrameElement* fr;
00256       while ((fr = (TGFrameElement *) frames()) != 0) {
00257          TGFrame *f = fr->fFrame;
00258          tc->RemoveFrame(f);
00259          f->UnmapWindow();
00260          te->UnmapWindow();
00261          tc->UnmapWindow();
00262       }
00263       fVisibleTabs.Remove(ti);
00264    }
00265 }
00266 
00267 //______________________________________________________________________________
00268 void TGedEditor::SetGlobal(Bool_t global)
00269 {
00270    // Set editor global.
00271 
00272    fGlobal = global;
00273    if (fGlobal) {
00274       TQObject::Connect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)",
00275                         "TGedEditor", this, "GlobalSetModel(TVirtualPad *, TObject *, Int_t)");
00276 
00277       TQObject::Connect("TCanvas", "Closed()",
00278                         "TGedEditor", this, "GlobalClosed()");
00279    }
00280 }
00281 
00282 //______________________________________________________________________________
00283 void TGedEditor::GlobalClosed()
00284 {
00285    // Delete global editor if no canvas exists.
00286 
00287    if (gROOT->GetListOfCanvases()->IsEmpty())
00288       TVirtualPadEditor::Terminate();
00289 }
00290 
00291 //______________________________________________________________________________
00292 void TGedEditor::GlobalSetModel(TVirtualPad *pad, TObject * obj, Int_t ev)
00293 {
00294    // Set canvas to global editor.
00295 
00296    if ((ev != kButton1Down) || !IsMapped() ||
00297        (obj && obj->InheritsFrom("TColorWheel")))
00298       return;
00299 
00300    TCanvas* can = pad->GetCanvas();
00301    // Do nothing if canvas is the same as before or
00302    // local editor of the canvas is active.
00303    if (can == fCanvas || can->GetShowEditor())
00304       return;
00305 
00306    Show();
00307 }
00308 
00309 //______________________________________________________________________________
00310 void TGedEditor::ConnectToCanvas(TCanvas *c)
00311 {
00312    // Connect this editor to the Selected signal of canvas 'c'.
00313 
00314    c->Connect("Selected(TVirtualPad*,TObject*,Int_t)", "TGedEditor",
00315               this, "SetModel(TVirtualPad*,TObject*,Int_t)");
00316 }
00317 
00318 //______________________________________________________________________________
00319 void TGedEditor::DisconnectFromCanvas()
00320 {
00321    // Disconnect this editor from the Selected signal of fCanvas.
00322 
00323    if (fCanvas)
00324       Disconnect(fCanvas, "Selected(TVirtualPad*,TObject*,Int_t)", this, "SetModel(TVirtualPad*,TObject*,Int_t)");
00325 }
00326 
00327 //______________________________________________________________________________
00328 void TGedEditor::SetCanvas(TCanvas *newcan)
00329 {
00330    // Change connection to another canvas.
00331 
00332    if (!newcan || (fCanvas == newcan)) return;
00333 
00334    DisconnectFromCanvas();
00335    fCanvas = newcan;
00336 
00337    SetWindowName(Form("%s_Editor", fCanvas->GetName()));
00338    fPad = fCanvas->GetSelectedPad();
00339    if (fPad == 0) fPad = fCanvas;
00340    ConnectToCanvas(fCanvas);
00341 }
00342 
00343 //______________________________________________________________________________
00344 void TGedEditor::SetModel(TVirtualPad* pad, TObject* obj, Int_t event)
00345 {
00346    // Activate object editors according to the selected object.
00347 
00348    if ((event != kButton1Down) || (obj && obj->InheritsFrom("TColorWheel")))
00349       return;
00350 
00351    if (gPad) gPad->GetVirtCanvas()->SetCursor(kWatch);
00352    gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
00353 
00354    fPad = pad;
00355    if (obj == 0) obj = fPad;
00356 
00357    // keep selected by name
00358    TGTabElement* seltab = fTab->GetCurrentTab();
00359 
00360    Bool_t mapTabs = kFALSE;
00361    if (fModel != obj) {
00362       fModel = obj;
00363       if (fModel == 0 || fModel->IsA() != fClass) {
00364          ReinitWorkspace();
00365          mapTabs = kTRUE;
00366          // add Sytle tab to list of visible tabs
00367          fVisibleTabs.Add(fCreatedTabs.First());
00368          if (fModel) {
00369             fClass = fModel->IsA();
00370             // build a list of editors
00371             ActivateEditor(fClass, kTRUE);
00372          } else {
00373             fClass = 0;
00374          }
00375 
00376          // add class editors to fTabContainer
00377          TGedFrame* gfr;
00378          TIter ngf(&fGedFrames);
00379          while ((gfr = (TGedFrame*) ngf()))
00380             fTabContainer->AddFrame(gfr, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 2, 2));
00381 
00382          fExclMap.Clear();
00383          fGedFrames.Clear();
00384 
00385          // add visible tabs in fTab
00386          TIter next(&fVisibleTabs);
00387          TGedTabInfo* ti;
00388          while ((ti = (TGedTabInfo *) next())) {
00389             fTab->AddFrame(ti->fElement,0);
00390             fTab->AddFrame(ti->fContainer,0);
00391          }
00392       }
00393       ConfigureGedFrames(kTRUE);
00394    } else {
00395       ConfigureGedFrames(kFALSE);
00396    } // end fModel != obj
00397 
00398    if (mapTabs) { // selected object is different class
00399       TGedTabInfo* ti;
00400       TIter next(&fVisibleTabs);
00401       while ((ti = (TGedTabInfo *) next())) {
00402          ti->fElement->MapWindow();
00403          ti->fContainer->MapWindow();
00404       }
00405       if (seltab == 0 || fTab->SetTab(seltab->GetString(), kFALSE) == kFALSE)
00406          fTab->SetTab(0, kFALSE);
00407    }
00408 
00409    if (fGlobal)
00410       Layout();
00411    else
00412       ((TGMainFrame*)GetMainFrame())->Layout();
00413 
00414    if (gPad) gPad->GetVirtCanvas()->SetCursor(kPointer);
00415    gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kPointer));
00416 }
00417 
00418 //______________________________________________________________________________
00419 void TGedEditor::Show()
00420 {
00421    // Show editor.
00422 
00423    // gPad is setup properly in calling code for global and canvas editor.
00424    if (gPad) SetCanvas(gPad->GetCanvas());
00425 
00426    if (fCanvas && fGlobal) {
00427       SetModel(fCanvas->GetClickSelectedPad(), fCanvas->GetClickSelected(), kButton1Down);
00428 
00429       if (fCanvas->GetShowEditor())
00430          fCanvas->ToggleEditor();
00431 
00432       UInt_t dw = fClient->GetDisplayWidth();
00433       UInt_t cw = fCanvas->GetWindowWidth();
00434       UInt_t ch = fCanvas->GetWindowHeight();
00435       UInt_t cx = (UInt_t)fCanvas->GetWindowTopX();
00436       UInt_t cy = (UInt_t)fCanvas->GetWindowTopY();
00437       if (!ch)
00438          cy = cy + 20;      // embeded canvas protection
00439 
00440       Int_t gedx = 0, gedy = 0;
00441 
00442       if (cw + GetWidth() > dw) {
00443          gedx = cx + cw - GetWidth();
00444          gedy = ch - GetHeight();
00445       } else {
00446          if (cx > GetWidth())
00447             gedx = cx - GetWidth() - 20;
00448          else
00449             gedx = cx + cw + 10;
00450          gedy = cy - 20;
00451       }
00452       MoveResize(gedx, gedy, GetWidth(), ch > 700 ? 700 : ch);
00453       SetWMPosition(gedx, gedy);
00454    } else if (fCanvas) {
00455       SetModel(fCanvas, fCanvas, kButton1Down);
00456    }
00457    MapWindow();
00458    gVirtualX->RaiseWindow(GetId());
00459 
00460    if (!gROOT->GetListOfCleanups()->FindObject(this))
00461       gROOT->GetListOfCleanups()->Add(this);
00462 }
00463 
00464 //______________________________________________________________________________
00465 void TGedEditor::Hide()
00466 {
00467    // Hide editor. The editor is put into non-active state.
00468 
00469    UnmapWindow();
00470    ReinitWorkspace();
00471    fModel = 0; fClass = 0;
00472    DisconnectFromCanvas();
00473    fCanvas = 0; fPad = 0;
00474    gROOT->GetListOfCleanups()->Remove(this);
00475 }
00476 
00477 //______________________________________________________________________________
00478 void TGedEditor::RecursiveRemove(TObject* obj)
00479 {
00480    // Remove references to fModel in case the fModel is being deleted.
00481    // Deactivate attribute frames if they point to obj.
00482 
00483    if (obj == fPad) {
00484       // printf("TGedEditor::RecursiveRemove: %s - pad deleted.\n", locglob);
00485       SetModel(fCanvas, fCanvas, kButton1Down);
00486       return;
00487    }
00488 
00489    if (obj == fModel) {
00490       // printf("TGedEditor::RecursiveRemove: %s - model deleted.\n", locglob);
00491       SetModel(fPad, fPad, kButton1Down);
00492       return;
00493    }
00494 }
00495 
00496 //______________________________________________________________________________
00497 void TGedEditor::ActivateEditor(TClass* cl, Bool_t recurse)
00498 {
00499    // Searches for GedFrames for given class. In recursive mode look for class
00500    // editor in its list of bases.
00501 
00502    TPair     *pair = (TPair*) fFrameMap.FindObject(cl);
00503    TClass    *edClass = 0;
00504    TGedFrame *frame = 0;
00505 
00506    if (pair == 0) {
00507       edClass = TClass::GetClass(Form("%sEditor", cl->GetName()));
00508 
00509       if (edClass && edClass->InheritsFrom(TGedFrame::Class())) {
00510          TGWindow *exroot = (TGWindow*) fClient->GetRoot();
00511          fClient->SetRoot(fTabContainer);
00512          fgFrameCreator = this;
00513          frame = reinterpret_cast<TGedFrame*>(edClass->New());
00514          frame->SetModelClass(cl);
00515          fgFrameCreator = 0;
00516          fClient->SetRoot(exroot);
00517       }
00518       fFrameMap.Add(cl, frame);
00519    } else {
00520       frame =  (TGedFrame*)pair->Value();
00521    }
00522 
00523    Bool_t exclfr    = kFALSE;
00524    Bool_t exclbases = kFALSE;
00525 
00526    if (frame) {
00527       TPair* exclpair = (TPair*) fExclMap.FindObject(cl);
00528       if (exclpair) {
00529          exclfr = kTRUE;
00530          exclbases = (exclpair->Value() != 0);
00531       }
00532 
00533       if (!exclfr && frame->AcceptModel(fModel)){
00534          // handle extra tabs in the gedframe
00535          if (frame->GetExtraTabs()) {
00536             TIter next(frame->GetExtraTabs());
00537             TGedFrame::TGedSubFrame* subf;
00538             while ((subf = (TGedFrame::TGedSubFrame*)next())) {
00539                // locate the composite frame on created tabs
00540                TGedTabInfo* ti = GetEditorTabInfo(subf->fName);
00541                ti->fContainer->AddFrame(subf->fFrame, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
00542                if (fVisibleTabs.FindObject(ti) == 0)
00543                   fVisibleTabs.Add(ti);
00544             }
00545          }
00546          InsertGedFrame(frame);
00547       }
00548    }
00549 
00550    if (recurse && !exclbases) {
00551       if (frame)
00552          frame->ActivateBaseClassEditors(cl);
00553       else
00554          ActivateEditors(cl->GetListOfBases(), recurse);
00555    }
00556 }
00557 
00558 //______________________________________________________________________________
00559 void TGedEditor::ActivateEditors(TList* bcl, Bool_t recurse)
00560 {
00561    // Searches GedFrames for classes in the given list.
00562 
00563    TBaseClass *base;
00564    TIter next(bcl);
00565 
00566    while ((base = (TBaseClass*) next())) {
00567       ActivateEditor(base->GetClassPointer(), recurse);
00568    }
00569 }
00570 
00571 //______________________________________________________________________________
00572 void  TGedEditor::ExcludeClassEditor(TClass* cl, Bool_t recurse)
00573 {
00574    // Exclude editor for class cl from current construction.
00575    // If recurse is true the base-class editors of cl are also excluded.
00576 
00577    TPair* pair = (TPair*) fExclMap.FindObject(cl);
00578    if (pair) {
00579       if (recurse && pair->Value() == 0)
00580          pair->SetValue((TObject*)(Long_t)1); // hack, reuse TObject as Bool_t
00581    } else {
00582       fExclMap.Add(cl, (TObject*)(Long_t)(recurse ? 1 : 0));
00583    }
00584 }
00585 
00586 //______________________________________________________________________________
00587 void TGedEditor::InsertGedFrame(TGedFrame* f)
00588 {
00589    // Insert GedFrame in fGedFrames list according to priorities.
00590 
00591    // printf("%s %s  insert gedframe %s \n", fModel->GetName(), fModel->IsA()->GetName(),f->GetModelClass()->GetName());
00592    TObjLink* lnk = fGedFrames.FirstLink();
00593    if (lnk == 0) {
00594       fGedFrames.Add(f);
00595       return;
00596    }
00597    TGedFrame* cf;
00598    while (lnk) {
00599       cf = (TGedFrame*) lnk->GetObject();
00600       if (f->GetPriority() < cf->GetPriority()) {
00601          fGedFrames.AddBefore(lnk, f);
00602          return;
00603       }
00604       lnk = lnk->Next();
00605    }
00606    fGedFrames.Add(f);
00607 }
00608 
00609 //______________________________________________________________________________
00610 void TGedEditor::ConfigureGedFrames(Bool_t objChanged)
00611 {
00612    // Call SetModel in class editors.
00613 
00614    TGFrameElement *el;
00615 
00616    // Call SetModel on TGedNameFrames (first in the container list)
00617    // and map extra-tabs.
00618    TIter vistabs(&fVisibleTabs);
00619    vistabs(); // skip Style tab
00620    TGedTabInfo* ti;
00621    while ((ti = (TGedTabInfo *) vistabs())) {
00622       TIter fr(ti->fContainer->GetList());
00623       el = (TGFrameElement*) fr();
00624       if (el) {
00625          ((TGedFrame*) el->fFrame)->SetModel(fModel);
00626          if (objChanged) {
00627             do {
00628                el->fFrame->MapSubwindows();
00629                el->fFrame->Layout();
00630                el->fFrame->MapWindow();
00631             } while((el = (TGFrameElement *) fr()));
00632          }
00633       }
00634       ti->fContainer->Layout();
00635    }
00636 
00637    TIter next(fTabContainer->GetList());
00638    while ((el = (TGFrameElement *) next())) {
00639       if ((el->fFrame)->InheritsFrom(TGedFrame::Class())) {
00640          if (objChanged) {
00641          el->fFrame->MapSubwindows();
00642          ((TGedFrame *)(el->fFrame))->SetModel(fModel);
00643          el->fFrame->Layout();
00644          el->fFrame->MapWindow();
00645          } else {
00646             ((TGedFrame *)(el->fFrame))->SetModel(fModel);
00647          }
00648       }
00649    }
00650    fTabContainer->Layout();
00651 }
00652 
00653 //______________________________________________________________________________
00654 TGedFrame* TGedEditor::CreateNameFrame(const TGWindow* parent, const char* /*tab_name*/)
00655 {
00656    // Virtual function for creation of top name-frame in each tab.
00657 
00658    return new TGedNameFrame(parent);
00659 }
00660 
00661 //______________________________________________________________________________
00662 void TGedEditor::PrintFrameStat()
00663 {
00664    // Print contents of fFrameMap.
00665 
00666    printf("TGedEditor::PrintFrameStat()\n");
00667    Int_t sum = 0;
00668    TIter next(fFrameMap.GetTable());
00669    TPair* pair;
00670    while ((pair = (TPair*) next())) {
00671       if (pair->Value() != 0) {
00672          TClass* cl  = (TClass*) pair->Key();
00673          printf("TGedFrame created for %s \n", cl->GetName());
00674          sum ++;
00675       }
00676    }
00677    printf("SUMMARY: %d editors stored in the local map.\n", sum);
00678 }

Generated on Tue Jul 5 14:19:46 2011 for ROOT_528-00b_version by  doxygen 1.5.1