Logo ROOT   6.08/07
Reference Guide
TGeoGedFrame.cxx
Go to the documentation of this file.
1 // @(#)root/geombuilder:$Id$
2 // Author: Matevz Tadel 25/09/2006
3 
4 //______________________________________________________________________________
5 // //
6 // TGeoGedFrame //
7 // //
8 // Common base class for geombuilder editors. //
9 // //
10 //______________________________________________________________________________
11 
12 #include "TGeoGedFrame.h"
13 #include "TGeoTabManager.h"
14 #include "TGedEditor.h"
15 #include "TGTab.h"
16 #include "TVirtualPad.h"
17 
19 
20 ////////////////////////////////////////////////////////////////////////////////
21 /// Constructor.
22 
23 TGeoGedFrame::TGeoGedFrame(const TGWindow *p, Int_t width, Int_t height,
24  UInt_t options, Pixel_t back) :
25  TGedFrame(p, width, height, options, back),
26  fTab(0), fTabMgr(0), fPad(0)
27 {
28  fTab = fGedEditor->GetTab();
29  fPad = fGedEditor->GetPad();
30  fTabMgr = TGeoTabManager::GetMakeTabManager(fGedEditor);
31 }
32 
33 ////////////////////////////////////////////////////////////////////////////////
34 /// Set active GUI attribute frames related to the selected object.
35 
37 {
38  if (active)
40  else
42 
43 // no need to call for every single editor Layout of TGMainFrame
44 // ((TGMainFrame*)GetMainFrame())->Layout();
45 
46  // to avoid that the user changes options on a deactivated Tab
47  if (fTab->IsEnabled(fTab->GetCurrent()))
49  else
50  fTab->SetTab(0);
51 }
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// Override Update from TGedFrame as fGedEditor can be null.
55 
57 {
58  if (fGedEditor) {
59  fGedEditor->Update();
60  } else {
61  fPad->Modified();
62  fPad->Update();
63  }
64 }
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1172
Int_t GetCurrent() const
Definition: TGTab.h:109
virtual void Update()=0
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1186
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
ULong_t Pixel_t
Definition: GuiTypes.h:41
virtual void SetActive(Bool_t active=kTRUE)
Set active GUI attribute frames related to the selected object.
virtual void Update(TGedFrame *frame=0)
Virtual method that is called on any change in the dependent frames.
Definition: TGedEditor.cxx:177
static TGeoTabManager * GetMakeTabManager(TGedEditor *ged)
Static method to return the tab manager currently appended to the pad or create one if not existing...
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
Bool_t IsEnabled(Int_t tabIndex) const
Returns true if tab is enabled.
Definition: TGTab.cxx:447
virtual void Modified(Bool_t flag=1)=0
#define ClassImp(name)
Definition: Rtypes.h:279
const TGWindow * GetParent() const
Definition: TGWindow.h:87
virtual void Update()
Override Update from TGedFrame as fGedEditor can be null.
TVirtualPad * fPad
Definition: TGeoGedFrame.h:28
TGedEditor * fGedEditor
Definition: TGedFrame.h:56
TGTab * fTab
Definition: TGeoGedFrame.h:26