CMS 3D CMS Logo

Public Member Functions | Private Attributes

ViewerParameterGUI Class Reference

#include <CmsShowViewPopup.h>

Inheritance diagram for ViewerParameterGUI:
FWParameterSetterEditorBase

List of all members.

Public Member Functions

void addFrameToContainer (TGCompositeFrame *)
ViewerParameterGUIaddParam (const FWParameterBase *)
TGCompositeFrame * getTabContainer ()
void populateComplete ()
ViewerParameterGUIrequestTab (const char *)
void reset ()
ViewerParameterGUIseparator ()
 ViewerParameterGUI (const TGFrame *)
virtual ~ViewerParameterGUI ()

Private Attributes

std::string m_selectedTabName
std::vector< boost::shared_ptr
< FWParameterSetterBase > > 
m_setters
TGTab * m_tab

Detailed Description

Definition at line 50 of file CmsShowViewPopup.h.


Constructor & Destructor Documentation

ViewerParameterGUI::ViewerParameterGUI ( const TGFrame *  p)

Definition at line 195 of file CmsShowViewPopup.cc.

                                                      :
   TGCompositeFrame(p),
   m_tab(0),
   m_selectedTabName("Style")
{
   SetCleanup(kDeepCleanup);
}
virtual ViewerParameterGUI::~ViewerParameterGUI ( ) [inline, virtual]

Definition at line 55 of file CmsShowViewPopup.h.

{}

Member Function Documentation

void ViewerParameterGUI::addFrameToContainer ( TGCompositeFrame *  x)

Definition at line 288 of file CmsShowViewPopup.cc.

References m_tab, and dbtoconf::parent.

Referenced by FWEveView::populateController().

{
   assert (m_tab);
   TGCompositeFrame* parent =  m_tab->GetCurrentContainer();
   parent->AddFrame(x,new TGLayoutHints(kLHintsExpandX,4 ,4, 2, 2) );

   parent->MapSubwindows();
   parent->Layout();
   m_tab->Layout();
   parent->Resize(parent->GetDefaultSize());
}
ViewerParameterGUI & ViewerParameterGUI::addParam ( const FWParameterBase param)

Definition at line 247 of file CmsShowViewPopup.cc.

References m_setters, m_tab, FWParameterSetterBase::makeSetterFor(), and dbtoconf::parent.

Referenced by FW3DViewBase::populateController(), FWTriggerTableView::populateController(), and FWRPZView::populateController().

{
   boost::shared_ptr<FWParameterSetterBase> ptr( FWParameterSetterBase::makeSetterFor((FWParameterBase*)param) );
   ptr->attach((FWParameterBase*)param, this);
   TGCompositeFrame* parent = m_tab->GetCurrentContainer();

   TGFrame* pframe = ptr->build(parent);
   parent->AddFrame(pframe, new TGLayoutHints(kLHintsExpandX));
   m_setters.push_back(ptr);

   pframe->MapWindow();
   pframe->MapSubwindows();
   pframe->Layout();
   parent->MapSubwindows();
   parent->Layout();
   m_tab->Layout();
   parent->Resize(parent->GetDefaultSize());
   return *this;
}
TGCompositeFrame * ViewerParameterGUI::getTabContainer ( )
void ViewerParameterGUI::populateComplete ( )

Definition at line 301 of file CmsShowViewPopup.cc.

References m_selectedTabName, m_tab, and x.

Referenced by CmsShowViewPopup::reset().

{
   // Set tab - same as it was before, if not exisiting select first time.
   if (m_tab) 
   {
      bool x = m_tab->SetTab(m_selectedTabName.c_str(), false);
      if (!x) m_tab->SetTab("Style");
   }
}
ViewerParameterGUI & ViewerParameterGUI::requestTab ( const char *  name)
void ViewerParameterGUI::reset ( void  )

Definition at line 204 of file CmsShowViewPopup.cc.

References f, m_selectedTabName, m_setters, and m_tab.

Referenced by CmsShowViewPopup::reset().

{  
   // remember selected tab
   if (m_tab) 
      m_selectedTabName =  m_tab->GetCurrentTab()->GetString();
   else
      m_selectedTabName = "Style";

   // remove TGTab as the only child
   m_setters.clear();
   if (m_tab)
   {
      assert(GetList()->GetSize() == 1);
      TGFrameElement *el = (TGFrameElement*) GetList()->First();
      TGFrame* f = el->fFrame;

      assert (f == m_tab);
      f->UnmapWindow();
      RemoveFrame(f);
      f->DeleteWindow();
      m_tab = 0;
   }
}
ViewerParameterGUI & ViewerParameterGUI::separator ( )

Definition at line 271 of file CmsShowViewPopup.cc.

References m_tab, and alignCSCRings::s.

Referenced by FW3DViewBase::populateController(), and FWGeometryTableView::populateController().

{
   assert(m_tab);
   TGHorizontal3DLine* s = new TGHorizontal3DLine(m_tab->GetCurrentContainer());
   m_tab->GetCurrentContainer()->AddFrame(s, new TGLayoutHints(kLHintsExpandX,4 ,4, 2, 2));

   return *this;
}

Member Data Documentation

Definition at line 68 of file CmsShowViewPopup.h.

Referenced by populateComplete(), and reset().

std::vector<boost::shared_ptr<FWParameterSetterBase> > ViewerParameterGUI::m_setters [private]

Definition at line 70 of file CmsShowViewPopup.h.

Referenced by addParam(), and reset().

TGTab* ViewerParameterGUI::m_tab [private]