Logo ROOT  
Reference Guide
TGeoGedFrame.cxx
Go to the documentation of this file.
1 // @(#)root/geombuilder:$Id$
2 // Author: Matevz Tadel 25/09/2006
3 
4 /** \class TGeoGedFrame
5 \ingroup Geometry_builder
6 
7 Common base class for geombuilder editors.
8 
9 */
10 
11 #include "TGeoGedFrame.h"
12 #include "TGeoTabManager.h"
13 #include "TGedEditor.h"
14 #include "TGTab.h"
15 #include "TVirtualPad.h"
16 
18 
19 ////////////////////////////////////////////////////////////////////////////////
20 /// Constructor.
21 
23  UInt_t options, Pixel_t back) :
24  TGedFrame(p, width, height, options, back),
25  fTab(0), fTabMgr(0), fPad(0)
26 {
27  fTab = fGedEditor->GetTab();
28  fPad = fGedEditor->GetPad();
30 }
31 
32 ////////////////////////////////////////////////////////////////////////////////
33 /// Set active GUI attribute frames related to the selected object.
34 
36 {
37  if (active)
39  else
41 
42 // no need to call for every single editor Layout of TGMainFrame
43 // ((TGMainFrame*)GetMainFrame())->Layout();
44 
45  // to avoid that the user changes options on a deactivated Tab
46  if (fTab->IsEnabled(fTab->GetCurrent()))
48  else
49  fTab->SetTab(0);
50 }
51 
52 ////////////////////////////////////////////////////////////////////////////////
53 /// Override Update from TGedFrame as fGedEditor can be null.
54 
56 {
57  if (fGedEditor) {
58  fGedEditor->Update();
59  } else {
60  fPad->Modified();
61  fPad->Update();
62  }
63 }
TGTab::GetCurrent
Int_t GetCurrent() const
Definition: TGTab.h:90
TGeoGedFrame::fTab
TGTab * fTab
Definition: TGeoGedFrame.h:16
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TGeoTabManager.h
TVirtualPad::Update
virtual void Update()=0
TGeoGedFrame
Common base class for geombuilder editors.
Definition: TGeoGedFrame.h:13
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGedEditor.h
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TGeoGedFrame::Update
virtual void Update()
Override Update from TGedFrame as fGedEditor can be null.
Definition: TGeoGedFrame.cxx:55
bool
TGeoTabManager::GetMakeTabManager
static TGeoTabManager * GetMakeTabManager(TGedEditor *ged)
Static method to return the tab manager currently appended to the pad or create one if not existing.
Definition: TGeoTabManager.cxx:200
TGeoGedFrame::TGeoGedFrame
TGeoGedFrame(const TGWindow *p=0, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor.
Definition: TGeoGedFrame.cxx:22
TGedEditor::GetPad
virtual TVirtualPad * GetPad() const
Definition: TGedEditor.h:78
TGeoGedFrame.h
TGeoGedFrame::fPad
TVirtualPad * fPad
Definition: TGeoGedFrame.h:18
TGCompositeFrame::HideFrame
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1190
TGedEditor::GetTab
TGTab * GetTab() const
Definition: TGedEditor.h:73
TVirtualPad.h
TGTab.h
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
unsigned int
TGeoGedFrame::SetActive
virtual void SetActive(Bool_t active=kTRUE)
Set active GUI attribute frames related to the selected object.
Definition: TGeoGedFrame.cxx:35
TGedFrame
Base frame for implementing GUI - a service class.
Definition: TGedFrame.h:27
TGWindow::GetParent
const TGWindow * GetParent() const
Definition: TGWindow.h:76
TGTab::IsEnabled
Bool_t IsEnabled(Int_t tabIndex) const
Returns true if tab is enabled.
Definition: TGTab.cxx:498
TVirtualPad::Modified
virtual void Modified(Bool_t flag=1)=0
TGeoGedFrame::fTabMgr
TGeoTabManager * fTabMgr
Definition: TGeoGedFrame.h:17
TGedFrame::fGedEditor
TGedEditor * fGedEditor
manager of this frame
Definition: TGedFrame.h:48
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGCompositeFrame::ShowFrame
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1204
TGedEditor::Update
virtual void Update(TGedFrame *frame=0)
Virtual method that is called on any change in the dependent frames.
Definition: TGedEditor.cxx:173
int