CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 ()
 
 ClassDefOverride (CmsShowViewPopup, 0)
 
void CloseWindow () override
 
 CmsShowViewPopup (const TGWindow *p=nullptr, UInt_t w=200, UInt_t h=200, FWColorManager *cm=nullptr, FWViewBase *wb=nullptr, TEveWindow *ew=nullptr)
 
TEveWindow * getEveWindow () const
 
bool mapped ()
 
void MapWindow () override
 
void reset (FWViewBase *, TEveWindow *ew)
 
void saveImage ()
 
void UnmapWindow () override
 
 ~CmsShowViewPopup () override
 

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 73 of file CmsShowViewPopup.h.

Constructor & Destructor Documentation

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

Definition at line 43 of file CmsShowViewPopup.cc.

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

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

Definition at line 99 of file CmsShowViewPopup.cc.

99 {}
CmsShowViewPopup::CmsShowViewPopup ( const CmsShowViewPopup )
private

Member Function Documentation

void CmsShowViewPopup::backgroundColorWasChanged ( )

Definition at line 160 of file CmsShowViewPopup.cc.

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

Referenced by CmsShowViewPopup().

160  {
162  m_changeBackground->SetText("Change Background Color to White");
163  } else {
164  m_changeBackground->SetText("Change Background Color to Black");
165  }
166 }
BackgroundColorIndex backgroundColorIndex() const
TGTextButton * m_changeBackground
FWColorManager * m_colorManager
void CmsShowViewPopup::changeBackground ( )
CmsShowViewPopup::ClassDefOverride ( CmsShowViewPopup  ,
 
)
void CmsShowViewPopup::CloseWindow ( )
override

Definition at line 134 of file CmsShowViewPopup.cc.

References closed_, and UnmapWindow().

134  {
135  UnmapWindow();
136  closed_.emit();
137 }
void UnmapWindow() override
sigc::signal< void()> closed_
TEveWindow* CmsShowViewPopup::getEveWindow ( ) const
inline

Definition at line 100 of file CmsShowViewPopup.h.

References m_eveWindow.

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

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

Definition at line 93 of file CmsShowViewPopup.h.

References m_mapped.

Referenced by FWGUIManager::checkSubviewAreaIconState().

93 { return m_mapped; }
void CmsShowViewPopup::MapWindow ( )
override

Definition at line 139 of file CmsShowViewPopup.cc.

References m_mapped.

139  {
140  TGWindow::MapWindow();
141  m_mapped = true;
142 }
const CmsShowViewPopup& CmsShowViewPopup::operator= ( const CmsShowViewPopup )
private
void CmsShowViewPopup::reset ( FWViewBase vb,
TEveWindow *  ew 
)

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

101  {
102  m_viewBase = vb;
103  m_eveWindow = ew;
104 
105  m_paramGUI->reset();
106 
107  // fill content
108  if (m_viewBase) {
109  m_saveImageButton->SetEnabled(kTRUE);
110  m_viewLabel->SetText(m_viewBase->typeName().c_str());
113 
114  fMain = m_eveWindow->GetEveFrame();
115 
116  if (vb->typeId() >= FWViewType::kTable)
117  m_saveImageButton->SetText("Print Text To Terminal");
118  else
119  m_saveImageButton->SetText("Save Image ...");
120  } else {
121  fMain = nullptr;
122  m_viewLabel->SetText("No view selected");
123  m_saveImageButton->SetEnabled(kFALSE);
124  }
125 
126  MapSubwindows();
127  Resize(GetDefaultSize());
128  Layout();
129  if (fMain) {
130  CenterOnParent(kTRUE, TGTransientFrame::kTopRight);
131  }
132 }
const std::string & typeName() const
Definition: FWViewBase.cc:107
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 149 of file CmsShowViewPopup.cc.

References m_viewBase, and FWViewBase::promptForSaveImageTo().

149  {
150  if (m_viewBase)
152 }
FWViewBase * m_viewBase
void promptForSaveImageTo(TGFrame *) const
Definition: FWViewBase.cc:62
void CmsShowViewPopup::UnmapWindow ( )
override

Definition at line 144 of file CmsShowViewPopup.cc.

References m_mapped.

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

144  {
145  TGWindow::UnmapWindow();
146  m_mapped = false;
147 }

Member Data Documentation

sigc::signal<void()> CmsShowViewPopup::closed_

Definition at line 102 of file CmsShowViewPopup.h.

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

TGTextButton* CmsShowViewPopup::m_changeBackground
private

Definition at line 118 of file CmsShowViewPopup.h.

Referenced by backgroundColorWasChanged(), and CmsShowViewPopup().

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

Definition at line 122 of file CmsShowViewPopup.h.

Referenced by getEveWindow(), and reset().

bool CmsShowViewPopup::m_mapped
private

Definition at line 113 of file CmsShowViewPopup.h.

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

ViewerParameterGUI* CmsShowViewPopup::m_paramGUI
private

Definition at line 116 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

TGTextButton* CmsShowViewPopup::m_saveImageButton
private

Definition at line 117 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

FWViewBase* CmsShowViewPopup::m_viewBase
private

Definition at line 121 of file CmsShowViewPopup.h.

Referenced by reset(), and saveImage().

TGLabel* CmsShowViewPopup::m_viewLabel
private

Definition at line 115 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().