CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

CmsShowViewPopup Class Reference

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

List of all members.

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.

                                                                                                                               :
   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(kLHintsNormal, 0, 0, 5, 5));
   m_changeBackground->Connect("Clicked()","CmsShowViewPopup",this,"changeBackground()");
   // save image
   m_saveImageButton= new TGTextButton(this,"Save Image ...");
   AddFrame(m_saveImageButton);
   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 100 of file CmsShowViewPopup.cc.

{
}
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().

{
   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 ( )
CmsShowViewPopup::ClassDef ( CmsShowViewPopup  ,
 
)
void CmsShowViewPopup::CloseWindow ( ) [virtual]

Definition at line 137 of file CmsShowViewPopup.cc.

References closed_, and UnmapWindow().

{
   UnmapWindow();
   closed_.emit();
}
TEveWindow* CmsShowViewPopup::getEveWindow ( ) const [inline]

Definition at line 97 of file CmsShowViewPopup.h.

References m_eveWindow.

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

{ return m_eveWindow; }
bool CmsShowViewPopup::mapped ( ) [inline]

Definition at line 90 of file CmsShowViewPopup.h.

References m_mapped.

Referenced by FWGUIManager::checkSubviewAreaIconState().

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

Definition at line 144 of file CmsShowViewPopup.cc.

References m_mapped.

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().

{
   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();
   }
   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 ( )
void CmsShowViewPopup::UnmapWindow ( ) [virtual]

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().

TEveWindow* CmsShowViewPopup::m_eveWindow [private]

Definition at line 119 of file CmsShowViewPopup.h.

Referenced by getEveWindow(), and reset().

Definition at line 110 of file CmsShowViewPopup.h.

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

Definition at line 113 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

Definition at line 114 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

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().