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);
115  FWDialogBuilder &addValidatingTextEntry(const char *defaultText, FWGUIValidatingTextEntry **out);
116  FWDialogBuilder &addTextEntry(const char *defaultText, TGTextEntry **out);
117  FWDialogBuilder &addNumberEntry(
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);
121  FWDialogBuilder &addTable(FWTableManagerBase *manager, FWTableWidget **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
size
Write out results.
TGVerticalFrame * verticalFrame()
TGCompositeFrame * m_window
FWDialogBuilder & extract(T *in, T **out)
TGCompositeFrame * nextFrame()
FWLayoutBuilder & frameSpaceRight(size_t spacing)
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)
char const * label
FWLayoutBuilder & frameSpaceUp(size_t spacing)
FWLayoutBuilder & spaceUp(size_t spacing)
TGCompositeFrame * m_currentFrame
Definition: style.py:1
FWLayoutBuilder & floatLeft(size_t spacing)
TGLayoutHints * m_currentFrameHints
FWLayoutBuilder & unindent(void)
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
TGCompositeFrame * currentFrame(void)
T min(T a, T b)
Definition: MathUtil.h:58
FWLayoutBuilder & indent(int left=2, int right=-1)
FWLayoutBuilder & newRow()
TGLayoutHints * nextHints()
FWLayoutBuilder & spaceDown(size_t spacing)
FWDialogBuilder * m_parent
FWLayoutBuilder & expand(bool expandX=true, bool expandY=false)
long double T
FWLayoutBuilder & spaceLeft(size_t spacing)
FWLayoutBuilder & frameSpaceLeft(size_t spacing)