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 34 of file FWGUISubviewArea.h.

Constructor & Destructor Documentation

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

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

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

Definition at line 122 of file FWGUISubviewArea.cc.

References m_closeButton, and m_infoButton.

123 {
124  //std::cout <<"IN dstr FWGUISubviewArea"<<std::endl;
125  m_closeButton->Disconnect("Clicked()", this,"destroy()");
126  m_infoButton->Disconnect("Clicked()",this,"selectButtonToggle()");
127 }
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 251 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

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

Definition at line 237 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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

Definition at line 162 of file FWGUISubviewArea.cc.

References goingToBeDestroyed_.

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

Definition at line 181 of file FWGUISubviewArea.cc.

References m_frame, and w().

182 {
183  TGWindow* w = (TGWindow*)(m_frame->GetParent());
184  w->UnmapWindow();
185  TTimer::SingleShot(0, m_frame->ClassName(), m_frame, "MainFrameClosed()");
186 }
TEveCompositeFrame * m_frame
T w() const
const TGPicture * FWGUISubviewArea::dockIcon ( )
static

Definition at line 280 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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

Definition at line 200 of file FWGUISubviewArea.cc.

References m_frame.

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

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

Definition at line 342 of file FWGUISubviewArea.cc.

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

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

Definition at line 322 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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

Definition at line 308 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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

Definition at line 135 of file FWGUISubviewArea.cc.

References isSelected(), selected_, and unselected_.

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

Definition at line 336 of file FWGUISubviewArea.cc.

References m_infoButton.

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

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

Definition at line 150 of file FWGUISubviewArea.cc.

References m_swapButton.

Referenced by FWGUIManager::checkSubviewAreaIconState().

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

Definition at line 156 of file FWGUISubviewArea.cc.

References swap_.

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

Definition at line 223 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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

Definition at line 209 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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

Definition at line 168 of file FWGUISubviewArea.cc.

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

169 {
170  TEveWindow* ew = m_frame->GetEveWindow();
171  ew->UndockWindow();
172  TEveCompositeFrameInMainFrame* emf = dynamic_cast<TEveCompositeFrameInMainFrame*>(ew->GetEveFrame());
173  if (emf) {
174  const TGMainFrame* mf = dynamic_cast<const TGMainFrame*>(emf->GetParent());
175  if (mf)
177  }
178 }
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 294 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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

Definition at line 266 of file FWGUISubviewArea.cc.

References FWCheckBoxIcon::coreIcondir().

Referenced by FWGUISubviewArea().

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

Definition at line 144 of file FWGUISubviewArea.cc.

References m_infoButton.

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

Member Data Documentation

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

Definition at line 67 of file FWGUISubviewArea.h.

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

TGPictureButton* FWGUISubviewArea::m_closeButton
private

Definition at line 89 of file FWGUISubviewArea.h.

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

TGPictureButton* FWGUISubviewArea::m_dockButton
private

Definition at line 88 of file FWGUISubviewArea.h.

Referenced by FWGUISubviewArea().

TEveCompositeFrame* FWGUISubviewArea::m_frame
private

Definition at line 84 of file FWGUISubviewArea.h.

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

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

Definition at line 86 of file FWGUISubviewArea.h.

Referenced by FWGUISubviewArea(), and setSwapIcon().

TGPictureButton* FWGUISubviewArea::m_undockButton
private

Definition at line 87 of file FWGUISubviewArea.h.

Referenced by FWGUISubviewArea().

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

Definition at line 66 of file FWGUISubviewArea.h.

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

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