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 & spaceUp(size_t spacing=3)
size
Write out results.
TGVerticalFrame * verticalFrame()
TGCompositeFrame * m_window
FWDialogBuilder & frameSpaceUp(size_t spacing=3)
FWDialogBuilder & extract(T *in, T **out)
FWDialogBuilder(TGCompositeFrame *window, FWDialogBuilder *parent=nullptr, bool expandY=true)
TGCompositeFrame * nextFrame()
FWDialogBuilder & endTab(void)
FWDialogBuilder & frameSpaceRight(size_t spacing=3)
FWDialogBuilder & addTextButton(const char *text, TGTextButton **out=nullptr)
FWDialogBuilder & addHSlider(size_t size, TGHSlider **out=nullptr)
FWDialogBuilder & spaceLeftRight(size_t spacing=3)
FWLayoutBuilder & frameSpaceRight(size_t spacing)
FWDialogBuilder & addTextView(const char *defaultText=nullptr, TGTextView **out=nullptr)
FWLayoutBuilder & spaceRight(size_t spacing)
Definition: weight.py:1
std::vector< TGVerticalFrame * > m_framesStack
FWLayoutBuilder(TGCompositeFrame *window, bool expandY=true)
TGLayoutHints * m_currentHints
FWLayoutBuilder & frameSpaceDown(size_t spacing)
FWDialogBuilder & addLabel(const char *text, size_t fontSize=12, size_t weight=0, TGLabel **out=nullptr)
FWDialogBuilder & addCheckbox(const char *text, TGCheckButton **out=nullptr)
FWDialogBuilder & vSpacer(size_t size=0)
FWDialogBuilder & untabs(void)
FWDialogBuilder & addTextEdit(const char *defaultText=nullptr, TGTextEdit **out=nullptr)
char const * label
FWLayoutBuilder & frameSpaceUp(size_t spacing)
FWLayoutBuilder & spaceUp(size_t spacing)
FWDialogBuilder & frameSpaceLeftRight(size_t spacing=3)
TGCompositeFrame * m_currentFrame
FWDialogBuilder & frameSpaceDown(size_t spacing=3)
Definition: style.py:1
FWLayoutBuilder & floatLeft(size_t spacing)
FWDialogBuilder & frameSpaceUpDown(size_t spacing=3)
TGLayoutHints * m_currentFrameHints
FWDialogBuilder & addHtml(TGHtml **out=nullptr)
FWLayoutBuilder & unindent(void)
FWDialogBuilder & spaceUpDown(size_t spacing=3)
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
FWDialogBuilder & newRow()
TGCompositeFrame * currentFrame(void)
FWDialogBuilder & addHSeparator(size_t horizontalPadding=4, size_t verticalPadding=3)
FWLayoutBuilder & indent(int left=2, int right=-1)
FWDialogBuilder & tabs(TGTab **out)
FWDialogBuilder & spaceLeft(size_t spacing=3)
FWDialogBuilder & addValidatingTextEntry(const char *defaultText, FWGUIValidatingTextEntry **out)
FWDialogBuilder & hSpacer(size_t size=0)
FWDialogBuilder & addTextEntry(const char *defaultText, TGTextEntry **out)
FWLayoutBuilder & newRow()
FWDialogBuilder & frameSpaceLeft(size_t spacing=3)
FWDialogBuilder & unindent(void)
FWDialogBuilder & floatLeft(size_t spacing=3)
FWDialogBuilder & addTable(FWTableManagerBase *manager, FWTableWidget **out=nullptr)
FWDialogBuilder & expand(size_t expandX=true, size_t expandY=false)
TGLayoutHints * nextHints()
FWLayoutBuilder & spaceDown(size_t spacing)
FWDialogBuilder * m_parent
FWLayoutBuilder & expand(bool expandX=true, bool expandY=false)
FWDialogBuilder & beginTab(const char *label)
long double T
FWDialogBuilder & indent(int left=2, int right=-1)
FWDialogBuilder & addNumberEntry(float defaultValue, size_t digits, TGNumberFormat::EStyle style, int min, int max, TGNumberEntry **out)
FWDialogBuilder & addColorPicker(const FWColorManager *manager, FWColorSelect **out=nullptr)
FWDialogBuilder & spaceDown(size_t spacing=3)
FWLayoutBuilder & spaceLeft(size_t spacing)
FWLayoutBuilder & frameSpaceLeft(size_t spacing)
FWDialogBuilder & spaceRight(size_t spacing=3)