CMS 3D CMS Logo

FWDialogBuilder.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWDialogBuilder_h
2 #define Fireworks_Core_FWDialogBuilder_h
3 
4 #include "TGNumberEntry.h"
5 
6 class TGCompositeFrame;
7 class TGLayoutHints;
8 class TGVerticalFrame;
9 class TGLabel;
10 class FWColorSelect;
11 class TGTextView;
12 class TGTextEntry;
13 class TGTextButton;
14 class TGHSlider;
15 class FWTableManagerBase;
16 class FWTableWidget;
17 class TGCheckButton;
19 class TGTab;
20 class FWColorManager;
21 class TGTextEdit;
22 class TGHtml;
23 
25 protected:
26  FWLayoutBuilder(TGCompositeFrame *window, bool expandY = true);
28 
29  FWLayoutBuilder &indent(int left = 2, int right = -1);
30 
32  TGCompositeFrame *currentFrame(void) { return m_currentFrame; }
33  FWLayoutBuilder &floatLeft(size_t spacing);
34  FWLayoutBuilder &spaceUp(size_t spacing);
35  FWLayoutBuilder &spaceDown(size_t spacing);
36  FWLayoutBuilder &spaceLeft(size_t spacing);
37  FWLayoutBuilder &spaceRight(size_t spacing);
38  FWLayoutBuilder &frameSpaceUp(size_t spacing);
39  FWLayoutBuilder &frameSpaceDown(size_t spacing);
40  FWLayoutBuilder &frameSpaceLeft(size_t spacing);
41  FWLayoutBuilder &frameSpaceRight(size_t spacing);
42  FWLayoutBuilder &expand(bool expandX = true, bool expandY = false);
43 
44  bool isFloatingLeft() { return m_floatLeft; }
45  TGLayoutHints *nextHints();
46  TGCompositeFrame *nextFrame();
47  TGVerticalFrame *verticalFrame();
48  void frameForTab();
49 
50 private:
51  TGCompositeFrame *m_window;
52 
53  std::vector<TGVerticalFrame *> m_framesStack;
54  // TGCompositeFrame *m_lastFrame;
55  TGCompositeFrame *m_currentFrame;
56 
58  size_t m_topSpacing;
59  size_t m_leftSpacing;
60  TGLayoutHints *m_currentHints;
61  TGLayoutHints *m_currentFrameHints;
62 };
63 
94 public:
95  FWDialogBuilder(TGCompositeFrame *window, FWDialogBuilder *parent = nullptr, bool expandY = true);
96 
98  FWDialogBuilder &indent(int left = 2, int right = -1);
100 
101  FWDialogBuilder &addLabel(const char *text, size_t fontSize = 12, size_t weight = 0, TGLabel **out = nullptr);
102 
103  FWDialogBuilder &addTextView(const char *defaultText = nullptr, TGTextView **out = nullptr);
104 
105  // Is default text meaningful here as the html is
106  // a document with structure?
107  FWDialogBuilder &addHtml(TGHtml **out = nullptr);
108 
109  FWDialogBuilder &addTextEdit(const char *defaultText = nullptr, TGTextEdit **out = nullptr);
110  FWDialogBuilder &addColorPicker(const FWColorManager *manager, FWColorSelect **out = nullptr);
111 
112  FWDialogBuilder &addHSlider(size_t size, TGHSlider **out = nullptr);
113 
114  FWDialogBuilder &addTextButton(const char *text, TGTextButton **out = nullptr);
116  FWDialogBuilder &addTextEntry(const char *defaultText, TGTextEntry **out);
118  float defaultValue, size_t digits, TGNumberFormat::EStyle style, int min, int max, TGNumberEntry **out);
119 
120  FWDialogBuilder &addCheckbox(const char *text, TGCheckButton **out = nullptr);
122 
123  FWDialogBuilder &addHSeparator(size_t horizontalPadding = 4, size_t verticalPadding = 3);
124 
125  FWDialogBuilder &tabs(TGTab **out);
126  FWDialogBuilder &untabs(void);
127  FWDialogBuilder &beginTab(const char *label);
128  FWDialogBuilder &endTab(void);
129 
130  FWDialogBuilder &floatLeft(size_t spacing = 3);
131 
132  FWDialogBuilder &spaceUp(size_t spacing = 3);
133  FWDialogBuilder &spaceDown(size_t spacing = 3);
134  FWDialogBuilder &spaceUpDown(size_t spacing = 3);
135  FWDialogBuilder &spaceLeft(size_t spacing = 3);
136  FWDialogBuilder &spaceRight(size_t spacing = 3);
137  FWDialogBuilder &spaceLeftRight(size_t spacing = 3);
138 
139  FWDialogBuilder &frameSpaceUp(size_t spacing = 3);
140  FWDialogBuilder &frameSpaceDown(size_t spacing = 3);
141  FWDialogBuilder &frameSpaceUpDown(size_t spacing = 3);
142  FWDialogBuilder &frameSpaceLeft(size_t spacing = 3);
143  FWDialogBuilder &frameSpaceRight(size_t spacing = 3);
144  FWDialogBuilder &frameSpaceLeftRight(size_t spacing = 3);
145 
146  FWDialogBuilder &expand(size_t expandX = true, size_t expandY = false);
147  FWDialogBuilder &vSpacer(size_t size = 0);
148  FWDialogBuilder &hSpacer(size_t size = 0);
149 
150 protected:
151  template <class T>
153  if (out)
154  *out = in;
155  return *this;
156  }
157 
158 private:
160  TGTab *m_tabs;
161 };
162 
163 #endif
FWDialogBuilder::endTab
FWDialogBuilder & endTab(void)
Definition: FWDialogBuilder.cc:402
FWLayoutBuilder::spaceDown
FWLayoutBuilder & spaceDown(size_t spacing)
Definition: FWDialogBuilder.cc:80
FWLayoutBuilder::nextFrame
TGCompositeFrame * nextFrame()
Definition: FWDialogBuilder.cc:151
FWDialogBuilder::frameSpaceRight
FWDialogBuilder & frameSpaceRight(size_t spacing=3)
Definition: FWDialogBuilder.cc:468
FWDialogBuilder::addHSeparator
FWDialogBuilder & addHSeparator(size_t horizontalPadding=4, size_t verticalPadding=3)
Definition: FWDialogBuilder.cc:345
FWLayoutBuilder::frameSpaceLeft
FWLayoutBuilder & frameSpaceLeft(size_t spacing)
Definition: FWDialogBuilder.cc:110
FWLayoutBuilder::m_currentFrame
TGCompositeFrame * m_currentFrame
Definition: FWDialogBuilder.h:55
FWDialogBuilder::addTextEdit
FWDialogBuilder & addTextEdit(const char *defaultText=nullptr, TGTextEdit **out=nullptr)
Definition: FWDialogBuilder.cc:256
FWDialogBuilder::addTextView
FWDialogBuilder & addTextView(const char *defaultText=nullptr, TGTextView **out=nullptr)
Definition: FWDialogBuilder.cc:240
FWDialogBuilder::spaceUpDown
FWDialogBuilder & spaceUpDown(size_t spacing=3)
Definition: FWDialogBuilder.cc:423
FWDialogBuilder::newRow
FWDialogBuilder & newRow()
Definition: FWDialogBuilder.cc:197
FWDialogBuilder::m_parent
FWDialogBuilder * m_parent
Definition: FWDialogBuilder.h:159
FWLayoutBuilder::m_leftSpacing
size_t m_leftSpacing
Definition: FWDialogBuilder.h:59
FWLayoutBuilder::m_window
TGCompositeFrame * m_window
Definition: FWDialogBuilder.h:51
min
T min(T a, T b)
Definition: MathUtil.h:58
FWDialogBuilder::unindent
FWDialogBuilder & unindent(void)
Definition: FWDialogBuilder.cc:207
FWLayoutBuilder::m_currentHints
TGLayoutHints * m_currentHints
Definition: FWDialogBuilder.h:60
FWLayoutBuilder::frameForTab
void frameForTab()
Definition: FWDialogBuilder.cc:158
FWLayoutBuilder::frameSpaceDown
FWLayoutBuilder & frameSpaceDown(size_t spacing)
Definition: FWDialogBuilder.cc:104
FWDialogBuilder::tabs
FWDialogBuilder & tabs(TGTab **out)
Definition: FWDialogBuilder.cc:372
FWDialogBuilder::indent
FWDialogBuilder & indent(int left=2, int right=-1)
Definition: FWDialogBuilder.cc:202
FWDialogBuilder::addNumberEntry
FWDialogBuilder & addNumberEntry(float defaultValue, size_t digits, TGNumberFormat::EStyle style, int min, int max, TGNumberEntry **out)
Definition: FWDialogBuilder.cc:309
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
FWLayoutBuilder
Definition: FWDialogBuilder.h:24
FWDialogBuilder::floatLeft
FWDialogBuilder & floatLeft(size_t spacing=3)
Definition: FWDialogBuilder.cc:408
FWDialogBuilder::m_tabs
TGTab * m_tabs
Definition: FWDialogBuilder.h:160
FWDialogBuilder::untabs
FWDialogBuilder & untabs(void)
Definition: FWDialogBuilder.cc:383
FWLayoutBuilder::spaceLeft
FWLayoutBuilder & spaceLeft(size_t spacing)
Definition: FWDialogBuilder.cc:86
FWGUIValidatingTextEntry
Definition: FWGUIValidatingTextEntry.h:35
FWDialogBuilder::addTextButton
FWDialogBuilder & addTextButton(const char *text, TGTextButton **out=nullptr)
Definition: FWDialogBuilder.cc:285
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
FWLayoutBuilder::floatLeft
FWLayoutBuilder & floatLeft(size_t spacing)
Definition: FWDialogBuilder.cc:68
FWDialogBuilder::addValidatingTextEntry
FWDialogBuilder & addValidatingTextEntry(const char *defaultText, FWGUIValidatingTextEntry **out)
Definition: FWDialogBuilder.cc:293
FWLayoutBuilder::expand
FWLayoutBuilder & expand(bool expandX=true, bool expandY=false)
Definition: FWDialogBuilder.cc:125
FWDialogBuilder
Definition: FWDialogBuilder.h:93
FWTableWidget
Definition: FWTableWidget.h:35
FWLayoutBuilder::nextHints
TGLayoutHints * nextHints()
Definition: FWDialogBuilder.cc:136
FWDialogBuilder::spaceDown
FWDialogBuilder & spaceDown(size_t spacing=3)
Definition: FWDialogBuilder.cc:418
FWDialogBuilder::frameSpaceLeft
FWDialogBuilder & frameSpaceLeft(size_t spacing=3)
Definition: FWDialogBuilder.cc:463
FWLayoutBuilder::m_topSpacing
size_t m_topSpacing
Definition: FWDialogBuilder.h:58
FWDialogBuilder::vSpacer
FWDialogBuilder & vSpacer(size_t size=0)
Definition: FWDialogBuilder.cc:484
FWDialogBuilder::expand
FWDialogBuilder & expand(size_t expandX=true, size_t expandY=false)
Definition: FWDialogBuilder.cc:479
FWDialogBuilder::addHSlider
FWDialogBuilder & addHSlider(size_t size, TGHSlider **out=nullptr)
Definition: FWDialogBuilder.cc:275
FWDialogBuilder::addColorPicker
FWDialogBuilder & addColorPicker(const FWColorManager *manager, FWColorSelect **out=nullptr)
Definition: FWDialogBuilder.cc:265
style
Definition: style.py:1
FWTableManagerBase
Definition: FWTableManagerBase.h:44
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
recoMuon::in
Definition: RecoMuonEnumerators.h:6
FWColorSelect
Definition: FWColorSelect.h:107
FWColorManager
Definition: FWColorManager.h:45
FWDialogBuilder::frameSpaceLeftRight
FWDialogBuilder & frameSpaceLeftRight(size_t spacing=3)
Definition: FWDialogBuilder.cc:473
FWDialogBuilder::spaceUp
FWDialogBuilder & spaceUp(size_t spacing=3)
Definition: FWDialogBuilder.cc:413
FWLayoutBuilder::frameSpaceRight
FWLayoutBuilder & frameSpaceRight(size_t spacing)
Definition: FWDialogBuilder.cc:116
FWLayoutBuilder::spaceRight
FWLayoutBuilder & spaceRight(size_t spacing)
Definition: FWDialogBuilder.cc:92
FWDialogBuilder::spaceRight
FWDialogBuilder & spaceRight(size_t spacing=3)
Definition: FWDialogBuilder.cc:434
FWDialogBuilder::spaceLeftRight
FWDialogBuilder & spaceLeftRight(size_t spacing=3)
Definition: FWDialogBuilder.cc:439
FWDialogBuilder::beginTab
FWDialogBuilder & beginTab(const char *label)
Definition: FWDialogBuilder.cc:393
FWLayoutBuilder::m_framesStack
std::vector< TGVerticalFrame * > m_framesStack
Definition: FWDialogBuilder.h:53
FWLayoutBuilder::m_currentFrameHints
TGLayoutHints * m_currentFrameHints
Definition: FWDialogBuilder.h:61
FWLayoutBuilder::FWLayoutBuilder
FWLayoutBuilder(TGCompositeFrame *window, bool expandY=true)
Definition: FWDialogBuilder.cc:19
FWDialogBuilder::addHtml
FWDialogBuilder & addHtml(TGHtml **out=nullptr)
Definition: FWDialogBuilder.cc:249
FWLayoutBuilder::isFloatingLeft
bool isFloatingLeft()
Definition: FWDialogBuilder.h:44
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
FWDialogBuilder::hSpacer
FWDialogBuilder & hSpacer(size_t size=0)
Definition: FWDialogBuilder.cc:500
FWDialogBuilder::frameSpaceUpDown
FWDialogBuilder & frameSpaceUpDown(size_t spacing=3)
Definition: FWDialogBuilder.cc:457
T
long double T
Definition: Basic3DVectorLD.h:48
FWLayoutBuilder::m_floatLeft
bool m_floatLeft
Definition: FWDialogBuilder.h:57
FWDialogBuilder::frameSpaceUp
FWDialogBuilder & frameSpaceUp(size_t spacing=3)
Definition: FWDialogBuilder.cc:447
FWLayoutBuilder::unindent
FWLayoutBuilder & unindent(void)
Definition: FWDialogBuilder.cc:59
FWLayoutBuilder::newRow
FWLayoutBuilder & newRow()
Definition: FWDialogBuilder.cc:33
FWDialogBuilder::addTable
FWDialogBuilder & addTable(FWTableManagerBase *manager, FWTableWidget **out=nullptr)
Definition: FWDialogBuilder.cc:336
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
FWDialogBuilder::frameSpaceDown
FWDialogBuilder & frameSpaceDown(size_t spacing=3)
Definition: FWDialogBuilder.cc:452
runonSM.text
text
Definition: runonSM.py:43
FWLayoutBuilder::indent
FWLayoutBuilder & indent(int left=2, int right=-1)
Definition: FWDialogBuilder.cc:40
FWDialogBuilder::spaceLeft
FWDialogBuilder & spaceLeft(size_t spacing=3)
Definition: FWDialogBuilder.cc:429
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
weight
Definition: weight.py:1
FWDialogBuilder::addTextEntry
FWDialogBuilder & addTextEntry(const char *defaultText, TGTextEntry **out)
Definition: FWDialogBuilder.cc:301
FWDialogBuilder::addLabel
FWDialogBuilder & addLabel(const char *text, size_t fontSize=12, size_t weight=0, TGLabel **out=nullptr)
Definition: FWDialogBuilder.cc:212
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
FWDialogBuilder::addCheckbox
FWDialogBuilder & addCheckbox(const char *text, TGCheckButton **out=nullptr)
Definition: FWDialogBuilder.cc:327