#include <Fireworks/Core/interface/CmsShowViewPopup.h>
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 CmsShowViewPopup & | operator= (const CmsShowViewPopup &) |
Private Attributes | |
TGTextButton * | m_changeBackground |
FWColorManager * | m_colorManager |
TEveWindow * | m_eveWindow |
bool | m_mapped |
ViewerParameterGUI * | m_paramGUI |
TGTextButton * | m_saveImageButton |
FWViewBase * | m_viewBase |
TGLabel * | m_viewLabel |
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 76 of file CmsShowViewPopup.h.
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.
: TGTransientFrame(gClient->GetDefaultRoot(),p, w, h), m_mapped(kFALSE), m_viewLabel(0), m_paramGUI(0), m_saveImageButton(0), m_changeBackground(0), m_colorManager(iCMgr), m_viewBase(0), m_eveWindow(0) { m_colorManager->colorsHaveChanged_.connect(boost::bind(&CmsShowViewPopup::backgroundColorWasChanged,this)); SetCleanup(kDeepCleanup); // label TGHorizontalFrame* viewFrame = new TGHorizontalFrame(this); m_viewLabel = new TGLabel(viewFrame, "No view selected"); try { TGFont* defaultFont = gClient->GetFontPool()->GetFont(m_viewLabel->GetDefaultFontStruct()); m_viewLabel->SetTextFont(gClient->GetFontPool()->GetFont(defaultFont->GetFontAttributes().fFamily, 14, defaultFont->GetFontAttributes().fWeight + 2, defaultFont->GetFontAttributes().fSlant)); } catch(...) { // FIXME: looks like under certain conditions (e.g. in full framework) // GetFontPool() throws when the default font is not found. This is a // quick workaround, but we should probably investigate more. } m_viewLabel->SetTextJustify(kTextLeft); viewFrame->AddFrame(m_viewLabel, new TGLayoutHints(kLHintsExpandX)); AddFrame(viewFrame, new TGLayoutHints(kLHintsExpandX, 2, 2, 0, 0)); // background m_changeBackground = new TGTextButton(this,"Change Background Color"); backgroundColorWasChanged(); AddFrame(m_changeBackground, new TGLayoutHints(kLHintsExpandX, 2, 2, 5, 5)); m_changeBackground->Connect("Clicked()","CmsShowViewPopup",this,"changeBackground()"); // save image m_saveImageButton= new TGTextButton(this,"Save Image ..."); AddFrame(m_saveImageButton, new TGLayoutHints(kLHintsExpandX, 2, 2, 5, 5)); m_saveImageButton->Connect("Clicked()","CmsShowViewPopup",this,"saveImage()"); // content frame AddFrame(new TGHorizontal3DLine(this), new TGLayoutHints(kLHintsExpandX, 0, 0, 5, 5)); m_paramGUI = new ViewerParameterGUI(this); AddFrame(m_paramGUI,new TGLayoutHints(kLHintsExpandX|kLHintsExpandY)); SetWindowName("View Controller"); }
CmsShowViewPopup::~CmsShowViewPopup | ( | ) | [virtual] |
Definition at line 101 of file CmsShowViewPopup.cc.
{ }
CmsShowViewPopup::CmsShowViewPopup | ( | const CmsShowViewPopup & | ) | [private] |
void CmsShowViewPopup::backgroundColorWasChanged | ( | ) |
Definition at line 184 of file CmsShowViewPopup.cc.
References FWColorManager::backgroundColorIndex(), FWColorManager::kBlackIndex, m_changeBackground, and m_colorManager.
Referenced by CmsShowViewPopup().
{ if (FWColorManager::kBlackIndex == m_colorManager->backgroundColorIndex()) { m_changeBackground->SetText("Change Background Color to White"); } else { m_changeBackground->SetText("Change Background Color to Black"); } }
void CmsShowViewPopup::changeBackground | ( | ) |
Definition at line 176 of file CmsShowViewPopup.cc.
References FWColorManager::backgroundColorIndex(), FWColorManager::kBlackIndex, FWColorManager::kWhiteIndex, m_colorManager, and FWColorManager::setBackgroundColorIndex().
CmsShowViewPopup::ClassDef | ( | CmsShowViewPopup | , |
0 | |||
) |
void CmsShowViewPopup::CloseWindow | ( | ) | [virtual] |
Definition at line 148 of file CmsShowViewPopup.cc.
References closed_, and UnmapWindow().
{ UnmapWindow(); closed_.emit(); }
TEveWindow* CmsShowViewPopup::getEveWindow | ( | ) | const [inline] |
Definition at line 99 of file CmsShowViewPopup.h.
References m_eveWindow.
Referenced by FWGUIManager::checkSubviewAreaIconState(), and FWGUIManager::popupViewClosed().
{ return m_eveWindow; }
bool CmsShowViewPopup::mapped | ( | ) | [inline] |
Definition at line 92 of file CmsShowViewPopup.h.
References m_mapped.
Referenced by FWGUIManager::checkSubviewAreaIconState().
{ return m_mapped; }
void CmsShowViewPopup::MapWindow | ( | ) | [virtual] |
Definition at line 155 of file CmsShowViewPopup.cc.
References m_mapped.
{ TGWindow::MapWindow(); m_mapped = true; }
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().
{ m_viewBase = vb; m_eveWindow = ew; m_paramGUI->reset(); // fill content if (m_viewBase) { m_saveImageButton->SetEnabled(kTRUE); m_viewLabel->SetText(m_viewBase->typeName().c_str()); m_viewBase->populateController(*m_paramGUI); m_paramGUI->populateComplete(); fMain = m_eveWindow->GetEveFrame(); if (vb->typeId() >= FWViewType::kTable) m_saveImageButton->SetText("Print Text To Terminal"); else m_saveImageButton->SetText("Save Image ..."); } else { fMain = 0; m_viewLabel->SetText("No view selected"); m_saveImageButton->SetEnabled(kFALSE); } MapSubwindows(); Resize(GetDefaultSize()); Layout(); if (fMain) { CenterOnParent(kTRUE, TGTransientFrame::kTopRight); } }
void CmsShowViewPopup::saveImage | ( | ) |
Definition at line 169 of file CmsShowViewPopup.cc.
References m_viewBase, and FWViewBase::promptForSaveImageTo().
{ if (m_viewBase) m_viewBase->promptForSaveImageTo(this); }
void CmsShowViewPopup::UnmapWindow | ( | ) | [virtual] |
Definition at line 162 of file CmsShowViewPopup.cc.
References m_mapped.
Referenced by CloseWindow(), FWGUIManager::setViewPopup(), and FWGUIManager::subviewInfoUnselected().
{ TGWindow::UnmapWindow(); m_mapped = false; }
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] |
Definition at line 119 of file CmsShowViewPopup.h.
Referenced by backgroundColorWasChanged(), changeBackground(), and CmsShowViewPopup().
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().