CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
CmsShowViewPopup Class Reference

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

Inheritance diagram for CmsShowViewPopup:

Public Member Functions

void backgroundColorWasChanged ()
 
void changeBackground ()
 
 ClassDef (CmsShowViewPopup, 0)
 
virtual void CloseWindow ()
 
 CmsShowViewPopup (const TGWindow *p=0, UInt_t w=200, UInt_t h=200, FWColorManager *cm=0, FWViewBase *wb=0, TEveWindow *ew=0)
 
TEveWindow * getEveWindow () const
 
bool mapped ()
 
virtual void MapWindow ()
 
void reset (FWViewBase *, TEveWindow *ew)
 
void saveImage ()
 
virtual void UnmapWindow ()
 
virtual ~CmsShowViewPopup ()
 

Public Attributes

sigc::signal< void > closed_
 

Private Member Functions

 CmsShowViewPopup (const CmsShowViewPopup &)
 
const CmsShowViewPopupoperator= (const CmsShowViewPopup &)
 

Private Attributes

TGTextButton * m_changeBackground
 
FWColorManagerm_colorManager
 
TEveWindow * m_eveWindow
 
bool m_mapped
 
ViewerParameterGUIm_paramGUI
 
TGButton * m_saveImageButton
 
FWViewBasem_viewBase
 
TGLabel * m_viewLabel
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 75 of file CmsShowViewPopup.h.

Constructor & Destructor Documentation

CmsShowViewPopup::CmsShowViewPopup ( const TGWindow *  p = 0,
UInt_t  w = 200,
UInt_t  h = 200,
FWColorManager cm = 0,
FWViewBase wb = 0,
TEveWindow *  ew = 0 
)

Definition at line 44 of file CmsShowViewPopup.cc.

References backgroundColorWasChanged(), FWColorManager::colorsHaveChanged_, m_changeBackground, m_colorManager, m_paramGUI, m_saveImageButton, and m_viewLabel.

44  :
45  TGTransientFrame(gClient->GetDefaultRoot(),p, w, h),
46  m_mapped(kFALSE),
47  m_viewLabel(0),
48  m_paramGUI(0),
51  m_colorManager(iCMgr),
52  m_viewBase(0),
53  m_eveWindow(0)
54 {
56 
57  SetCleanup(kDeepCleanup);
58 
59  // label
60  TGHorizontalFrame* viewFrame = new TGHorizontalFrame(this);
61  m_viewLabel = new TGLabel(viewFrame, "No view selected");
62  try
63  {
64  TGFont* defaultFont = gClient->GetFontPool()->GetFont(m_viewLabel->GetDefaultFontStruct());
65  m_viewLabel->SetTextFont(gClient->GetFontPool()->GetFont(defaultFont->GetFontAttributes().fFamily, 14, defaultFont->GetFontAttributes().fWeight + 2, defaultFont->GetFontAttributes().fSlant));
66  }
67  catch(...)
68  {
69  // FIXME: looks like under certain conditions (e.g. in full framework)
70  // GetFontPool() throws when the default font is not found. This is a
71  // quick workaround, but we should probably investigate more.
72  }
73 
74  m_viewLabel->SetTextJustify(kTextLeft);
75  viewFrame->AddFrame(m_viewLabel, new TGLayoutHints(kLHintsExpandX));
76  AddFrame(viewFrame, new TGLayoutHints(kLHintsExpandX, 2, 2, 0, 0));
77  // background
78  m_changeBackground = new TGTextButton(this,"Change Background Color");
80  AddFrame(m_changeBackground, new TGLayoutHints(kLHintsNormal, 0, 0, 5, 5));
81  m_changeBackground->Connect("Clicked()","CmsShowViewPopup",this,"changeBackground()");
82  // save image
83  m_saveImageButton= new TGTextButton(this,"Save Image ...");
84  AddFrame(m_saveImageButton);
85  m_saveImageButton->Connect("Clicked()","CmsShowViewPopup",this,"saveImage()");
86 
87  // content frame
88  AddFrame(new TGHorizontal3DLine(this), new TGLayoutHints(kLHintsExpandX, 0, 0, 5, 5));
89  m_paramGUI = new ViewerParameterGUI(this);
90  AddFrame(m_paramGUI,new TGLayoutHints(kLHintsExpandX|kLHintsExpandY));
91 
92  SetWindowName("View Controller");
93 }
TGTextButton * m_changeBackground
FWColorManager * m_colorManager
FWViewBase * m_viewBase
void backgroundColorWasChanged()
TGButton * m_saveImageButton
sigc::signal< void > colorsHaveChanged_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
ViewerParameterGUI * m_paramGUI
TEveWindow * m_eveWindow
CmsShowViewPopup::~CmsShowViewPopup ( )
virtual

Definition at line 100 of file CmsShowViewPopup.cc.

101 {
102 }
CmsShowViewPopup::CmsShowViewPopup ( const CmsShowViewPopup )
private

Member Function Documentation

void CmsShowViewPopup::backgroundColorWasChanged ( )

Definition at line 173 of file CmsShowViewPopup.cc.

References FWColorManager::backgroundColorIndex(), FWColorManager::kBlackIndex, m_changeBackground, and m_colorManager.

Referenced by CmsShowViewPopup().

174 {
176  m_changeBackground->SetText("Change Background Color to White");
177  } else {
178  m_changeBackground->SetText("Change Background Color to Black");
179  }
180 }
BackgroundColorIndex backgroundColorIndex() const
TGTextButton * m_changeBackground
FWColorManager * m_colorManager
void CmsShowViewPopup::changeBackground ( )
CmsShowViewPopup::ClassDef ( CmsShowViewPopup  ,
 
)
void CmsShowViewPopup::CloseWindow ( )
virtual

Definition at line 137 of file CmsShowViewPopup.cc.

References closed_, and UnmapWindow().

138 {
139  UnmapWindow();
140  closed_.emit();
141 }
sigc::signal< void > closed_
virtual void UnmapWindow()
TEveWindow* CmsShowViewPopup::getEveWindow ( ) const
inline

Definition at line 97 of file CmsShowViewPopup.h.

References m_eveWindow.

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

97 { return m_eveWindow; }
TEveWindow * m_eveWindow
bool CmsShowViewPopup::mapped ( )
inline

Definition at line 90 of file CmsShowViewPopup.h.

References m_mapped.

Referenced by FWGUIManager::checkSubviewAreaIconState().

90 { return m_mapped; }
void CmsShowViewPopup::MapWindow ( )
virtual

Definition at line 144 of file CmsShowViewPopup.cc.

References m_mapped.

145 {
146  TGWindow::MapWindow();
147  m_mapped = true;
148 }
const CmsShowViewPopup& CmsShowViewPopup::operator= ( const CmsShowViewPopup )
private
void CmsShowViewPopup::reset ( FWViewBase vb,
TEveWindow *  ew 
)

Definition at line 105 of file CmsShowViewPopup.cc.

References m_eveWindow, m_paramGUI, m_saveImageButton, m_viewBase, m_viewLabel, ViewerParameterGUI::populateComplete(), FWViewBase::populateController(), ViewerParameterGUI::reset(), and FWViewBase::typeName().

Referenced by FWGUIManager::setViewPopup().

106 {
107  m_viewBase = vb;
108  m_eveWindow = ew;
109 
110  m_paramGUI->reset();
111 
112  // fill content
113  if(m_viewBase) {
114  m_saveImageButton->SetEnabled(kTRUE);
115  m_viewLabel->SetText(m_viewBase->typeName().c_str());
118 
119  fMain = m_eveWindow->GetEveFrame();
120  }
121  else {
122  fMain = 0;
123  m_viewLabel->SetText("No view selected");
124  m_saveImageButton->SetEnabled(kFALSE);
125  }
126 
127  MapSubwindows();
128  Resize(GetDefaultSize());
129  Layout();
130  if (fMain)
131  {
132  CenterOnParent(kTRUE, TGTransientFrame::kTopRight);
133  }
134 }
const std::string & typeName() const
Definition: FWViewBase.cc:114
FWViewBase * m_viewBase
virtual void populateController(ViewerParameterGUI &) const
Definition: FWViewBase.h:49
TGButton * m_saveImageButton
ViewerParameterGUI * m_paramGUI
TEveWindow * m_eveWindow
void CmsShowViewPopup::saveImage ( )
void CmsShowViewPopup::UnmapWindow ( )
virtual

Definition at line 151 of file CmsShowViewPopup.cc.

References m_mapped.

Referenced by CloseWindow(), FWGUIManager::setViewPopup(), and FWGUIManager::subviewInfoUnselected().

152 {
153  TGWindow::UnmapWindow();
154  m_mapped = false;
155 }

Member Data Documentation

sigc::signal<void> CmsShowViewPopup::closed_

Definition at line 99 of file CmsShowViewPopup.h.

Referenced by CloseWindow(), and FWGUIManager::setViewPopup().

TGTextButton* CmsShowViewPopup::m_changeBackground
private

Definition at line 115 of file CmsShowViewPopup.h.

Referenced by backgroundColorWasChanged(), and CmsShowViewPopup().

FWColorManager* CmsShowViewPopup::m_colorManager
private
TEveWindow* CmsShowViewPopup::m_eveWindow
private

Definition at line 119 of file CmsShowViewPopup.h.

Referenced by getEveWindow(), and reset().

bool CmsShowViewPopup::m_mapped
private

Definition at line 110 of file CmsShowViewPopup.h.

Referenced by mapped(), MapWindow(), and UnmapWindow().

ViewerParameterGUI* CmsShowViewPopup::m_paramGUI
private

Definition at line 113 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

TGButton* CmsShowViewPopup::m_saveImageButton
private

Definition at line 114 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

FWViewBase* CmsShowViewPopup::m_viewBase
private

Definition at line 118 of file CmsShowViewPopup.h.

Referenced by reset(), and saveImage().

TGLabel* CmsShowViewPopup::m_viewLabel
private

Definition at line 112 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().