CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
26 protected:
27  FWLayoutBuilder(TGCompositeFrame *window, bool expandY = true);
29 
30  FWLayoutBuilder &indent(int left = 2, int right = -1);
31 
33  TGCompositeFrame *currentFrame(void) { return m_currentFrame; }
34  FWLayoutBuilder &floatLeft(size_t spacing);
35  FWLayoutBuilder &spaceUp(size_t spacing);
36  FWLayoutBuilder &spaceDown(size_t spacing);
37  FWLayoutBuilder &spaceLeft(size_t spacing);
38  FWLayoutBuilder &spaceRight(size_t spacing);
39  FWLayoutBuilder &frameSpaceUp(size_t spacing);
40  FWLayoutBuilder &frameSpaceDown(size_t spacing);
41  FWLayoutBuilder &frameSpaceLeft(size_t spacing);
42  FWLayoutBuilder &frameSpaceRight(size_t spacing);
43  FWLayoutBuilder &expand(bool expandX = true, bool expandY = false);
44 
45  bool isFloatingLeft() { return m_floatLeft; }
46  TGLayoutHints *nextHints();
47  TGCompositeFrame *nextFrame();
48  TGVerticalFrame *verticalFrame();
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 {
95 public:
96  FWDialogBuilder(TGCompositeFrame *window, FWDialogBuilder *parent = 0, bool expandY = true);
97 
99  FWDialogBuilder &indent(int left = 2, int right = -1);
100  FWDialogBuilder &unindent(void);
101 
102  FWDialogBuilder &addLabel(const char *text,
103  size_t fontSize = 12,
104  size_t weight = 0,
105  TGLabel **out = 0);
106 
107  FWDialogBuilder &addTextView(const char *defaultText = 0,
108  TGTextView **out = 0);
109 
110  // Is default text meaningful here as the html is
111  // a document with structure?
112  FWDialogBuilder &addHtml(TGHtml **out = 0);
113 
114  FWDialogBuilder &addTextEdit(const char *defaultText = 0,
115  TGTextEdit **out = 0);
117  FWColorSelect **out = 0);
118 
119  FWDialogBuilder &addHSlider(size_t size, TGHSlider **out = 0);
120 
121  FWDialogBuilder &addTextButton(const char *text, TGTextButton **out = 0);
122  FWDialogBuilder &addValidatingTextEntry(const char *defaultText,
124  FWDialogBuilder &addTextEntry(const char *defaultText, TGTextEntry **out);
125  FWDialogBuilder &addNumberEntry(float defaultValue, size_t digits,
126  TGNumberFormat::EStyle style,
127  int min, int max,
128  TGNumberEntry **out);
129 
130  FWDialogBuilder &addCheckbox(const char *text, TGCheckButton **out = 0);
132 
133 
134  FWDialogBuilder &addHSeparator(size_t horizontalPadding = 4,
135  size_t verticalPadding = 3);
136 
137  FWDialogBuilder &tabs(TGTab **out);
138  FWDialogBuilder &untabs(void);
139  FWDialogBuilder &beginTab(const char *label);
140  FWDialogBuilder &endTab(void);
141 
142  FWDialogBuilder &floatLeft(size_t spacing = 3);
143 
144  FWDialogBuilder &spaceUp(size_t spacing = 3);
145  FWDialogBuilder &spaceDown(size_t spacing = 3);
146  FWDialogBuilder &spaceUpDown(size_t spacing = 3);
147  FWDialogBuilder &spaceLeft(size_t spacing = 3);
148  FWDialogBuilder &spaceRight(size_t spacing = 3);
149  FWDialogBuilder &spaceLeftRight(size_t spacing = 3);
150 
151  FWDialogBuilder &frameSpaceUp(size_t spacing = 3);
152  FWDialogBuilder &frameSpaceDown(size_t spacing = 3);
153  FWDialogBuilder &frameSpaceUpDown(size_t spacing = 3);
154  FWDialogBuilder &frameSpaceLeft(size_t spacing = 3);
155  FWDialogBuilder &frameSpaceRight(size_t spacing = 3);
156  FWDialogBuilder &frameSpaceLeftRight(size_t spacing = 3);
157 
158  FWDialogBuilder &expand(size_t expandX = true, size_t expandY = false);
159  FWDialogBuilder &vSpacer(size_t size = 0);
160  FWDialogBuilder &hSpacer(size_t size = 0);
161 
162 protected:
163  template <class T> FWDialogBuilder &extract(T *in, T **out)
164  {
165  if (out)
166  *out = in;
167  return *this;
168  }
169 
170 private:
172  TGTab *m_tabs;
173 };
174 
175 #endif
FWDialogBuilder & spaceUp(size_t spacing=3)
TGVerticalFrame * verticalFrame()
TGCompositeFrame * m_window
def window
Definition: svgfig.py:642
FWDialogBuilder & addHSlider(size_t size, TGHSlider **out=0)
FWDialogBuilder & frameSpaceUp(size_t spacing=3)
FWDialogBuilder & extract(T *in, T **out)
FWDialogBuilder(TGCompositeFrame *window, FWDialogBuilder *parent=0, bool expandY=true)
list parent
Definition: dbtoconf.py:74
TGCompositeFrame * nextFrame()
FWDialogBuilder & endTab(void)
FWDialogBuilder & frameSpaceRight(size_t spacing=3)
FWDialogBuilder & addLabel(const char *text, size_t fontSize=12, size_t weight=0, TGLabel **out=0)
FWDialogBuilder & spaceLeftRight(size_t spacing=3)
FWLayoutBuilder & frameSpaceRight(size_t spacing)
FWLayoutBuilder & spaceRight(size_t spacing)
std::vector< TGVerticalFrame * > m_framesStack
FWLayoutBuilder(TGCompositeFrame *window, bool expandY=true)
TGLayoutHints * m_currentHints
FWLayoutBuilder & frameSpaceDown(size_t spacing)
FWDialogBuilder & addTable(FWTableManagerBase *manager, FWTableWidget **out=0)
FWDialogBuilder & vSpacer(size_t size=0)
FWDialogBuilder & untabs(void)
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)
FWLayoutBuilder & floatLeft(size_t spacing)
FWDialogBuilder & addTextButton(const char *text, TGTextButton **out=0)
FWDialogBuilder & frameSpaceUpDown(size_t spacing=3)
FWDialogBuilder & addTextEdit(const char *defaultText=0, TGTextEdit **out=0)
TGLayoutHints * m_currentFrameHints
FWDialogBuilder & addTextView(const char *defaultText=0, TGTextView **out=0)
FWLayoutBuilder & unindent(void)
FWDialogBuilder & spaceUpDown(size_t spacing=3)
tuple text
Definition: runonSM.py:42
FWDialogBuilder & newRow()
TGCompositeFrame * currentFrame(void)
T min(T a, T b)
Definition: MathUtil.h:58
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)
tuple out
Definition: dbtoconf.py:99
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 & 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)
FWDialogBuilder & addHtml(TGHtml **out=0)
int weight
Definition: histoStyle.py:50
long double T
FWDialogBuilder & addCheckbox(const char *text, TGCheckButton **out=0)
FWDialogBuilder & indent(int left=2, int right=-1)
FWDialogBuilder & addNumberEntry(float defaultValue, size_t digits, TGNumberFormat::EStyle style, int min, int max, TGNumberEntry **out)
tuple size
Write out results.
FWDialogBuilder & spaceDown(size_t spacing=3)
FWLayoutBuilder & spaceLeft(size_t spacing)
FWLayoutBuilder & frameSpaceLeft(size_t spacing)
FWDialogBuilder & spaceRight(size_t spacing=3)
FWDialogBuilder & addColorPicker(const FWColorManager *manager, FWColorSelect **out=0)