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
 
TGTextButton * 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(kLHintsExpandX, 2, 2, 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, new TGLayoutHints(kLHintsExpandX, 2, 2, 5, 5));
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
TGTextButton * m_saveImageButton
FWColorManager * m_colorManager
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
FWViewBase * m_viewBase
void backgroundColorWasChanged()
T w() const
sigc::signal< void > colorsHaveChanged_
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 183 of file CmsShowViewPopup.cc.

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

Referenced by CmsShowViewPopup().

184 {
186  m_changeBackground->SetText("Change Background Color to White");
187  } else {
188  m_changeBackground->SetText("Change Background Color to Black");
189  }
190 }
BackgroundColorIndex backgroundColorIndex() const
TGTextButton * m_changeBackground
FWColorManager * m_colorManager
void CmsShowViewPopup::changeBackground ( )
CmsShowViewPopup::ClassDef ( CmsShowViewPopup  ,
 
)
void CmsShowViewPopup::CloseWindow ( )
virtual

Definition at line 147 of file CmsShowViewPopup.cc.

References closed_, and UnmapWindow().

148 {
149  UnmapWindow();
150  closed_.emit();
151 }
sigc::signal< void > closed_
virtual void UnmapWindow()
TEveWindow* CmsShowViewPopup::getEveWindow ( ) const
inline

Definition at line 98 of file CmsShowViewPopup.h.

References m_eveWindow.

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

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

Definition at line 91 of file CmsShowViewPopup.h.

References m_mapped.

Referenced by FWGUIManager::checkSubviewAreaIconState().

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

Definition at line 154 of file CmsShowViewPopup.cc.

References m_mapped.

155 {
156  TGWindow::MapWindow();
157  m_mapped = true;
158 }
const CmsShowViewPopup& CmsShowViewPopup::operator= ( const CmsShowViewPopup )
private
void CmsShowViewPopup::reset ( FWViewBase vb,
TEveWindow *  ew 
)

Definition at line 105 of file CmsShowViewPopup.cc.

References FWViewType::kTable, m_eveWindow, m_paramGUI, m_saveImageButton, m_viewBase, m_viewLabel, ViewerParameterGUI::populateComplete(), FWViewBase::populateController(), ViewerParameterGUI::reset(), FWViewBase::typeId(), 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  {
115  m_saveImageButton->SetEnabled(kTRUE);
116  m_viewLabel->SetText(m_viewBase->typeName().c_str());
119 
120  fMain = m_eveWindow->GetEveFrame();
121 
122  if (vb->typeId() >= FWViewType::kTable)
123  m_saveImageButton->SetText("Print Text To Terminal");
124  else
125  m_saveImageButton->SetText("Save Image ...");
126  }
127  else
128  {
129  fMain = 0;
130  m_viewLabel->SetText("No view selected");
131  m_saveImageButton->SetEnabled(kFALSE);
132  }
133 
134  MapSubwindows();
135  Resize(GetDefaultSize());
136  Layout();
137  if (fMain)
138  {
139  CenterOnParent(kTRUE, TGTransientFrame::kTopRight);
140  }
141 
142 
143 
144 }
const std::string & typeName() const
Definition: FWViewBase.cc:120
TGTextButton * m_saveImageButton
FWViewBase * m_viewBase
virtual void populateController(ViewerParameterGUI &) const
Definition: FWViewBase.h:48
ViewerParameterGUI * m_paramGUI
TEveWindow * m_eveWindow
FWViewType::EType typeId() const
Definition: FWViewBase.h:41
void CmsShowViewPopup::saveImage ( )

Definition at line 168 of file CmsShowViewPopup.cc.

References m_viewBase, and FWViewBase::promptForSaveImageTo().

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController::readFile().

169 {
170  if (m_viewBase)
172 }
FWViewBase * m_viewBase
void promptForSaveImageTo(TGFrame *) const
Definition: FWViewBase.cc:73
void CmsShowViewPopup::UnmapWindow ( )
virtual

Definition at line 161 of file CmsShowViewPopup.cc.

References m_mapped.

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

162 {
163  TGWindow::UnmapWindow();
164  m_mapped = false;
165 }

Member Data Documentation

sigc::signal<void> CmsShowViewPopup::closed_

Definition at line 100 of file CmsShowViewPopup.h.

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

TGTextButton* CmsShowViewPopup::m_changeBackground
private

Definition at line 116 of file CmsShowViewPopup.h.

Referenced by backgroundColorWasChanged(), and CmsShowViewPopup().

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

Definition at line 120 of file CmsShowViewPopup.h.

Referenced by getEveWindow(), and reset().

bool CmsShowViewPopup::m_mapped
private

Definition at line 111 of file CmsShowViewPopup.h.

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

ViewerParameterGUI* CmsShowViewPopup::m_paramGUI
private

Definition at line 114 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

TGTextButton* CmsShowViewPopup::m_saveImageButton
private

Definition at line 115 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

FWViewBase* CmsShowViewPopup::m_viewBase
private

Definition at line 119 of file CmsShowViewPopup.h.

Referenced by reset(), and saveImage().

TGLabel* CmsShowViewPopup::m_viewLabel
private

Definition at line 113 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().