CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ViewerParameterGUI Class Reference

#include <CmsShowViewPopup.h>

Inheritance diagram for ViewerParameterGUI:
FWParameterSetterEditorBase

Public Member Functions

void addFrameToContainer (TGCompositeFrame *)
 
ViewerParameterGUIaddParam (const FWParameterBase *)
 
TGCompositeFrame * getTabContainer ()
 
void populateComplete ()
 
ViewerParameterGUIrequestTab (const char *)
 
void reset ()
 
ViewerParameterGUIseparator ()
 
 ViewerParameterGUI (const TGFrame *)
 
virtual ~ViewerParameterGUI ()
 
- Public Member Functions inherited from FWParameterSetterEditorBase
 FWParameterSetterEditorBase ()
 
virtual void updateEditor ()
 
virtual ~FWParameterSetterEditorBase ()
 

Private Attributes

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

Detailed Description

Definition at line 49 of file CmsShowViewPopup.h.

Constructor & Destructor Documentation

ViewerParameterGUI::ViewerParameterGUI ( const TGFrame *  p)

Definition at line 194 of file CmsShowViewPopup.cc.

194  :
195  TGCompositeFrame(p),
196  m_tab(0),
197  m_selectedTabName("Style")
198 {
199  SetCleanup(kDeepCleanup);
200 }
std::string m_selectedTabName
virtual ViewerParameterGUI::~ViewerParameterGUI ( )
inlinevirtual

Member Function Documentation

void ViewerParameterGUI::addFrameToContainer ( TGCompositeFrame *  x)

Definition at line 287 of file CmsShowViewPopup.cc.

References m_tab, and class-composition::parent.

Referenced by FWEveView::populateController(), and ~ViewerParameterGUI().

288 {
289  assert (m_tab);
290  TGCompositeFrame* parent = m_tab->GetCurrentContainer();
291  parent->AddFrame(x,new TGLayoutHints(kLHintsExpandX,4 ,4, 2, 2) );
292 
293  parent->MapSubwindows();
294  parent->Layout();
295  m_tab->Layout();
296  parent->Resize(parent->GetDefaultSize());
297 }
ViewerParameterGUI & ViewerParameterGUI::addParam ( const FWParameterBase param)

Definition at line 246 of file CmsShowViewPopup.cc.

References m_setters, m_tab, FWParameterSetterBase::makeSetterFor(), and class-composition::parent.

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

247 {
248  std::shared_ptr<FWParameterSetterBase> ptr( FWParameterSetterBase::makeSetterFor((FWParameterBase*)param) );
249  ptr->attach((FWParameterBase*)param, this);
250  TGCompositeFrame* parent = m_tab->GetCurrentContainer();
251 
252  TGFrame* pframe = ptr->build(parent);
253  parent->AddFrame(pframe, new TGLayoutHints(kLHintsExpandX));
254  m_setters.push_back(ptr);
255 
256  pframe->MapWindow();
257  pframe->MapSubwindows();
258  pframe->Layout();
259  parent->MapSubwindows();
260  parent->Layout();
261  m_tab->Layout();
262  parent->Resize(parent->GetDefaultSize());
263  return *this;
264 }
std::vector< std::shared_ptr< FWParameterSetterBase > > m_setters
static std::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
TGCompositeFrame * ViewerParameterGUI::getTabContainer ( )
void ViewerParameterGUI::populateComplete ( )

Definition at line 300 of file CmsShowViewPopup.cc.

References m_selectedTabName, m_tab, and x.

Referenced by CmsShowViewPopup::reset(), and ~ViewerParameterGUI().

301 {
302  // Set tab - same as it was before, if not exisiting select first time.
303  if (m_tab)
304  {
305  bool x = m_tab->SetTab(m_selectedTabName.c_str(), false);
306  if (!x) m_tab->SetTab("Style");
307  }
308 }
std::string m_selectedTabName
ViewerParameterGUI & ViewerParameterGUI::requestTab ( const char *  name)

Definition at line 228 of file CmsShowViewPopup.cc.

References m_tab.

Referenced by FWGeometryTableView::populateController(), FWOverlapTableView::populateController(), FWRPZView::populateController(), FW3DViewBase::populateController(), FWLegoViewBase::populateController(), FWEveView::populateController(), FWTriggerTableView::populateController(), FWGeometryTableViewBase::populateController(), and ~ViewerParameterGUI().

229 {
230  if (!m_tab)
231  {
232  m_tab = new TGTab(this);
233  AddFrame(m_tab, new TGLayoutHints(kLHintsExpandX |kLHintsExpandY ));
234  }
235 
236  if (!m_tab->GetTabContainer(name))
237  m_tab->AddTab(name);
238 
239  m_tab->SetTab(name);
240 
241  return *this;
242 }
void ViewerParameterGUI::reset ( void  )

Definition at line 203 of file CmsShowViewPopup.cc.

References f, m_selectedTabName, m_setters, and m_tab.

Referenced by CmsShowViewPopup::mapped(), CmsShowViewPopup::reset(), and ~ViewerParameterGUI().

204 {
205  // remember selected tab
206  if (m_tab)
207  m_selectedTabName = m_tab->GetCurrentTab()->GetString();
208  else
209  m_selectedTabName = "Style";
210 
211  // remove TGTab as the only child
212  m_setters.clear();
213  if (m_tab)
214  {
215  assert(GetList()->GetSize() == 1);
216  TGFrameElement *el = (TGFrameElement*) GetList()->First();
217  TGFrame* f = el->fFrame;
218 
219  assert (f == m_tab);
220  f->UnmapWindow();
221  RemoveFrame(f);
222  f->DeleteWindow();
223  m_tab = 0;
224  }
225 }
std::string m_selectedTabName
double f[11][100]
std::vector< std::shared_ptr< FWParameterSetterBase > > m_setters
ViewerParameterGUI & ViewerParameterGUI::separator ( )

Definition at line 270 of file CmsShowViewPopup.cc.

References m_tab, and alignCSCRings::s.

Referenced by FW3DViewBase::populateController(), and ~ViewerParameterGUI().

271 {
272  assert(m_tab);
273  TGHorizontal3DLine* s = new TGHorizontal3DLine(m_tab->GetCurrentContainer());
274  m_tab->GetCurrentContainer()->AddFrame(s, new TGLayoutHints(kLHintsExpandX,4 ,4, 2, 2));
275 
276  return *this;
277 }

Member Data Documentation

std::string ViewerParameterGUI::m_selectedTabName
private

Definition at line 67 of file CmsShowViewPopup.h.

Referenced by populateComplete(), and reset().

std::vector<std::shared_ptr<FWParameterSetterBase> > ViewerParameterGUI::m_setters
private

Definition at line 69 of file CmsShowViewPopup.h.

Referenced by addParam(), and reset().

TGTab* ViewerParameterGUI::m_tab
private