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 76 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 45 of file CmsShowViewPopup.cc.

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

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

Definition at line 101 of file CmsShowViewPopup.cc.

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

Member Function Documentation

void CmsShowViewPopup::backgroundColorWasChanged ( )

Definition at line 184 of file CmsShowViewPopup.cc.

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

Referenced by CmsShowViewPopup().

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

Definition at line 148 of file CmsShowViewPopup.cc.

References closed_, and UnmapWindow().

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

Definition at line 99 of file CmsShowViewPopup.h.

References m_eveWindow.

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

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

Definition at line 92 of file CmsShowViewPopup.h.

References m_mapped.

Referenced by FWGUIManager::checkSubviewAreaIconState().

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

Definition at line 155 of file CmsShowViewPopup.cc.

References m_mapped.

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

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

107 {
108  m_viewBase = vb;
109  m_eveWindow = ew;
110 
111  m_paramGUI->reset();
112 
113  // fill content
114  if (m_viewBase)
115  {
116  m_saveImageButton->SetEnabled(kTRUE);
117  m_viewLabel->SetText(m_viewBase->typeName().c_str());
120 
121  fMain = m_eveWindow->GetEveFrame();
122 
123  if (vb->typeId() >= FWViewType::kTable)
124  m_saveImageButton->SetText("Print Text To Terminal");
125  else
126  m_saveImageButton->SetText("Save Image ...");
127  }
128  else
129  {
130  fMain = 0;
131  m_viewLabel->SetText("No view selected");
132  m_saveImageButton->SetEnabled(kFALSE);
133  }
134 
135  MapSubwindows();
136  Resize(GetDefaultSize());
137  Layout();
138  if (fMain)
139  {
140  CenterOnParent(kTRUE, TGTransientFrame::kTopRight);
141  }
142 
143 
144 
145 }
const std::string & typeName() const
Definition: FWViewBase.cc:121
TGTextButton * m_saveImageButton
FWViewBase * m_viewBase
virtual void populateController(ViewerParameterGUI &) const
Definition: FWViewBase.h:49
ViewerParameterGUI * m_paramGUI
TEveWindow * m_eveWindow
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
void CmsShowViewPopup::saveImage ( )

Definition at line 169 of file CmsShowViewPopup.cc.

References m_viewBase, and FWViewBase::promptForSaveImageTo().

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

170 {
171  if (m_viewBase)
173 }
FWViewBase * m_viewBase
void promptForSaveImageTo(TGFrame *) const
Definition: FWViewBase.cc:74
void CmsShowViewPopup::UnmapWindow ( )
virtual

Definition at line 162 of file CmsShowViewPopup.cc.

References m_mapped.

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

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

Member Data Documentation

sigc::signal<void> CmsShowViewPopup::closed_

Definition at line 101 of file CmsShowViewPopup.h.

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

TGTextButton* CmsShowViewPopup::m_changeBackground
private

Definition at line 117 of file CmsShowViewPopup.h.

Referenced by backgroundColorWasChanged(), and CmsShowViewPopup().

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

Definition at line 121 of file CmsShowViewPopup.h.

Referenced by getEveWindow(), and reset().

bool CmsShowViewPopup::m_mapped
private

Definition at line 112 of file CmsShowViewPopup.h.

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

ViewerParameterGUI* CmsShowViewPopup::m_paramGUI
private

Definition at line 115 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

TGTextButton* CmsShowViewPopup::m_saveImageButton
private

Definition at line 116 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

FWViewBase* CmsShowViewPopup::m_viewBase
private

Definition at line 120 of file CmsShowViewPopup.h.

Referenced by reset(), and saveImage().

TGLabel* CmsShowViewPopup::m_viewLabel
private

Definition at line 114 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().