CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
FWGUISubviewArea Class Reference

#include <Fireworks/Core/interface/FWGUISubviewArea.h>

Inheritance diagram for FWGUISubviewArea:

Public Member Functions

 ClassDefOverride (FWGUISubviewArea, 0)
 
void destroy ()
 
void dock ()
 
 FWGUISubviewArea (TEveCompositeFrame *ef, TGCompositeFrame *parent, Int_t height)
 
TEveWindow * getEveWindow ()
 
bool isSelected () const
 
void selectButtonToggle ()
 
void setInfoButton (bool downp)
 
void setSwapIcon (bool)
 
void swap ()
 
void undock ()
 
void unselect ()
 
 ~FWGUISubviewArea () override
 

Static Public Member Functions

static const TGPicture * closeDisabledIcon ()
 
static const TGPicture * closeIcon ()
 
static const TGPicture * dockIcon ()
 
static FWGUISubviewAreagetToolBarFromWindow (TEveWindow *)
 
static const TGPicture * infoDisabledIcon ()
 
static const TGPicture * infoIcon ()
 
static const TGPicture * swapDisabledIcon ()
 
static const TGPicture * swapIcon ()
 
static const TGPicture * undockDisabledIcon ()
 
static const TGPicture * undockIcon ()
 

Public Attributes

sigc::signal< void, FWGUISubviewArea * > goingToBeDestroyed_
 
sigc::signal< void, FWGUISubviewArea * > selected_
 
sigc::signal< void, FWGUISubviewArea * > swap_
 
sigc::signal< void, FWGUISubviewArea * > unselected_
 

Private Member Functions

 FWGUISubviewArea (const FWGUISubviewArea &)
 
const FWGUISubviewAreaoperator= (const FWGUISubviewArea &)
 

Private Attributes

TGPictureButton * m_closeButton
 
TGPictureButton * m_dockButton
 
TEveCompositeFrame * m_frame
 
TGPictureButton * m_infoButton
 
TGPictureButton * m_swapButton
 
TGPictureButton * m_undockButton
 

Detailed Description

Description: Manages the GUI area where a sub Subview is displayed

Usage: <usage>

Definition at line 33 of file FWGUISubviewArea.h.

Constructor & Destructor Documentation

◆ FWGUISubviewArea() [1/2]

FWGUISubviewArea::FWGUISubviewArea ( TEveCompositeFrame *  ef,
TGCompositeFrame *  parent,
Int_t  height 
)

Definition at line 53 of file FWGUISubviewArea.cc.

54  : TGHorizontalFrame(parent, 20, height),
55  m_frame(ef),
56  m_swapButton(nullptr),
57  m_undockButton(nullptr),
58  m_dockButton(nullptr),
59  m_closeButton(nullptr),
60  m_infoButton(nullptr) {
61  UInt_t lh = kLHintsNormal | kLHintsExpandX | kLHintsExpandY;
62 
63  // info
64  m_infoButton = new XXXButton(this, infoIcon());
65  m_infoButton->ChangeOptions(kRaisedFrame);
66  m_infoButton->SetDisabledPicture(infoDisabledIcon());
67  AddFrame(m_infoButton, new TGLayoutHints(lh));
68  m_infoButton->AllowStayDown(kTRUE);
69  m_infoButton->Connect("Clicked()", "FWGUISubviewArea", this, "selectButtonToggle()");
70  m_infoButton->SetToolTipText("Edit View");
71 
72  //swap
73  m_swapButton = new TGPictureButton(this, swapIcon());
74  m_swapButton->SetDisabledPicture(swapDisabledIcon());
75  m_swapButton->SetToolTipText("Swap with the first view or select window to swap with click on toolbar.");
76  m_swapButton->ChangeOptions(kRaisedFrame);
77  m_swapButton->SetHeight(height);
78  AddFrame(m_swapButton, new TGLayoutHints(lh));
79  m_swapButton->Connect("Clicked()", "FWGUISubviewArea", this, "swap()");
80 
81  // dock
82  if (dynamic_cast<const TGMainFrame*>(ef->GetParent())) {
83  m_dockButton = new TGPictureButton(this, dockIcon());
84  m_dockButton->ChangeOptions(kRaisedFrame);
85  m_dockButton->ChangeOptions(kRaisedFrame);
86  m_dockButton->SetToolTipText("Dock view");
87  m_dockButton->SetHeight(height);
88  AddFrame(m_dockButton, new TGLayoutHints(lh));
89  m_dockButton->Connect("Clicked()", "FWGUISubviewArea", this, "dock()");
90  } else {
91  // undock
92  m_undockButton = new TGPictureButton(this, undockIcon());
93  m_undockButton->ChangeOptions(kRaisedFrame);
94  m_undockButton->SetDisabledPicture(undockDisabledIcon());
95  m_undockButton->SetToolTipText("Undock view to own window");
96  m_undockButton->SetHeight(height);
97  AddFrame(m_undockButton, new TGLayoutHints(lh));
98  m_undockButton->Connect("Clicked()", "FWGUISubviewArea", this, "undock()");
99  }
100  // destroy
101  m_closeButton = new TGPictureButton(this, closeIcon());
102  m_closeButton->ChangeOptions(kRaisedFrame);
103  m_closeButton->SetToolTipText("Close view");
104  m_closeButton->SetHeight(height);
105  AddFrame(m_closeButton, new TGLayoutHints(lh));
106  m_closeButton->Connect("Clicked()", "FWGUISubviewArea", this, "destroy()");
107 
109 }

References closeIcon(), FWGUIManager::connectSubviewAreaSignals(), dockIcon(), FWGUIManager::getGUIManager(), infoDisabledIcon(), infoIcon(), mathSSE::lh, m_closeButton, m_dockButton, m_infoButton, m_swapButton, m_undockButton, swapDisabledIcon(), swapIcon(), undockDisabledIcon(), and undockIcon().

◆ ~FWGUISubviewArea()

FWGUISubviewArea::~FWGUISubviewArea ( )
override

Definition at line 111 of file FWGUISubviewArea.cc.

111  {
112  //std::cout <<"IN dstr FWGUISubviewArea"<<std::endl;
113  m_closeButton->Disconnect("Clicked()", this, "destroy()");
114  m_infoButton->Disconnect("Clicked()", this, "selectButtonToggle()");
115 }

References m_closeButton, and m_infoButton.

◆ FWGUISubviewArea() [2/2]

FWGUISubviewArea::FWGUISubviewArea ( const FWGUISubviewArea )
private

Member Function Documentation

◆ ClassDefOverride()

FWGUISubviewArea::ClassDefOverride ( FWGUISubviewArea  ,
 
)

◆ closeDisabledIcon()

const TGPicture * FWGUISubviewArea::closeDisabledIcon ( )
static

Definition at line 201 of file FWGUISubviewArea.cc.

201  {
202  static const TGPicture* s_icon = nullptr;
203  if (nullptr == s_icon) {
204  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
205  if (nullptr == cmspath) {
206  throw std::runtime_error("CMSSW_BASE environment variable not set");
207  }
208  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "delete-disabled.png");
209  }
210  return s_icon;
211 }

References FWCheckBoxIcon::coreIcondir().

◆ closeIcon()

const TGPicture * FWGUISubviewArea::closeIcon ( )
static

Definition at line 189 of file FWGUISubviewArea.cc.

189  {
190  static const TGPicture* s_icon = nullptr;
191  if (nullptr == s_icon) {
192  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
193  if (nullptr == cmspath) {
194  throw std::runtime_error("CMSSW_BASE environment variable not set");
195  }
196  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "delete.png");
197  }
198  return s_icon;
199 }

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

◆ destroy()

void FWGUISubviewArea::destroy ( )

Definition at line 135 of file FWGUISubviewArea.cc.

135 { goingToBeDestroyed_(this); }

References goingToBeDestroyed_.

◆ dock()

void FWGUISubviewArea::dock ( )

Definition at line 148 of file FWGUISubviewArea.cc.

148  {
149  TGWindow* w = (TGWindow*)(m_frame->GetParent());
150  w->UnmapWindow();
151  TTimer::SingleShot(0, m_frame->ClassName(), m_frame, "MainFrameClosed()");
152 }

References m_frame, and w.

◆ dockIcon()

const TGPicture * FWGUISubviewArea::dockIcon ( )
static

Definition at line 225 of file FWGUISubviewArea.cc.

225  {
226  static const TGPicture* s_icon = nullptr;
227  if (nullptr == s_icon) {
228  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
229  if (nullptr == cmspath) {
230  throw std::runtime_error("CMSSW_BASE environment variable not set");
231  }
232  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "dock.png");
233  }
234  return s_icon;
235 }

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

◆ getEveWindow()

TEveWindow * FWGUISubviewArea::getEveWindow ( )

Definition at line 160 of file FWGUISubviewArea.cc.

160 { return m_frame->GetEveWindow(); }

References m_frame.

Referenced by FWGUIManager::subviewDestroy(), FWGUIManager::subviewInfoSelected(), and FWGUIManager::subviewSwapped().

◆ getToolBarFromWindow()

FWGUISubviewArea * FWGUISubviewArea::getToolBarFromWindow ( TEveWindow *  w)
static

Definition at line 275 of file FWGUISubviewArea.cc.

275  {
276  // horizontal frame
277  TGFrameElement* el = (TGFrameElement*)w->GetEveFrame()->GetList()->First();
278  TGCompositeFrame* hf = (TGCompositeFrame*)el->fFrame;
279  // subview last in the horizontal frame
280  el = (TGFrameElement*)hf->GetList()->Last();
281  FWGUISubviewArea* ar = dynamic_cast<FWGUISubviewArea*>(el->fFrame);
282  return ar;
283 }

References photonIsolationHIProducer_cfi::hf, and w.

Referenced by FWGUIManager::checkSubviewAreaIconState(), FWGUIManager::popupViewClosed(), FWGUIManager::subviewDestroyAll(), and FWGUIManager::subviewInfoSelected().

◆ infoDisabledIcon()

const TGPicture * FWGUISubviewArea::infoDisabledIcon ( )
static

Definition at line 261 of file FWGUISubviewArea.cc.

261  {
262  static const TGPicture* s_icon = nullptr;
263  if (nullptr == s_icon) {
264  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
265  if (nullptr == cmspath) {
266  throw std::runtime_error("CMSSW_BASE environment variable not set");
267  }
268  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "info-disabled.png");
269  }
270  return s_icon;
271 }

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

◆ infoIcon()

const TGPicture * FWGUISubviewArea::infoIcon ( )
static

Definition at line 249 of file FWGUISubviewArea.cc.

249  {
250  static const TGPicture* s_icon = nullptr;
251  if (nullptr == s_icon) {
252  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
253  if (nullptr == cmspath) {
254  throw std::runtime_error("CMSSW_BASE environment variable not set");
255  }
256  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "info.png");
257  }
258  return s_icon;
259 }

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

◆ isSelected()

bool FWGUISubviewArea::isSelected ( ) const

Definition at line 157 of file FWGUISubviewArea.cc.

157 { return m_infoButton->IsDown(); }

References m_infoButton.

Referenced by selectButtonToggle(), and FWGUIManager::subviewIsBeingDestroyed().

◆ operator=()

const FWGUISubviewArea& FWGUISubviewArea::operator= ( const FWGUISubviewArea )
private

◆ selectButtonToggle()

void FWGUISubviewArea::selectButtonToggle ( )

Definition at line 122 of file FWGUISubviewArea.cc.

122  {
123  if (isSelected())
124  selected_(this);
125  else
126  unselected_(this);
127 }

References isSelected(), selected_, and unselected_.

◆ setInfoButton()

void FWGUISubviewArea::setInfoButton ( bool  downp)

Definition at line 273 of file FWGUISubviewArea.cc.

273 { m_infoButton->SetState(downp ? kButtonEngaged : kButtonUp, false); }

References m_infoButton.

Referenced by FWGUIManager::checkSubviewAreaIconState(), FWGUIManager::popupViewClosed(), and FWGUIManager::subviewInfoSelected().

◆ setSwapIcon()

void FWGUISubviewArea::setSwapIcon ( bool  isOn)

Definition at line 131 of file FWGUISubviewArea.cc.

131 { m_swapButton->SetEnabled(isOn); }

References m_swapButton.

Referenced by FWGUIManager::checkSubviewAreaIconState().

◆ swap()

void FWGUISubviewArea::swap ( )

Definition at line 133 of file FWGUISubviewArea.cc.

133 { swap_(this); }

References swap_.

◆ swapDisabledIcon()

const TGPicture * FWGUISubviewArea::swapDisabledIcon ( )
static

Definition at line 177 of file FWGUISubviewArea.cc.

177  {
178  static const TGPicture* s_icon = nullptr;
179  if (nullptr == s_icon) {
180  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
181  if (nullptr == cmspath) {
182  throw std::runtime_error("CMSSW_BASE environment variable not set");
183  }
184  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "moveup-disabled.png");
185  }
186  return s_icon;
187 }

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

◆ swapIcon()

const TGPicture * FWGUISubviewArea::swapIcon ( )
static

Definition at line 165 of file FWGUISubviewArea.cc.

165  {
166  static const TGPicture* s_icon = nullptr;
167  if (nullptr == s_icon) {
168  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
169  if (nullptr == cmspath) {
170  throw std::runtime_error("CMSSW_BASE environment variable not set");
171  }
172  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "moveup.png");
173  }
174  return s_icon;
175 }

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

◆ undock()

void FWGUISubviewArea::undock ( )

Definition at line 137 of file FWGUISubviewArea.cc.

137  {
138  TEveWindow* ew = m_frame->GetEveWindow();
139  ew->UndockWindow();
140  TEveCompositeFrameInMainFrame* emf = dynamic_cast<TEveCompositeFrameInMainFrame*>(ew->GetEveFrame());
141  if (emf) {
142  const TGMainFrame* mf = dynamic_cast<const TGMainFrame*>(emf->GetParent());
143  if (mf)
145  }
146 }

References CmsShowMainFrame::bindCSGActionKeys(), custom_jme_cff::emf, FWGUIManager::getGUIManager(), FWGUIManager::getMainFrame(), and m_frame.

◆ undockDisabledIcon()

const TGPicture * FWGUISubviewArea::undockDisabledIcon ( )
static

Definition at line 237 of file FWGUISubviewArea.cc.

237  {
238  static const TGPicture* s_icon = nullptr;
239  if (nullptr == s_icon) {
240  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
241  if (nullptr == cmspath) {
242  throw std::runtime_error("CMSSW_BASE environment variable not set");
243  }
244  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "expand-disabled.png");
245  }
246  return s_icon;
247 }

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

◆ undockIcon()

const TGPicture * FWGUISubviewArea::undockIcon ( )
static

Definition at line 213 of file FWGUISubviewArea.cc.

213  {
214  static const TGPicture* s_icon = nullptr;
215  if (nullptr == s_icon) {
216  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
217  if (nullptr == cmspath) {
218  throw std::runtime_error("CMSSW_BASE environment variable not set");
219  }
220  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "expand.png");
221  }
222  return s_icon;
223 }

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

◆ unselect()

void FWGUISubviewArea::unselect ( )

Definition at line 129 of file FWGUISubviewArea.cc.

129 { m_infoButton->SetState(kButtonUp); }

References m_infoButton.

Member Data Documentation

◆ goingToBeDestroyed_

sigc::signal<void, FWGUISubviewArea*> FWGUISubviewArea::goingToBeDestroyed_

Definition at line 65 of file FWGUISubviewArea.h.

Referenced by destroy().

◆ m_closeButton

TGPictureButton* FWGUISubviewArea::m_closeButton
private

Definition at line 87 of file FWGUISubviewArea.h.

Referenced by FWGUISubviewArea(), and ~FWGUISubviewArea().

◆ m_dockButton

TGPictureButton* FWGUISubviewArea::m_dockButton
private

Definition at line 86 of file FWGUISubviewArea.h.

Referenced by FWGUISubviewArea().

◆ m_frame

TEveCompositeFrame* FWGUISubviewArea::m_frame
private

Definition at line 82 of file FWGUISubviewArea.h.

Referenced by dock(), getEveWindow(), and undock().

◆ m_infoButton

TGPictureButton* FWGUISubviewArea::m_infoButton
private

◆ m_swapButton

TGPictureButton* FWGUISubviewArea::m_swapButton
private

Definition at line 84 of file FWGUISubviewArea.h.

Referenced by FWGUISubviewArea(), and setSwapIcon().

◆ m_undockButton

TGPictureButton* FWGUISubviewArea::m_undockButton
private

Definition at line 85 of file FWGUISubviewArea.h.

Referenced by FWGUISubviewArea().

◆ selected_

sigc::signal<void, FWGUISubviewArea*> FWGUISubviewArea::selected_

Definition at line 66 of file FWGUISubviewArea.h.

Referenced by selectButtonToggle().

◆ swap_

sigc::signal<void, FWGUISubviewArea*> FWGUISubviewArea::swap_

Definition at line 64 of file FWGUISubviewArea.h.

Referenced by swap().

◆ unselected_

sigc::signal<void, FWGUISubviewArea*> FWGUISubviewArea::unselected_

Definition at line 67 of file FWGUISubviewArea.h.

Referenced by selectButtonToggle().

FWGUISubviewArea::dockIcon
static const TGPicture * dockIcon()
Definition: FWGUISubviewArea.cc:225
FWGUISubviewArea::m_frame
TEveCompositeFrame * m_frame
Definition: FWGUISubviewArea.h:82
CmsShowMainFrame::bindCSGActionKeys
void bindCSGActionKeys(const TGMainFrame *f) const
Definition: CmsShowMainFrame.cc:780
FWGUISubviewArea::goingToBeDestroyed_
sigc::signal< void, FWGUISubviewArea * > goingToBeDestroyed_
Definition: FWGUISubviewArea.h:65
FWCheckBoxIcon::coreIcondir
static const TString & coreIcondir()
Definition: FWCheckBoxIcon.cc:76
FWGUISubviewArea::m_closeButton
TGPictureButton * m_closeButton
Definition: FWGUISubviewArea.h:87
FWGUISubviewArea::infoDisabledIcon
static const TGPicture * infoDisabledIcon()
Definition: FWGUISubviewArea.cc:261
FWGUISubviewArea::swap_
sigc::signal< void, FWGUISubviewArea * > swap_
Definition: FWGUISubviewArea.h:64
mathSSE::lh
bool int lh
Definition: SIMDVec.h:20
FWGUIManager::getMainFrame
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:197
FWGUISubviewArea::m_undockButton
TGPictureButton * m_undockButton
Definition: FWGUISubviewArea.h:85
photonIsolationHIProducer_cfi.hf
hf
Definition: photonIsolationHIProducer_cfi.py:9
w
const double w
Definition: UKUtility.cc:23
FWGUISubviewArea::closeIcon
static const TGPicture * closeIcon()
Definition: FWGUISubviewArea.cc:189
FWGUISubviewArea::swapIcon
static const TGPicture * swapIcon()
Definition: FWGUISubviewArea.cc:165
FWGUISubviewArea
Definition: FWGUISubviewArea.h:33
custom_jme_cff.emf
emf
Definition: custom_jme_cff.py:205
FWGUISubviewArea::unselected_
sigc::signal< void, FWGUISubviewArea * > unselected_
Definition: FWGUISubviewArea.h:67
FWGUISubviewArea::selected_
sigc::signal< void, FWGUISubviewArea * > selected_
Definition: FWGUISubviewArea.h:66
FWGUISubviewArea::m_infoButton
TGPictureButton * m_infoButton
Definition: FWGUISubviewArea.h:88
FWGUISubviewArea::m_dockButton
TGPictureButton * m_dockButton
Definition: FWGUISubviewArea.h:86
FWGUISubviewArea::undockIcon
static const TGPicture * undockIcon()
Definition: FWGUISubviewArea.cc:213
FWGUIManager::connectSubviewAreaSignals
void connectSubviewAreaSignals(FWGUISubviewArea *)
Definition: FWGUIManager.cc:221
FWGUIManager::getGUIManager
static FWGUIManager * getGUIManager()
Definition: FWGUIManager.cc:685
FWGUISubviewArea::isSelected
bool isSelected() const
Definition: FWGUISubviewArea.cc:157
FWGUISubviewArea::swapDisabledIcon
static const TGPicture * swapDisabledIcon()
Definition: FWGUISubviewArea.cc:177
FWGUISubviewArea::undockDisabledIcon
static const TGPicture * undockDisabledIcon()
Definition: FWGUISubviewArea.cc:237
FWGUISubviewArea::m_swapButton
TGPictureButton * m_swapButton
Definition: FWGUISubviewArea.h:84
class-composition.parent
parent
Definition: class-composition.py:98
FWGUISubviewArea::infoIcon
static const TGPicture * infoIcon()
Definition: FWGUISubviewArea.cc:249