CMS 3D CMS Logo

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

#include <FWDialogBuilder.h>

Inheritance diagram for FWDialogBuilder:
FWLayoutBuilder

Public Member Functions

FWDialogBuilderaddCheckbox (const char *text, TGCheckButton **out=nullptr)
 
FWDialogBuilderaddColorPicker (const FWColorManager *manager, FWColorSelect **out=nullptr)
 
FWDialogBuilderaddHSeparator (size_t horizontalPadding=4, size_t verticalPadding=3)
 
FWDialogBuilderaddHSlider (size_t size, TGHSlider **out=nullptr)
 
FWDialogBuilderaddHtml (TGHtml **out=nullptr)
 
FWDialogBuilderaddLabel (const char *text, size_t fontSize=12, size_t weight=0, TGLabel **out=nullptr)
 
FWDialogBuilderaddNumberEntry (float defaultValue, size_t digits, TGNumberFormat::EStyle style, int min, int max, TGNumberEntry **out)
 
FWDialogBuilderaddTable (FWTableManagerBase *manager, FWTableWidget **out=nullptr)
 
FWDialogBuilderaddTextButton (const char *text, TGTextButton **out=nullptr)
 
FWDialogBuilderaddTextEdit (const char *defaultText=nullptr, TGTextEdit **out=nullptr)
 
FWDialogBuilderaddTextEntry (const char *defaultText, TGTextEntry **out)
 
FWDialogBuilderaddTextView (const char *defaultText=nullptr, TGTextView **out=nullptr)
 
FWDialogBuilderaddValidatingTextEntry (const char *defaultText, FWGUIValidatingTextEntry **out)
 
FWDialogBuilderbeginTab (const char *label)
 
FWDialogBuilderendTab (void)
 
FWDialogBuilderexpand (size_t expandX=true, size_t expandY=false)
 
FWDialogBuilderfloatLeft (size_t spacing=3)
 
FWDialogBuilderframeSpaceDown (size_t spacing=3)
 
FWDialogBuilderframeSpaceLeft (size_t spacing=3)
 
FWDialogBuilderframeSpaceLeftRight (size_t spacing=3)
 
FWDialogBuilderframeSpaceRight (size_t spacing=3)
 
FWDialogBuilderframeSpaceUp (size_t spacing=3)
 
FWDialogBuilderframeSpaceUpDown (size_t spacing=3)
 
 FWDialogBuilder (TGCompositeFrame *window, FWDialogBuilder *parent=nullptr, bool expandY=true)
 
FWDialogBuilderhSpacer (size_t size=0)
 
FWDialogBuilderindent (int left=2, int right=-1)
 
FWDialogBuildernewRow ()
 
FWDialogBuilderspaceDown (size_t spacing=3)
 
FWDialogBuilderspaceLeft (size_t spacing=3)
 
FWDialogBuilderspaceLeftRight (size_t spacing=3)
 
FWDialogBuilderspaceRight (size_t spacing=3)
 
FWDialogBuilderspaceUp (size_t spacing=3)
 
FWDialogBuilderspaceUpDown (size_t spacing=3)
 
FWDialogBuildertabs (TGTab **out)
 
FWDialogBuilderunindent (void)
 
FWDialogBuilderuntabs (void)
 
FWDialogBuildervSpacer (size_t size=0)
 

Protected Member Functions

template<class T >
FWDialogBuilderextract (T *in, T **out)
 
- Protected Member Functions inherited from FWLayoutBuilder
TGCompositeFrame * currentFrame (void)
 
FWLayoutBuilderexpand (bool expandX=true, bool expandY=false)
 
FWLayoutBuilderfloatLeft (size_t spacing)
 
void frameForTab ()
 
FWLayoutBuilderframeSpaceDown (size_t spacing)
 
FWLayoutBuilderframeSpaceLeft (size_t spacing)
 
FWLayoutBuilderframeSpaceRight (size_t spacing)
 
FWLayoutBuilderframeSpaceUp (size_t spacing)
 
 FWLayoutBuilder (TGCompositeFrame *window, bool expandY=true)
 
FWLayoutBuilderindent (int left=2, int right=-1)
 
bool isFloatingLeft ()
 
FWLayoutBuildernewRow ()
 
TGCompositeFrame * nextFrame ()
 
TGLayoutHints * nextHints ()
 
FWLayoutBuilderspaceDown (size_t spacing)
 
FWLayoutBuilderspaceLeft (size_t spacing)
 
FWLayoutBuilderspaceRight (size_t spacing)
 
FWLayoutBuilderspaceUp (size_t spacing)
 
FWLayoutBuilderunindent (void)
 
TGVerticalFrame * verticalFrame ()
 

Private Attributes

FWDialogBuilderm_parent
 
TGTab * m_tabs
 

Detailed Description

Helper class to construct dialogs in a more readable ways.

Encapsulated TGUI layout hiccups and exposes the developer an API which allows to layout items in a top->bottom, right->left manner.

Example:

FWDialogBuilder builder(parent); parent.newRow(2) // New row which has a 2 pixel padding on top. .addLabel("MyLabel:") // A new label. .indent(20) // Whatever follows is indented 20 pixels on the right. .addLabel("MyLabel2") // Another label. .spaceDown(4) .addTextButton("Aligned to MyLabel2 ").floatLeft() .addTextButton("Same Row as previous") .unindent() // back one level in the indentation. .addLabel("Aligned to MyLabel:")

Because in ROOT layout and parenting of widgets are mixed we need to take responsibility for creating the widget objects (sigh!), so we have one "addXYZ" method per widget that can be added. If we find our way around this it would be better to have a generic "addWidget()" method and create widgets outside this class.

TODO: For higher configurability we should have an "addWithCallback(Callbak)" method which can be used to specify a generic widget creation action.

Definition at line 93 of file FWDialogBuilder.h.

Constructor & Destructor Documentation

◆ FWDialogBuilder()

FWDialogBuilder::FWDialogBuilder ( TGCompositeFrame *  window,
FWDialogBuilder parent = nullptr,
bool  expandY = true 
)

Helper class to construct dialogs in a more readable ways.

Encapsulated TGUI layout hiccups and exposes the developer an API which allows to layout items in a top->bottom, right->left manner.

Example:

FWDialogBuilder builder(parent); parent.newRow(2) // New row which has a 2 pixel padding on top. .addLabel("MyLabel:") // A new label. .indent(20) // Whatever follows is indented 20 pixels on the right. .addLabel("MyLabel2") // Another label. .spaceDown(4) .addTextButton("Aligned to MyLabel2 ").floatLeft() .addTextButton("Same Row as previous") .unindent() // back one level in the indentation. .addLabel("Aligned to MyLabel:")

Because in ROOT layout and parenting of widgets are mixed we need to take responsibility for creating the widget objects (sigh!), so we have one "addXYZ" method per widget that can be added. If we find our way around this it would be better to have a generic "addWidget()" method and create widgets outside this class.

TODO: For higher configurability we should have an "addWithCallback(Callbak)" method which can be used to specify a generic widget creation action.

Definition at line 194 of file FWDialogBuilder.cc.

195  : FWLayoutBuilder(window, expandY), m_parent(parent), m_tabs(nullptr) {}

Referenced by beginTab().

Member Function Documentation

◆ addCheckbox()

FWDialogBuilder & FWDialogBuilder::addCheckbox ( const char *  text,
TGCheckButton **  out = nullptr 
)

Definition at line 327 of file FWDialogBuilder.cc.

327  {
328  TGCheckButton *button = new TGCheckButton(nextFrame(), text);
329  button->SetState(kButtonDown, false);
330  button->SetEnabled(false);
331  currentFrame()->AddFrame(button, nextHints());
332 
333  return extract(button, out);
334 }

References FWLayoutBuilder::currentFrame(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), MillePedeFileConverter_cfg::out, and runonSM::text.

Referenced by CmsShowEDI::CmsShowEDI(), CmsShowModelPopup::CmsShowModelPopup(), and FWGUIEventDataAdder::createWindow().

◆ addColorPicker()

FWDialogBuilder & FWDialogBuilder::addColorPicker ( const FWColorManager manager,
FWColorSelect **  out = nullptr 
)

Definition at line 265 of file FWDialogBuilder.cc.

265  {
266  const char *graphicsLabel = " ";
267  FWColorSelect *widget = new FWColorSelect(nextFrame(), graphicsLabel, 0, manager, -1);
268 
269  currentFrame()->AddFrame(widget, nextHints());
270  widget->SetEnabled(kFALSE);
271 
272  return extract(widget, out);
273 }

References FWLayoutBuilder::currentFrame(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.

Referenced by CmsShowEDI::CmsShowEDI(), and CmsShowModelPopup::CmsShowModelPopup().

◆ addHSeparator()

FWDialogBuilder & FWDialogBuilder::addHSeparator ( size_t  horizontalPadding = 4,
size_t  verticalPadding = 3 
)

Definition at line 345 of file FWDialogBuilder.cc.

345  {
346  TGLayoutHints *hints =
347  new TGLayoutHints(kLHintsExpandX, horizontalPadding, horizontalPadding, verticalPadding, verticalPadding);
348 
349  TGHorizontal3DLine *separator = new TGHorizontal3DLine(nextFrame(), 200, 2);
350  currentFrame()->AddFrame(separator, hints);
351  return newRow();
352 }

References FWLayoutBuilder::currentFrame(), newRow(), FWLayoutBuilder::nextFrame(), and mps_merge::separator.

Referenced by CmsShowEDI::CmsShowEDI(), and CmsShowModelPopup::CmsShowModelPopup().

◆ addHSlider()

FWDialogBuilder & FWDialogBuilder::addHSlider ( size_t  size,
TGHSlider **  out = nullptr 
)

Definition at line 275 of file FWDialogBuilder.cc.

275  {
276  TGHSlider *slider = new TGHSlider(nextFrame(), size, kSlider1);
277  currentFrame()->AddFrame(slider, nextHints());
278  slider->SetRange(0, 100);
279  slider->SetPosition(100);
280  slider->SetEnabled(false);
281 
282  return extract(slider, out);
283 }

References FWLayoutBuilder::currentFrame(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), MillePedeFileConverter_cfg::out, and findQualityFiles::size.

Referenced by CmsShowEDI::CmsShowEDI(), and CmsShowModelPopup::CmsShowModelPopup().

◆ addHtml()

FWDialogBuilder & FWDialogBuilder::addHtml ( TGHtml **  out = nullptr)

Definition at line 249 of file FWDialogBuilder.cc.

249  {
250  TGHtml *html = new TGHtml(nextFrame(), 100, 100);
251  currentFrame()->AddFrame(html, nextHints());
252  expand(true, true);
253  return extract(html, out);
254 }

References FWLayoutBuilder::currentFrame(), expand(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.

◆ addLabel()

FWDialogBuilder & FWDialogBuilder::addLabel ( const char *  text,
size_t  fontSize = 12,
size_t  weight = 0,
TGLabel **  out = nullptr 
)

Definition at line 212 of file FWDialogBuilder.cc.

215  {
216  TGLabel *label = new TGLabel(nextFrame(), text);
217 
218  if (fontSize != 0) {
219  FontStruct_t defaultFontStruct = label->GetDefaultFontStruct();
220  try {
221  TGFontPool *pool = gClient->GetFontPool();
222  TGFont *defaultFont = pool->GetFont(defaultFontStruct);
223  FontAttributes_t attributes = defaultFont->GetFontAttributes();
224  label->SetTextFont(pool->GetFont(attributes.fFamily, fontSize, attributes.fWeight, attributes.fSlant));
225  } catch (...) {
226  // Ignore exceptions.
227  }
228  }
229 
230  label->SetTextJustify(kTextLeft);
231 
232  TGLayoutHints *hints = nextHints();
233  UInt_t style = hints->GetLayoutHints() | kLHintsCenterY;
234  hints->SetLayoutHints(style);
235  currentFrame()->AddFrame(label, hints);
236 
237  return extract(label, out);
238 }

References FWLayoutBuilder::currentFrame(), extract(), label, FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), MillePedeFileConverter_cfg::out, submitPVResolutionJobs::pool, and runonSM::text.

Referenced by CmsShowEDI::CmsShowEDI(), CmsShowModelPopup::CmsShowModelPopup(), FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().

◆ addNumberEntry()

FWDialogBuilder & FWDialogBuilder::addNumberEntry ( float  defaultValue,
size_t  digits,
TGNumberFormat::EStyle  style,
int  min,
int  max,
TGNumberEntry **  out 
)

Definition at line 309 of file FWDialogBuilder.cc.

310  {
311  TGNumberEntry *entry = new TGNumberEntry(nextFrame(),
312  defaultValue,
313  digits,
314  -1,
315  style,
316  TGNumberFormat::kNEAAnyNumber,
317  TGNumberFormat::kNELLimitMinMax,
318  min,
319  max);
320  currentFrame()->AddFrame(entry, nextHints());
321  entry->GetNumberEntry()->SetEnabled(kFALSE);
322  entry->GetButtonUp()->SetEnabled(kFALSE);
323  entry->GetButtonDown()->SetEnabled(kFALSE);
324  return extract(entry, out);
325 }

References FWLayoutBuilder::currentFrame(), mps_splice::entry, extract(), SiStripPI::max, min(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.

Referenced by CmsShowEDI::CmsShowEDI().

◆ addTable()

FWDialogBuilder & FWDialogBuilder::addTable ( FWTableManagerBase manager,
FWTableWidget **  out = nullptr 
)

Definition at line 336 of file FWDialogBuilder.cc.

336  {
337  expand(true, true);
338  TGCompositeFrame *frame = verticalFrame();
339  TGLayoutHints *hints = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY);
340  FWTableWidget *table = new FWTableWidget(manager, frame);
341  frame->AddFrame(table, hints);
342  return extract(table, out);
343 }

References expand(), extract(), amptDefault_cfi::frame, MillePedeFileConverter_cfg::out, TableParser::table, and FWLayoutBuilder::verticalFrame().

Referenced by FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().

◆ addTextButton()

FWDialogBuilder & FWDialogBuilder::addTextButton ( const char *  text,
TGTextButton **  out = nullptr 
)

Definition at line 285 of file FWDialogBuilder.cc.

285  {
286  TGTextButton *button = new TGTextButton(nextFrame(), text);
287  currentFrame()->AddFrame(button, nextHints());
288  button->SetEnabled(false);
289 
290  return extract(button, out);
291 }

References FWLayoutBuilder::currentFrame(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), MillePedeFileConverter_cfg::out, and runonSM::text.

Referenced by CmsShowEDI::CmsShowEDI(), FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().

◆ addTextEdit()

FWDialogBuilder & FWDialogBuilder::addTextEdit ( const char *  defaultText = nullptr,
TGTextEdit **  out = nullptr 
)

Definition at line 256 of file FWDialogBuilder.cc.

256  {
257  TGTextEdit *edit = new TGTextEdit(nextFrame(), 100, 100);
258  if (defaultText)
259  edit->AddLine(defaultText);
260  currentFrame()->AddFrame(edit, nextHints());
261  expand(true, true);
262  return extract(edit, out);
263 }

References FWLayoutBuilder::currentFrame(), expand(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.

◆ addTextEntry()

FWDialogBuilder & FWDialogBuilder::addTextEntry ( const char *  defaultText,
TGTextEntry **  out 
)

Definition at line 301 of file FWDialogBuilder.cc.

301  {
302  TGTextEntry *entry = new TGTextEntry(nextFrame());
303  currentFrame()->AddFrame(entry, nextHints());
304  entry->SetEnabled(kFALSE);
305 
306  return extract(entry, out);
307 }

References FWLayoutBuilder::currentFrame(), mps_splice::entry, extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.

Referenced by CmsShowEDI::CmsShowEDI(), FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().

◆ addTextView()

FWDialogBuilder & FWDialogBuilder::addTextView ( const char *  defaultText = nullptr,
TGTextView **  out = nullptr 
)

Definition at line 240 of file FWDialogBuilder.cc.

240  {
241  TGTextView *view = new TGTextView(nextFrame(), 100, 100);
242  if (defaultText)
243  view->AddLine(defaultText);
244  currentFrame()->AddFrame(view, nextHints());
245  expand(true, true);
246  return extract(view, out);
247 }

References FWLayoutBuilder::currentFrame(), expand(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.

Referenced by CmsShowEDI::CmsShowEDI().

◆ addValidatingTextEntry()

FWDialogBuilder & FWDialogBuilder::addValidatingTextEntry ( const char *  defaultText,
FWGUIValidatingTextEntry **  out 
)

◆ beginTab()

FWDialogBuilder & FWDialogBuilder::beginTab ( const char *  label)

Adds a new tab called label. A new tab gets a new builder so that tab building is completely scoped.

Definition at line 393 of file FWDialogBuilder.cc.

393  {
394  TGCompositeFrame *tab = m_tabs->AddTab(label);
395 
396  FWDialogBuilder *builder = new FWDialogBuilder(tab, this, false);
397  return builder->newRow();
398 }

References FWDialogBuilder(), label, m_tabs, and newRow().

Referenced by CmsShowEDI::CmsShowEDI().

◆ endTab()

FWDialogBuilder & FWDialogBuilder::endTab ( void  )

When we are done with the tab, we delete ourself and return the parent.

Definition at line 402 of file FWDialogBuilder.cc.

402  {
404  delete this;
405  return *parent;
406 }

References m_parent, and class-composition::parent.

Referenced by CmsShowEDI::CmsShowEDI().

◆ expand()

FWDialogBuilder & FWDialogBuilder::expand ( size_t  expandX = true,
size_t  expandY = false 
)

◆ extract()

template<class T >
FWDialogBuilder& FWDialogBuilder::extract ( T in,
T **  out 
)
inlineprotected

◆ floatLeft()

FWDialogBuilder & FWDialogBuilder::floatLeft ( size_t  spacing = 3)

Definition at line 408 of file FWDialogBuilder.cc.

408  {
410  return *this;
411 }

References FWLayoutBuilder::floatLeft().

Referenced by CmsShowEDI::CmsShowEDI(), FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().

◆ frameSpaceDown()

FWDialogBuilder & FWDialogBuilder::frameSpaceDown ( size_t  spacing = 3)

Definition at line 452 of file FWDialogBuilder.cc.

452  {
454  return *this;
455 }

References FWLayoutBuilder::frameSpaceDown().

Referenced by FWGUIEventDataAdder::createWindow().

◆ frameSpaceLeft()

FWDialogBuilder & FWDialogBuilder::frameSpaceLeft ( size_t  spacing = 3)

Definition at line 463 of file FWDialogBuilder.cc.

463  {
465  return *this;
466 }

References FWLayoutBuilder::frameSpaceLeft().

◆ frameSpaceLeftRight()

FWDialogBuilder & FWDialogBuilder::frameSpaceLeftRight ( size_t  spacing = 3)

Definition at line 473 of file FWDialogBuilder.cc.

473  {
476  return *this;
477 }

References FWLayoutBuilder::frameSpaceLeft(), and FWLayoutBuilder::frameSpaceRight().

◆ frameSpaceRight()

FWDialogBuilder & FWDialogBuilder::frameSpaceRight ( size_t  spacing = 3)

Definition at line 468 of file FWDialogBuilder.cc.

468  {
470  return *this;
471 }

References FWLayoutBuilder::frameSpaceRight().

◆ frameSpaceUp()

FWDialogBuilder & FWDialogBuilder::frameSpaceUp ( size_t  spacing = 3)

Definition at line 447 of file FWDialogBuilder.cc.

447  {
449  return *this;
450 }

References FWLayoutBuilder::frameSpaceUp().

◆ frameSpaceUpDown()

FWDialogBuilder & FWDialogBuilder::frameSpaceUpDown ( size_t  spacing = 3)

Definition at line 457 of file FWDialogBuilder.cc.

457  {
460  return *this;
461 }

References FWLayoutBuilder::frameSpaceDown(), and FWLayoutBuilder::frameSpaceUp().

Referenced by FWGUIEventDataAdder::createWindow().

◆ hSpacer()

FWDialogBuilder & FWDialogBuilder::hSpacer ( size_t  size = 0)

Definition at line 500 of file FWDialogBuilder.cc.

500  {
501  TGFrame *frame;
502  if (size)
503  frame = new TGFrame(nextFrame(), size, 1);
504  else
505  frame = new TGFrame(nextFrame());
506 
507  currentFrame()->AddFrame(frame, nextHints());
508 
509  if (!size)
510  expand(true, false);
511  else
512  expand(false, false);
513 
514  return *this;
515 }

References FWLayoutBuilder::currentFrame(), expand(), amptDefault_cfi::frame, FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and findQualityFiles::size.

Referenced by FWGUIEventDataAdder::createWindow().

◆ indent()

FWDialogBuilder & FWDialogBuilder::indent ( int  left = 2,
int  right = -1 
)

◆ newRow()

FWDialogBuilder & FWDialogBuilder::newRow ( void  )

Definition at line 197 of file FWDialogBuilder.cc.

197  {
199  return *this;
200 }

References FWLayoutBuilder::newRow().

Referenced by addHSeparator(), beginTab(), and vSpacer().

◆ spaceDown()

FWDialogBuilder & FWDialogBuilder::spaceDown ( size_t  spacing = 3)

Definition at line 418 of file FWDialogBuilder.cc.

418  {
420  return *this;
421 }

References FWLayoutBuilder::spaceDown().

Referenced by FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().

◆ spaceLeft()

FWDialogBuilder & FWDialogBuilder::spaceLeft ( size_t  spacing = 3)

Definition at line 429 of file FWDialogBuilder.cc.

429  {
431  return *this;
432 }

References FWLayoutBuilder::spaceLeft().

◆ spaceLeftRight()

FWDialogBuilder & FWDialogBuilder::spaceLeftRight ( size_t  spacing = 3)

Definition at line 439 of file FWDialogBuilder.cc.

439  {
442  return *this;
443 }

References FWLayoutBuilder::spaceLeft(), and FWLayoutBuilder::spaceRight().

◆ spaceRight()

FWDialogBuilder & FWDialogBuilder::spaceRight ( size_t  spacing = 3)

Definition at line 434 of file FWDialogBuilder.cc.

434  {
436  return *this;
437 }

References FWLayoutBuilder::spaceRight().

Referenced by FWGUIEventDataAdder::createWindow().

◆ spaceUp()

FWDialogBuilder & FWDialogBuilder::spaceUp ( size_t  spacing = 3)

Definition at line 413 of file FWDialogBuilder.cc.

413  {
414  FWLayoutBuilder::spaceUp(spacing);
415  return *this;
416 }

References FWLayoutBuilder::spaceUp().

Referenced by FWGUIEventDataAdder::createWindow().

◆ spaceUpDown()

FWDialogBuilder & FWDialogBuilder::spaceUpDown ( size_t  spacing = 3)

Definition at line 423 of file FWDialogBuilder.cc.

423  {
424  FWLayoutBuilder::spaceUp(spacing);
426  return *this;
427 }

References FWLayoutBuilder::spaceDown(), and FWLayoutBuilder::spaceUp().

◆ tabs()

FWDialogBuilder & FWDialogBuilder::tabs ( TGTab **  out)

Support for tabs.

This is done by creating a new DialogBuilder and returning it for each of the added tabs.

builder.tabs() // Adds a TGTab widget to the current frame. .beginTab("Foo") // Add a tab to the TGTab. .textButton("In Foo") // This is inside the tab "Foo", the layouting is independent from previous calls since a separate builder was returned by

       .endTab("Foo")        // End of the tab.
       .beginTab("Bar")
       .endTab("")
       .untabs();            // Tabs completed.
       .textButton("Main scope") // This is on the same level as the TGTab.

Definition at line 372 of file FWDialogBuilder.cc.

372  {
373  // m_currentFrame = new TGVerticalFrame(m_framesStack.back());
374  //m_framesStack.back()->AddFrame(m_currentFrame, new TGLayoutHints(kLHintsExpandX| kLHintsExpandY));
375  frameForTab();
376 
377  m_tabs = new TGTab(currentFrame());
378  currentFrame()->AddFrame(m_tabs, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
379  //expand(true, true);
380  return extract(m_tabs, out);
381 }

References FWLayoutBuilder::currentFrame(), extract(), FWLayoutBuilder::frameForTab(), m_tabs, and MillePedeFileConverter_cfg::out.

Referenced by CmsShowEDI::CmsShowEDI().

◆ unindent()

FWDialogBuilder & FWDialogBuilder::unindent ( void  )

Definition at line 207 of file FWDialogBuilder.cc.

207  {
209  return *this;
210 }

References FWLayoutBuilder::unindent().

◆ untabs()

FWDialogBuilder & FWDialogBuilder::untabs ( void  )

Definition at line 383 of file FWDialogBuilder.cc.

383  {
384  // No untabs() without tabs().
385  assert(m_tabs);
386  m_tabs = nullptr;
387  return *this;
388 }

References cms::cuda::assert(), and m_tabs.

Referenced by CmsShowEDI::CmsShowEDI().

◆ vSpacer()

FWDialogBuilder & FWDialogBuilder::vSpacer ( size_t  size = 0)

Definition at line 484 of file FWDialogBuilder.cc.

484  {
485  newRow().expand(true, true);
486 
487  TGFrame *frame;
488  if (size)
489  frame = new TGFrame(nextFrame(), 1, size);
490  else
491  frame = new TGFrame(nextFrame());
492 
493  currentFrame()->AddFrame(frame, nextHints());
494 
495  expand(true, true);
496 
497  return *this;
498 }

References FWLayoutBuilder::currentFrame(), expand(), amptDefault_cfi::frame, newRow(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and findQualityFiles::size.

Referenced by CmsShowEDI::CmsShowEDI().

Member Data Documentation

◆ m_parent

FWDialogBuilder* FWDialogBuilder::m_parent
private

Definition at line 159 of file FWDialogBuilder.h.

Referenced by endTab().

◆ m_tabs

TGTab* FWDialogBuilder::m_tabs
private

Definition at line 160 of file FWDialogBuilder.h.

Referenced by beginTab(), tabs(), and untabs().

FWLayoutBuilder::spaceDown
FWLayoutBuilder & spaceDown(size_t spacing)
Definition: FWDialogBuilder.cc:80
FWLayoutBuilder::nextFrame
TGCompositeFrame * nextFrame()
Definition: FWDialogBuilder.cc:151
FWLayoutBuilder::frameSpaceLeft
FWLayoutBuilder & frameSpaceLeft(size_t spacing)
Definition: FWDialogBuilder.cc:110
FWDialogBuilder::newRow
FWDialogBuilder & newRow()
Definition: FWDialogBuilder.cc:197
FWDialogBuilder::m_parent
FWDialogBuilder * m_parent
Definition: FWDialogBuilder.h:159
min
T min(T a, T b)
Definition: MathUtil.h:58
mps_splice.entry
entry
Definition: mps_splice.py:68
FWLayoutBuilder::frameForTab
void frameForTab()
Definition: FWDialogBuilder.cc:158
FWLayoutBuilder::frameSpaceDown
FWLayoutBuilder & frameSpaceDown(size_t spacing)
Definition: FWDialogBuilder.cc:104
svgfig.window
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
Definition: svgfig.py:643
cms::cuda::assert
assert(be >=bs)
FWDialogBuilder::m_tabs
TGTab * m_tabs
Definition: FWDialogBuilder.h:160
FWLayoutBuilder::spaceLeft
FWLayoutBuilder & spaceLeft(size_t spacing)
Definition: FWDialogBuilder.cc:86
FWGUIValidatingTextEntry
Definition: FWGUIValidatingTextEntry.h:35
FWLayoutBuilder::currentFrame
TGCompositeFrame * currentFrame(void)
Definition: FWDialogBuilder.h:32
FWLayoutBuilder::frameSpaceUp
FWLayoutBuilder & frameSpaceUp(size_t spacing)
Definition: FWDialogBuilder.cc:98
FWLayoutBuilder::verticalFrame
TGVerticalFrame * verticalFrame()
Definition: FWDialogBuilder.cc:53
mps_merge.separator
string separator
Definition: mps_merge.py:79
FWLayoutBuilder::floatLeft
FWLayoutBuilder & floatLeft(size_t spacing)
Definition: FWDialogBuilder.cc:68
FWLayoutBuilder::expand
FWLayoutBuilder & expand(bool expandX=true, bool expandY=false)
Definition: FWDialogBuilder.cc:125
html
Definition: html.py:1
FWDialogBuilder
Definition: FWDialogBuilder.h:93
FWTableWidget
Definition: FWTableWidget.h:35
FWLayoutBuilder::nextHints
TGLayoutHints * nextHints()
Definition: FWDialogBuilder.cc:136
FWDialogBuilder::expand
FWDialogBuilder & expand(size_t expandX=true, size_t expandY=false)
Definition: FWDialogBuilder.cc:479
style
Definition: style.py:1
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
recoMuon::in
Definition: RecoMuonEnumerators.h:6
FWColorSelect
Definition: FWColorSelect.h:107
FWLayoutBuilder::frameSpaceRight
FWLayoutBuilder & frameSpaceRight(size_t spacing)
Definition: FWDialogBuilder.cc:116
FWLayoutBuilder::spaceRight
FWLayoutBuilder & spaceRight(size_t spacing)
Definition: FWDialogBuilder.cc:92
FWLayoutBuilder::FWLayoutBuilder
FWLayoutBuilder(TGCompositeFrame *window, bool expandY=true)
Definition: FWDialogBuilder.cc:19
FWLayoutBuilder::spaceUp
FWLayoutBuilder & spaceUp(size_t spacing)
Definition: FWDialogBuilder.cc:74
FWDialogBuilder::FWDialogBuilder
FWDialogBuilder(TGCompositeFrame *window, FWDialogBuilder *parent=nullptr, bool expandY=true)
Definition: FWDialogBuilder.cc:194
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
FWLayoutBuilder::unindent
FWLayoutBuilder & unindent(void)
Definition: FWDialogBuilder.cc:59
FWLayoutBuilder::newRow
FWLayoutBuilder & newRow()
Definition: FWDialogBuilder.cc:33
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
runonSM.text
text
Definition: runonSM.py:43
TableParser.table
table
Definition: TableParser.py:111
FWLayoutBuilder::indent
FWLayoutBuilder & indent(int left=2, int right=-1)
Definition: FWDialogBuilder.cc:40
class-composition.parent
parent
Definition: class-composition.py:88
label
const char * label
Definition: PFTauDecayModeTools.cc:11
FWDialogBuilder::extract
FWDialogBuilder & extract(T *in, T **out)
Definition: FWDialogBuilder.h:152
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
submitPVResolutionJobs.pool
pool
Definition: submitPVResolutionJobs.py:351