#include <FWDialogBuilder.h>
Public Member Functions | |
FWDialogBuilder & | addCheckbox (const char *text, TGCheckButton **out=nullptr) |
FWDialogBuilder & | addColorPicker (const FWColorManager *manager, FWColorSelect **out=nullptr) |
FWDialogBuilder & | addHSeparator (size_t horizontalPadding=4, size_t verticalPadding=3) |
FWDialogBuilder & | addHSlider (size_t size, TGHSlider **out=nullptr) |
FWDialogBuilder & | addHtml (TGHtml **out=nullptr) |
FWDialogBuilder & | addLabel (const char *text, size_t fontSize=12, size_t weight=0, TGLabel **out=nullptr) |
FWDialogBuilder & | addNumberEntry (float defaultValue, size_t digits, TGNumberFormat::EStyle style, int min, int max, TGNumberEntry **out) |
FWDialogBuilder & | addTable (FWTableManagerBase *manager, FWTableWidget **out=nullptr) |
FWDialogBuilder & | addTextButton (const char *text, TGTextButton **out=nullptr) |
FWDialogBuilder & | addTextEdit (const char *defaultText=nullptr, TGTextEdit **out=nullptr) |
FWDialogBuilder & | addTextEntry (const char *defaultText, TGTextEntry **out) |
FWDialogBuilder & | addTextView (const char *defaultText=nullptr, TGTextView **out=nullptr) |
FWDialogBuilder & | addValidatingTextEntry (const char *defaultText, FWGUIValidatingTextEntry **out) |
FWDialogBuilder & | beginTab (const char *label) |
FWDialogBuilder & | endTab (void) |
FWDialogBuilder & | expand (size_t expandX=true, size_t expandY=false) |
FWDialogBuilder & | floatLeft (size_t spacing=3) |
FWDialogBuilder & | frameSpaceDown (size_t spacing=3) |
FWDialogBuilder & | frameSpaceLeft (size_t spacing=3) |
FWDialogBuilder & | frameSpaceLeftRight (size_t spacing=3) |
FWDialogBuilder & | frameSpaceRight (size_t spacing=3) |
FWDialogBuilder & | frameSpaceUp (size_t spacing=3) |
FWDialogBuilder & | frameSpaceUpDown (size_t spacing=3) |
FWDialogBuilder (TGCompositeFrame *window, FWDialogBuilder *parent=nullptr, bool expandY=true) | |
FWDialogBuilder & | hSpacer (size_t size=0) |
FWDialogBuilder & | indent (int left=2, int right=-1) |
FWDialogBuilder & | newRow () |
FWDialogBuilder & | spaceDown (size_t spacing=3) |
FWDialogBuilder & | spaceLeft (size_t spacing=3) |
FWDialogBuilder & | spaceLeftRight (size_t spacing=3) |
FWDialogBuilder & | spaceRight (size_t spacing=3) |
FWDialogBuilder & | spaceUp (size_t spacing=3) |
FWDialogBuilder & | spaceUpDown (size_t spacing=3) |
FWDialogBuilder & | tabs (TGTab **out) |
FWDialogBuilder & | unindent (void) |
FWDialogBuilder & | untabs (void) |
FWDialogBuilder & | vSpacer (size_t size=0) |
Protected Member Functions | |
template<class T > | |
FWDialogBuilder & | extract (T *in, T **out) |
Protected Member Functions inherited from FWLayoutBuilder | |
TGCompositeFrame * | currentFrame (void) |
FWLayoutBuilder & | expand (bool expandX=true, bool expandY=false) |
FWLayoutBuilder & | floatLeft (size_t spacing) |
void | frameForTab () |
FWLayoutBuilder & | frameSpaceDown (size_t spacing) |
FWLayoutBuilder & | frameSpaceLeft (size_t spacing) |
FWLayoutBuilder & | frameSpaceRight (size_t spacing) |
FWLayoutBuilder & | frameSpaceUp (size_t spacing) |
FWLayoutBuilder (TGCompositeFrame *window, bool expandY=true) | |
FWLayoutBuilder & | indent (int left=2, int right=-1) |
bool | isFloatingLeft () |
FWLayoutBuilder & | newRow () |
TGCompositeFrame * | nextFrame () |
TGLayoutHints * | nextHints () |
FWLayoutBuilder & | spaceDown (size_t spacing) |
FWLayoutBuilder & | spaceLeft (size_t spacing) |
FWLayoutBuilder & | spaceRight (size_t spacing) |
FWLayoutBuilder & | spaceUp (size_t spacing) |
FWLayoutBuilder & | unindent (void) |
TGVerticalFrame * | verticalFrame () |
Private Attributes | |
FWDialogBuilder * | m_parent |
TGTab * | m_tabs |
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.
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.
Referenced by beginTab().
FWDialogBuilder & FWDialogBuilder::addCheckbox | ( | const char * | text, |
TGCheckButton ** | out = nullptr |
||
) |
Definition at line 327 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), MillePedeFileConverter_cfg::out, and submitPVValidationJobs::text.
Referenced by CmsShowEDI::CmsShowEDI(), CmsShowModelPopup::CmsShowModelPopup(), and FWGUIEventDataAdder::createWindow().
FWDialogBuilder & FWDialogBuilder::addColorPicker | ( | const FWColorManager * | manager, |
FWColorSelect ** | out = nullptr |
||
) |
Definition at line 265 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.
Referenced by CmsShowEDI::CmsShowEDI(), and CmsShowModelPopup::CmsShowModelPopup().
FWDialogBuilder & FWDialogBuilder::addHSeparator | ( | size_t | horizontalPadding = 4 , |
size_t | verticalPadding = 3 |
||
) |
Definition at line 345 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), newRow(), FWLayoutBuilder::nextFrame(), and mps_merge::separator.
Referenced by CmsShowEDI::CmsShowEDI(), and CmsShowModelPopup::CmsShowModelPopup().
FWDialogBuilder & FWDialogBuilder::addHSlider | ( | size_t | size, |
TGHSlider ** | out = nullptr |
||
) |
Definition at line 275 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), MillePedeFileConverter_cfg::out, and findQualityFiles::size.
Referenced by CmsShowEDI::CmsShowEDI(), and CmsShowModelPopup::CmsShowModelPopup().
FWDialogBuilder & FWDialogBuilder::addHtml | ( | TGHtml ** | out = nullptr | ) |
Definition at line 249 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), expand(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.
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.
References FWLayoutBuilder::currentFrame(), extract(), label, FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), MillePedeFileConverter_cfg::out, submitPVResolutionJobs::pool, and submitPVValidationJobs::text.
Referenced by CmsShowEDI::CmsShowEDI(), CmsShowModelPopup::CmsShowModelPopup(), FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().
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.
References FWLayoutBuilder::currentFrame(), hltPixelClustersMultiplicity_cfi::defaultValue, mps_splice::entry, extract(), SiStripPI::max, SiStripPI::min, FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.
Referenced by CmsShowEDI::CmsShowEDI().
FWDialogBuilder & FWDialogBuilder::addTable | ( | FWTableManagerBase * | manager, |
FWTableWidget ** | out = nullptr |
||
) |
Definition at line 336 of file FWDialogBuilder.cc.
References expand(), extract(), MillePedeFileConverter_cfg::out, TableParser::table, and FWLayoutBuilder::verticalFrame().
Referenced by FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().
FWDialogBuilder & FWDialogBuilder::addTextButton | ( | const char * | text, |
TGTextButton ** | out = nullptr |
||
) |
Definition at line 285 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), MillePedeFileConverter_cfg::out, and submitPVValidationJobs::text.
Referenced by CmsShowEDI::CmsShowEDI(), FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().
FWDialogBuilder & FWDialogBuilder::addTextEdit | ( | const char * | defaultText = nullptr , |
TGTextEdit ** | out = nullptr |
||
) |
Definition at line 256 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), expand(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.
FWDialogBuilder & FWDialogBuilder::addTextEntry | ( | const char * | defaultText, |
TGTextEntry ** | out | ||
) |
Definition at line 301 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), mps_splice::entry, extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.
Referenced by CmsShowEDI::CmsShowEDI(), FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().
FWDialogBuilder & FWDialogBuilder::addTextView | ( | const char * | defaultText = nullptr , |
TGTextView ** | out = nullptr |
||
) |
Definition at line 240 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), expand(), extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.
Referenced by CmsShowEDI::CmsShowEDI().
FWDialogBuilder & FWDialogBuilder::addValidatingTextEntry | ( | const char * | defaultText, |
FWGUIValidatingTextEntry ** | out | ||
) |
Definition at line 293 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), mps_splice::entry, extract(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and MillePedeFileConverter_cfg::out.
Referenced by CmsShowEDI::CmsShowEDI().
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.
References FWDialogBuilder(), label, m_tabs, and newRow().
Referenced by CmsShowEDI::CmsShowEDI().
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.
References m_parent, and class-composition::parent.
Referenced by CmsShowEDI::CmsShowEDI().
FWDialogBuilder & FWDialogBuilder::expand | ( | size_t | expandX = true , |
size_t | expandY = false |
||
) |
Definition at line 479 of file FWDialogBuilder.cc.
References FWLayoutBuilder::expand().
Referenced by addHtml(), addTable(), addTextEdit(), addTextView(), CmsShowEDI::CmsShowEDI(), CmsShowModelPopup::CmsShowModelPopup(), FWGUIEventDataAdder::createWindow(), FWPathsPopup::FWPathsPopup(), hSpacer(), and vSpacer().
|
inlineprotected |
Definition at line 152 of file FWDialogBuilder.h.
References recoMuon::in, and MillePedeFileConverter_cfg::out.
Referenced by addCheckbox(), addColorPicker(), addHSlider(), addHtml(), addLabel(), addNumberEntry(), addTable(), addTextButton(), addTextEdit(), addTextEntry(), addTextView(), addValidatingTextEntry(), and tabs().
FWDialogBuilder & FWDialogBuilder::floatLeft | ( | size_t | spacing = 3 | ) |
Definition at line 408 of file FWDialogBuilder.cc.
References FWLayoutBuilder::floatLeft().
Referenced by CmsShowEDI::CmsShowEDI(), FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().
FWDialogBuilder & FWDialogBuilder::frameSpaceDown | ( | size_t | spacing = 3 | ) |
Definition at line 452 of file FWDialogBuilder.cc.
References FWLayoutBuilder::frameSpaceDown().
Referenced by FWGUIEventDataAdder::createWindow().
FWDialogBuilder & FWDialogBuilder::frameSpaceLeft | ( | size_t | spacing = 3 | ) |
Definition at line 463 of file FWDialogBuilder.cc.
References FWLayoutBuilder::frameSpaceLeft().
FWDialogBuilder & FWDialogBuilder::frameSpaceLeftRight | ( | size_t | spacing = 3 | ) |
Definition at line 473 of file FWDialogBuilder.cc.
References FWLayoutBuilder::frameSpaceLeft(), and FWLayoutBuilder::frameSpaceRight().
FWDialogBuilder & FWDialogBuilder::frameSpaceRight | ( | size_t | spacing = 3 | ) |
Definition at line 468 of file FWDialogBuilder.cc.
References FWLayoutBuilder::frameSpaceRight().
FWDialogBuilder & FWDialogBuilder::frameSpaceUp | ( | size_t | spacing = 3 | ) |
Definition at line 447 of file FWDialogBuilder.cc.
References FWLayoutBuilder::frameSpaceUp().
FWDialogBuilder & FWDialogBuilder::frameSpaceUpDown | ( | size_t | spacing = 3 | ) |
Definition at line 457 of file FWDialogBuilder.cc.
References FWLayoutBuilder::frameSpaceDown(), and FWLayoutBuilder::frameSpaceUp().
Referenced by FWGUIEventDataAdder::createWindow().
FWDialogBuilder & FWDialogBuilder::hSpacer | ( | size_t | size = 0 | ) |
Definition at line 500 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), expand(), amptDefault_cfi::frame, FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and findQualityFiles::size.
Referenced by FWGUIEventDataAdder::createWindow().
FWDialogBuilder & FWDialogBuilder::indent | ( | int | left = 2 , |
int | right = -1 |
||
) |
Definition at line 202 of file FWDialogBuilder.cc.
References FWLayoutBuilder::indent().
Referenced by ntuplePrintersDiff.TrackingParticlePrinter::_parentageChain(), CmsShowEDI::CmsShowEDI(), CmsShowModelPopup::CmsShowModelPopup(), FWGUIEventDataAdder::createWindow(), FWPathsPopup::FWPathsPopup(), ntuplePrintersDiff.SeedPrinter::printHits(), ntuplePrintersDiff.TrackPrinter::printHits(), and ntuplePrintersDiff.TrackingParticlePrinter::printTrackingParticle().
FWDialogBuilder & FWDialogBuilder::newRow | ( | void | ) |
Definition at line 197 of file FWDialogBuilder.cc.
References FWLayoutBuilder::newRow().
Referenced by addHSeparator(), beginTab(), and vSpacer().
FWDialogBuilder & FWDialogBuilder::spaceDown | ( | size_t | spacing = 3 | ) |
Definition at line 418 of file FWDialogBuilder.cc.
References FWLayoutBuilder::spaceDown().
Referenced by FWGUIEventDataAdder::createWindow(), and FWPathsPopup::FWPathsPopup().
FWDialogBuilder & FWDialogBuilder::spaceLeft | ( | size_t | spacing = 3 | ) |
Definition at line 429 of file FWDialogBuilder.cc.
References FWLayoutBuilder::spaceLeft().
FWDialogBuilder & FWDialogBuilder::spaceLeftRight | ( | size_t | spacing = 3 | ) |
Definition at line 439 of file FWDialogBuilder.cc.
References FWLayoutBuilder::spaceLeft(), and FWLayoutBuilder::spaceRight().
FWDialogBuilder & FWDialogBuilder::spaceRight | ( | size_t | spacing = 3 | ) |
Definition at line 434 of file FWDialogBuilder.cc.
References FWLayoutBuilder::spaceRight().
Referenced by FWGUIEventDataAdder::createWindow().
FWDialogBuilder & FWDialogBuilder::spaceUp | ( | size_t | spacing = 3 | ) |
Definition at line 413 of file FWDialogBuilder.cc.
References FWLayoutBuilder::spaceUp().
Referenced by FWGUIEventDataAdder::createWindow().
FWDialogBuilder & FWDialogBuilder::spaceUpDown | ( | size_t | spacing = 3 | ) |
Definition at line 423 of file FWDialogBuilder.cc.
References FWLayoutBuilder::spaceDown(), and FWLayoutBuilder::spaceUp().
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.
References FWLayoutBuilder::currentFrame(), extract(), FWLayoutBuilder::frameForTab(), m_tabs, and MillePedeFileConverter_cfg::out.
Referenced by CmsShowEDI::CmsShowEDI().
FWDialogBuilder & FWDialogBuilder::unindent | ( | void | ) |
FWDialogBuilder & FWDialogBuilder::untabs | ( | void | ) |
Definition at line 383 of file FWDialogBuilder.cc.
References cms::cuda::assert(), and m_tabs.
Referenced by CmsShowEDI::CmsShowEDI().
FWDialogBuilder & FWDialogBuilder::vSpacer | ( | size_t | size = 0 | ) |
Definition at line 484 of file FWDialogBuilder.cc.
References FWLayoutBuilder::currentFrame(), expand(), amptDefault_cfi::frame, newRow(), FWLayoutBuilder::nextFrame(), FWLayoutBuilder::nextHints(), and findQualityFiles::size.
Referenced by CmsShowEDI::CmsShowEDI().
|
private |
Definition at line 159 of file FWDialogBuilder.h.
Referenced by endTab().
|
private |
Definition at line 160 of file FWDialogBuilder.h.
Referenced by beginTab(), tabs(), and untabs().