CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

 ClassDef (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 ()
 
virtual ~FWGUISubviewArea ()
 

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::FWGUISubviewArea ( TEveCompositeFrame *  ef,
TGCompositeFrame *  parent,
Int_t  height 
)

Definition at line 60 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().

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

Definition at line 121 of file FWGUISubviewArea.cc.

References m_closeButton, and m_infoButton.

122 {
123  //std::cout <<"IN dstr FWGUISubviewArea"<<std::endl;
124  m_closeButton->Disconnect("Clicked()", this,"destroy()");
125  m_infoButton->Disconnect("Clicked()",this,"selectButtonToggle()");
126 }
TGPictureButton * m_closeButton
TGPictureButton * m_infoButton
FWGUISubviewArea::FWGUISubviewArea ( const FWGUISubviewArea )
private

Member Function Documentation

FWGUISubviewArea::ClassDef ( FWGUISubviewArea  ,
 
)
const TGPicture * FWGUISubviewArea::closeDisabledIcon ( )
static

Definition at line 250 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

251 {
252  static const TGPicture* s_icon = 0;
253  if(0== s_icon) {
254  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
255  if(0 == cmspath) {
256  throw std::runtime_error("CMSSW_BASE environment variable not set");
257  }
258  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"delete-disabled.png");
259  }
260  return s_icon;
261 }
static const TString & coreIcondir()
const TGPicture * FWGUISubviewArea::closeIcon ( )
static

Definition at line 236 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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

Definition at line 161 of file FWGUISubviewArea.cc.

References goingToBeDestroyed_.

162 {
163  goingToBeDestroyed_(this);
164 }
sigc::signal< void, FWGUISubviewArea * > goingToBeDestroyed_
void FWGUISubviewArea::dock ( )

Definition at line 180 of file FWGUISubviewArea.cc.

References m_frame, and w.

181 {
182  TGWindow* w = (TGWindow*)(m_frame->GetParent());
183  w->UnmapWindow();
184  TTimer::SingleShot(0, m_frame->ClassName(), m_frame, "MainFrameClosed()");
185 }
const double w
Definition: UKUtility.cc:23
TEveCompositeFrame * m_frame
const TGPicture * FWGUISubviewArea::dockIcon ( )
static

Definition at line 279 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

280 {
281  static const TGPicture* s_icon = 0;
282  if(0== s_icon) {
283  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
284  if(0 == cmspath) {
285  throw std::runtime_error("CMSSW_BASE environment variable not set");
286  }
287  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"dock.png");
288  }
289  return s_icon;
290 }
static const TString & coreIcondir()
TEveWindow * FWGUISubviewArea::getEveWindow ( )

Definition at line 199 of file FWGUISubviewArea.cc.

References m_frame.

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

200 {
201  return m_frame->GetEveWindow();
202 }
TEveCompositeFrame * m_frame
FWGUISubviewArea * FWGUISubviewArea::getToolBarFromWindow ( TEveWindow *  w)
static

Definition at line 341 of file FWGUISubviewArea.cc.

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

342 {
343  // horizontal frame
344  TGFrameElement *el = (TGFrameElement*) w->GetEveFrame()->GetList()->First();
345  TGCompositeFrame* hf = (TGCompositeFrame*)el->fFrame;
346  // subview last in the horizontal frame
347  el = (TGFrameElement*)hf->GetList()->Last();
348  FWGUISubviewArea* ar = dynamic_cast<FWGUISubviewArea*>(el->fFrame);
349  return ar;
350 }
const double w
Definition: UKUtility.cc:23
const TGPicture * FWGUISubviewArea::infoDisabledIcon ( )
static

Definition at line 321 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

322 {
323  static const TGPicture* s_icon = 0;
324  if(0== s_icon) {
325  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
326  if(0 == cmspath) {
327  throw std::runtime_error("CMSSW_BASE environment variable not set");
328  }
329  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"info-disabled.png");
330  }
331  return s_icon;
332 }
static const TString & coreIcondir()
const TGPicture * FWGUISubviewArea::infoIcon ( )
static

Definition at line 307 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

308 {
309  static const TGPicture* s_icon = 0;
310  if(0== s_icon) {
311  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
312  if(0 == cmspath) {
313  throw std::runtime_error("CMSSW_BASE environment variable not set");
314  }
315  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"info.png");
316  }
317  return s_icon;
318 }
static const TString & coreIcondir()
bool FWGUISubviewArea::isSelected ( ) const
const FWGUISubviewArea& FWGUISubviewArea::operator= ( const FWGUISubviewArea )
private
void FWGUISubviewArea::selectButtonToggle ( )

Definition at line 134 of file FWGUISubviewArea.cc.

References isSelected(), selected_, and unselected_.

135 {
136  if (isSelected())
137  selected_(this);
138  else
139  unselected_(this);
140 }
sigc::signal< void, FWGUISubviewArea * > unselected_
bool isSelected() const
sigc::signal< void, FWGUISubviewArea * > selected_
void FWGUISubviewArea::setInfoButton ( bool  downp)

Definition at line 335 of file FWGUISubviewArea.cc.

References m_infoButton.

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

336 {
337  m_infoButton->SetState(downp ? kButtonEngaged : kButtonUp, false);
338 }
TGPictureButton * m_infoButton
void FWGUISubviewArea::setSwapIcon ( bool  isOn)

Definition at line 149 of file FWGUISubviewArea.cc.

References m_swapButton.

Referenced by FWGUIManager::checkSubviewAreaIconState().

150 {
151  m_swapButton->SetEnabled(isOn);
152 }
TGPictureButton * m_swapButton
void FWGUISubviewArea::swap ( )

Definition at line 155 of file FWGUISubviewArea.cc.

References swap_.

156 {
157  swap_(this);
158 }
sigc::signal< void, FWGUISubviewArea * > swap_
const TGPicture * FWGUISubviewArea::swapDisabledIcon ( )
static

Definition at line 222 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

223 {
224  static const TGPicture* s_icon = 0;
225  if(0== s_icon) {
226  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
227  if(0 == cmspath) {
228  throw std::runtime_error("CMSSW_BASE environment variable not set");
229  }
230  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"moveup-disabled.png");
231  }
232  return s_icon;
233 }
static const TString & coreIcondir()
const TGPicture * FWGUISubviewArea::swapIcon ( )
static

Definition at line 208 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

209 {
210  static const TGPicture* s_icon = 0;
211  if(0== s_icon) {
212  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
213  if(0 == cmspath) {
214  throw std::runtime_error("CMSSW_BASE environment variable not set");
215  }
216  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"moveup.png");
217  }
218  return s_icon;
219 }
static const TString & coreIcondir()
void FWGUISubviewArea::undock ( )

Definition at line 167 of file FWGUISubviewArea.cc.

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

168 {
169  TEveWindow* ew = m_frame->GetEveWindow();
170  ew->UndockWindow();
171  TEveCompositeFrameInMainFrame* emf = dynamic_cast<TEveCompositeFrameInMainFrame*>(ew->GetEveFrame());
172  if (emf) {
173  const TGMainFrame* mf = dynamic_cast<const TGMainFrame*>(emf->GetParent());
174  if (mf)
176  }
177 }
void bindCSGActionKeys(const TGMainFrame *f) const
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:200
TEveCompositeFrame * m_frame
static FWGUIManager * getGUIManager()
const TGPicture * FWGUISubviewArea::undockDisabledIcon ( )
static

Definition at line 293 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

294 {
295  static const TGPicture* s_icon = 0;
296  if(0== s_icon) {
297  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
298  if(0 == cmspath) {
299  throw std::runtime_error("CMSSW_BASE environment variable not set");
300  }
301  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"expand-disabled.png");
302  }
303  return s_icon;
304 }
static const TString & coreIcondir()
const TGPicture * FWGUISubviewArea::undockIcon ( )
static

Definition at line 265 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

266 {
267  static const TGPicture* s_icon = 0;
268  if(0== s_icon) {
269  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
270  if(0 == cmspath) {
271  throw std::runtime_error("CMSSW_BASE environment variable not set");
272  }
273  s_icon = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"expand.png");
274  }
275  return s_icon;
276 }
static const TString & coreIcondir()
void FWGUISubviewArea::unselect ( )

Definition at line 143 of file FWGUISubviewArea.cc.

References m_infoButton.

144 {
145  m_infoButton->SetState(kButtonUp);
146 }
TGPictureButton * m_infoButton

Member Data Documentation

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

Definition at line 66 of file FWGUISubviewArea.h.

Referenced by FWGUIManager::connectSubviewAreaSignals(), and destroy().

TGPictureButton* FWGUISubviewArea::m_closeButton
private

Definition at line 88 of file FWGUISubviewArea.h.

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

TGPictureButton* FWGUISubviewArea::m_dockButton
private

Definition at line 87 of file FWGUISubviewArea.h.

Referenced by FWGUISubviewArea().

TEveCompositeFrame* FWGUISubviewArea::m_frame
private

Definition at line 83 of file FWGUISubviewArea.h.

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

TGPictureButton* FWGUISubviewArea::m_infoButton
private
TGPictureButton* FWGUISubviewArea::m_swapButton
private

Definition at line 85 of file FWGUISubviewArea.h.

Referenced by FWGUISubviewArea(), and setSwapIcon().

TGPictureButton* FWGUISubviewArea::m_undockButton
private

Definition at line 86 of file FWGUISubviewArea.h.

Referenced by FWGUISubviewArea().

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

Definition at line 65 of file FWGUISubviewArea.h.

Referenced by FWGUIManager::connectSubviewAreaSignals(), and swap().

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