Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
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
7Common 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
17
18////////////////////////////////////////////////////////////////////////////////
19/// Constructor.
20
21TGeoGedFrame::TGeoGedFrame(const TGWindow *p, Int_t width, Int_t height, UInt_t options, Pixel_t back)
22 : TGedFrame(p, width, height, options, back), fTab(nullptr), fTabMgr(nullptr), fPad(nullptr)
23{
24 fTab = fGedEditor->GetTab();
25 fPad = fGedEditor->GetPad();
27}
28
29////////////////////////////////////////////////////////////////////////////////
30/// Set active GUI attribute frames related to the selected object.
31
33{
34 if (active)
35 ((TGCompositeFrame *)GetParent())->ShowFrame(this);
36 else
37 ((TGCompositeFrame *)GetParent())->HideFrame(this);
38
39 // no need to call for every single editor Layout of TGMainFrame
40 // ((TGMainFrame*)GetMainFrame())->Layout();
41
42 // to avoid that the user changes options on a deactivated Tab
43 if (fTab->IsEnabled(fTab->GetCurrent()))
44 fTab->SetTab(fTab->GetCurrent());
45 else
46 fTab->SetTab(0);
47}
48
49////////////////////////////////////////////////////////////////////////////////
50/// Override Update from TGedFrame as fGedEditor can be null.
51
53{
54 if (fGedEditor) {
55 fGedEditor->Update();
56 } else {
57 fPad->Modified();
58 fPad->Update();
59 }
60}
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:41
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
Definition RtypesCore.h:60
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
TGCompositeFrame(const TGCompositeFrame &)=delete
ROOT GUI Window base class.
Definition TGWindow.h:23
const TGWindow * GetParent() const
Definition TGWindow.h:83
TGedEditor * fGedEditor
manager of this frame
Definition TGedFrame.h:48
TGedFrame(const TGedFrame &)=delete
void Update() override
Override Update from TGedFrame as fGedEditor can be null.
TVirtualPad * fPad
TGeoGedFrame(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor.
virtual void SetActive(Bool_t active=kTRUE)
Set active GUI attribute frames related to the selected object.
TGeoTabManager * fTabMgr
static TGeoTabManager * GetMakeTabManager(TGedEditor *ged)
Static method to return the tab manager currently appended to the pad or create one if not existing.