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.

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().

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 }
TGPictureButton * m_undockButton
TGPictureButton * m_dockButton
static const TGPicture * swapIcon()
static const TGPicture * undockIcon()
static const TGPicture * swapDisabledIcon()
bool int lh
Definition: SIMDVec.h:27
static const TGPicture * infoIcon()
void connectSubviewAreaSignals(FWGUISubviewArea *)
static const TGPicture * undockDisabledIcon()
static const TGPicture * infoDisabledIcon()
TGPictureButton * m_swapButton
TGPictureButton * m_closeButton
TEveCompositeFrame * m_frame
static const TGPicture * dockIcon()
static FWGUIManager * getGUIManager()
static const TGPicture * closeIcon()
TGPictureButton * m_infoButton

◆ ~FWGUISubviewArea()

FWGUISubviewArea::~FWGUISubviewArea ( )
override

Definition at line 111 of file FWGUISubviewArea.cc.

References m_closeButton, and m_infoButton.

111  {
112  //std::cout <<"IN dstr FWGUISubviewArea"<<std::endl;
113  m_closeButton->Disconnect("Clicked()", this, "destroy()");
114  m_infoButton->Disconnect("Clicked()", this, "selectButtonToggle()");
115 }
TGPictureButton * m_closeButton
TGPictureButton * 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.

References FWCheckBoxIcon::coreIcondir().

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 }
static const TString & coreIcondir()

◆ closeIcon()

const TGPicture * FWGUISubviewArea::closeIcon ( )
static

Definition at line 189 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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 }
static const TString & coreIcondir()

◆ destroy()

void FWGUISubviewArea::destroy ( )

Definition at line 135 of file FWGUISubviewArea.cc.

References goingToBeDestroyed_.

135 { goingToBeDestroyed_(this); }
sigc::signal< void(FWGUISubviewArea *)> goingToBeDestroyed_

◆ dock()

void FWGUISubviewArea::dock ( )

Definition at line 148 of file FWGUISubviewArea.cc.

References m_frame, and w().

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

◆ dockIcon()

const TGPicture * FWGUISubviewArea::dockIcon ( )
static

Definition at line 225 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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 }
static const TString & coreIcondir()

◆ getEveWindow()

TEveWindow * FWGUISubviewArea::getEveWindow ( )

Definition at line 160 of file FWGUISubviewArea.cc.

References m_frame.

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

160 { return m_frame->GetEveWindow(); }
TEveCompositeFrame * m_frame

◆ getToolBarFromWindow()

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

Definition at line 275 of file FWGUISubviewArea.cc.

References photonIsolationHIProducer_cfi::hf, and w().

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

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 }
T w() const

◆ infoDisabledIcon()

const TGPicture * FWGUISubviewArea::infoDisabledIcon ( )
static

Definition at line 261 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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 }
static const TString & coreIcondir()

◆ infoIcon()

const TGPicture * FWGUISubviewArea::infoIcon ( )
static

Definition at line 249 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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 }
static const TString & coreIcondir()

◆ isSelected()

bool FWGUISubviewArea::isSelected ( ) const

Definition at line 157 of file FWGUISubviewArea.cc.

References m_infoButton.

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

157 { return m_infoButton->IsDown(); }
TGPictureButton * m_infoButton

◆ operator=()

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

◆ selectButtonToggle()

void FWGUISubviewArea::selectButtonToggle ( )

Definition at line 122 of file FWGUISubviewArea.cc.

References isSelected(), selected_, and unselected_.

122  {
123  if (isSelected())
124  selected_(this);
125  else
126  unselected_(this);
127 }
bool isSelected() const
sigc::signal< void(FWGUISubviewArea *)> unselected_
sigc::signal< void(FWGUISubviewArea *)> selected_

◆ setInfoButton()

void FWGUISubviewArea::setInfoButton ( bool  downp)

Definition at line 273 of file FWGUISubviewArea.cc.

References m_infoButton.

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

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

◆ setSwapIcon()

void FWGUISubviewArea::setSwapIcon ( bool  isOn)

Definition at line 131 of file FWGUISubviewArea.cc.

References m_swapButton.

Referenced by FWGUIManager::checkSubviewAreaIconState().

131 { m_swapButton->SetEnabled(isOn); }
TGPictureButton * m_swapButton

◆ swap()

void FWGUISubviewArea::swap ( )

Definition at line 133 of file FWGUISubviewArea.cc.

References swap_.

133 { swap_(this); }
sigc::signal< void(FWGUISubviewArea *)> swap_

◆ swapDisabledIcon()

const TGPicture * FWGUISubviewArea::swapDisabledIcon ( )
static

Definition at line 177 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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 }
static const TString & coreIcondir()

◆ swapIcon()

const TGPicture * FWGUISubviewArea::swapIcon ( )
static

Definition at line 165 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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 }
static const TString & coreIcondir()

◆ undock()

void FWGUISubviewArea::undock ( )

Definition at line 137 of file FWGUISubviewArea.cc.

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

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 }
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:197
TEveCompositeFrame * m_frame
static FWGUIManager * getGUIManager()
void bindCSGActionKeys(const TGMainFrame *f) const

◆ undockDisabledIcon()

const TGPicture * FWGUISubviewArea::undockDisabledIcon ( )
static

Definition at line 237 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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 }
static const TString & coreIcondir()

◆ undockIcon()

const TGPicture * FWGUISubviewArea::undockIcon ( )
static

Definition at line 213 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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 }
static const TString & coreIcondir()

◆ unselect()

void FWGUISubviewArea::unselect ( )

Definition at line 129 of file FWGUISubviewArea.cc.

References m_infoButton.

129 { m_infoButton->SetState(kButtonUp); }
TGPictureButton * 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().