TGeoGedFrame.cxx

Go to the documentation of this file.
00001 // @(#)root/geombuilder:$Id: TGeoGedFrame.cxx 21494 2007-12-19 15:50:40Z brun $
00002 // Author: Matevz Tadel   25/09/2006
00003 
00004 //______________________________________________________________________________
00005 //                                                                      //
00006 //  TGeoGedFrame                                                        //
00007 //                                                                      //
00008 //  Common base class for geombuilder editors.                          //
00009 //                                                                      //
00010 //______________________________________________________________________________
00011 
00012 #include "TGeoGedFrame.h"
00013 #include "TGeoTabManager.h"
00014 #include "TGedEditor.h"
00015 #include "TGTab.h"
00016 #include "TVirtualPad.h"
00017 
00018 ClassImp(TGeoGedFrame)
00019 
00020 //______________________________________________________________________________
00021 TGeoGedFrame::TGeoGedFrame(const TGWindow *p, Int_t width, Int_t height,
00022                            UInt_t options, Pixel_t back) :
00023   TGedFrame(p, width, height, options, back),
00024   fTab(0), fTabMgr(0), fPad(0)
00025 {
00026 // Constructor.
00027    fTab = fGedEditor->GetTab();
00028    fPad = fGedEditor->GetPad();
00029    fTabMgr = TGeoTabManager::GetMakeTabManager(fGedEditor);
00030 }
00031 
00032 //______________________________________________________________________________
00033 void TGeoGedFrame::SetActive(Bool_t active)
00034 {
00035    // Set active GUI attribute frames related to the selected object.
00036 
00037    if (active)
00038       ((TGCompositeFrame*)GetParent())->ShowFrame(this);
00039    else
00040       ((TGCompositeFrame*)GetParent())->HideFrame(this);
00041 
00042 // no need to call for every single editor Layout of TGMainFrame
00043 //   ((TGMainFrame*)GetMainFrame())->Layout();
00044 
00045    // to avoid that the user changes options on a deactivated Tab
00046    if (fTab->IsEnabled(fTab->GetCurrent()))
00047       fTab->SetTab(fTab->GetCurrent());
00048    else
00049       fTab->SetTab(0);
00050 }
00051 
00052 //______________________________________________________________________________
00053 void TGeoGedFrame::Update()
00054 {
00055    // Override Update from TGedFrame as fGedEditor can be null.
00056 
00057    if (fGedEditor) {
00058       fGedEditor->Update();
00059    } else {
00060       fPad->Modified();
00061       fPad->Update();
00062    }
00063 }

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