#include <FWDialogBuilder.h>
Protected Member Functions | |
TGCompositeFrame * | currentFrame (void) |
FWLayoutBuilder & | expand (bool expandX=true, bool expandY=false) |
FWLayoutBuilder & | floatLeft (size_t spacing) |
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 | |
TGCompositeFrame * | m_currentFrame |
TGLayoutHints * | m_currentFrameHints |
TGLayoutHints * | m_currentHints |
bool | m_floatLeft |
std::vector< TGVerticalFrame * > | m_framesStack |
size_t | m_leftSpacing |
size_t | m_topSpacing |
TGCompositeFrame * | m_window |
Definition at line 24 of file FWDialogBuilder.h.
FWLayoutBuilder::FWLayoutBuilder | ( | TGCompositeFrame * | window, |
bool | expandY = true |
||
) | [protected] |
Definition at line 20 of file FWDialogBuilder.cc.
References m_framesStack, and m_window.
: m_window(window), m_currentFrame(0), m_floatLeft(false), m_topSpacing(0), m_leftSpacing(0), m_currentHints(0), m_currentFrameHints(0) { TGVerticalFrame *mainFrame = new TGVerticalFrame(window); TGLayoutHints *hints = new TGLayoutHints(expandY ? kLHintsExpandX|kLHintsExpandY : kLHintsExpandX, 0, 0, 0, 0); m_window->AddFrame(mainFrame, hints); m_framesStack.push_back(mainFrame); }
TGCompositeFrame* FWLayoutBuilder::currentFrame | ( | void | ) | [inline, protected] |
Definition at line 33 of file FWDialogBuilder.h.
References m_currentFrame.
Referenced by FWDialogBuilder::addCheckbox(), FWDialogBuilder::addColorPicker(), FWDialogBuilder::addHSeparator(), FWDialogBuilder::addHSlider(), FWDialogBuilder::addHtml(), FWDialogBuilder::addLabel(), FWDialogBuilder::addNumberEntry(), FWDialogBuilder::addTextButton(), FWDialogBuilder::addTextEdit(), FWDialogBuilder::addTextEntry(), FWDialogBuilder::addTextView(), FWDialogBuilder::addValidatingTextEntry(), FWDialogBuilder::hSpacer(), nextFrame(), FWDialogBuilder::tabs(), and FWDialogBuilder::vSpacer().
{ return m_currentFrame; }
FWLayoutBuilder & FWLayoutBuilder::expand | ( | bool | expandX = true , |
bool | expandY = false |
||
) | [protected] |
Set whether or not the previous layout element should expand and in which direction.
Definition at line 157 of file FWDialogBuilder.cc.
References m_currentHints.
Referenced by indent().
{ UInt_t style = 0; style |= expandX ? kLHintsExpandX : 0; style |= expandY ? kLHintsExpandY : 0; if (m_currentHints) m_currentHints->SetLayoutHints(style); return *this; }
FWLayoutBuilder & FWLayoutBuilder::floatLeft | ( | size_t | spacing | ) | [protected] |
Make sure that the current layout element is going to float on the left of the next one.
Reimplemented in FWDialogBuilder.
Definition at line 81 of file FWDialogBuilder.cc.
References m_floatLeft, and m_leftSpacing.
{ m_floatLeft = true; m_leftSpacing = spacing; return *this; }
FWLayoutBuilder & FWLayoutBuilder::frameSpaceDown | ( | size_t | spacing | ) | [protected] |
Reimplemented in FWDialogBuilder.
Definition at line 130 of file FWDialogBuilder.cc.
References m_currentFrameHints.
{ if (m_currentFrameHints) m_currentFrameHints->SetPadBottom(spacing); return *this; }
FWLayoutBuilder & FWLayoutBuilder::frameSpaceLeft | ( | size_t | spacing | ) | [protected] |
Reimplemented in FWDialogBuilder.
Definition at line 138 of file FWDialogBuilder.cc.
References m_currentFrameHints.
{ if (m_currentFrameHints) m_currentFrameHints->SetPadLeft(spacing); return *this; }
FWLayoutBuilder & FWLayoutBuilder::frameSpaceRight | ( | size_t | spacing | ) | [protected] |
Reimplemented in FWDialogBuilder.
Definition at line 146 of file FWDialogBuilder.cc.
References m_currentFrameHints.
{ if (m_currentFrameHints) m_currentFrameHints->SetPadRight(spacing); return *this; }
FWLayoutBuilder & FWLayoutBuilder::frameSpaceUp | ( | size_t | spacing | ) | [protected] |
Reimplemented in FWDialogBuilder.
Definition at line 122 of file FWDialogBuilder.cc.
References m_currentFrameHints.
{ if (m_currentFrameHints) m_currentFrameHints->SetPadTop(spacing); return *this; }
FWLayoutBuilder & FWLayoutBuilder::indent | ( | int | left = 2 , |
int | right = -1 |
||
) | [protected] |
Reimplemented in FWDialogBuilder.
Definition at line 46 of file FWDialogBuilder.cc.
References expand(), m_currentHints, m_framesStack, newRow(), and dbtoconf::parent.
{ if (right < 0) right = left; TGVerticalFrame *parent = m_framesStack.back(); TGLayoutHints *hints = new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, left, right, 0, 0); m_currentHints = 0; m_framesStack.push_back(new TGVerticalFrame(parent)); parent->AddFrame(m_framesStack.back(), hints); return newRow().expand(true, false); }
bool FWLayoutBuilder::isFloatingLeft | ( | ) | [inline, protected] |
Definition at line 45 of file FWDialogBuilder.h.
References m_floatLeft.
Referenced by nextFrame().
{ return m_floatLeft; }
FWLayoutBuilder & FWLayoutBuilder::newRow | ( | void | ) | [protected] |
Reimplemented in FWDialogBuilder.
Definition at line 37 of file FWDialogBuilder.cc.
References m_currentFrame, m_currentFrameHints, m_currentHints, and m_framesStack.
Referenced by indent(), and nextFrame().
{ m_currentFrameHints = m_currentHints = new TGLayoutHints(kLHintsExpandX); m_currentFrame = new TGHorizontalFrame(m_framesStack.back()); m_framesStack.back()->AddFrame(m_currentFrame, m_currentHints); return *this; }
TGCompositeFrame * FWLayoutBuilder::nextFrame | ( | ) | [protected] |
Definition at line 191 of file FWDialogBuilder.cc.
References currentFrame(), isFloatingLeft(), and newRow().
Referenced by FWDialogBuilder::addCheckbox(), FWDialogBuilder::addColorPicker(), FWDialogBuilder::addHSeparator(), FWDialogBuilder::addHSlider(), FWDialogBuilder::addHtml(), FWDialogBuilder::addLabel(), FWDialogBuilder::addNumberEntry(), FWDialogBuilder::addTextButton(), FWDialogBuilder::addTextEdit(), FWDialogBuilder::addTextEntry(), FWDialogBuilder::addTextView(), FWDialogBuilder::addValidatingTextEntry(), FWDialogBuilder::hSpacer(), FWDialogBuilder::tabs(), and FWDialogBuilder::vSpacer().
{ if (!isFloatingLeft()) newRow(); return currentFrame(); }
TGLayoutHints * FWLayoutBuilder::nextHints | ( | ) | [protected] |
Definition at line 170 of file FWDialogBuilder.cc.
References m_currentHints, m_floatLeft, m_leftSpacing, and m_topSpacing.
Referenced by FWDialogBuilder::addCheckbox(), FWDialogBuilder::addColorPicker(), FWDialogBuilder::addHSlider(), FWDialogBuilder::addHtml(), FWDialogBuilder::addLabel(), FWDialogBuilder::addNumberEntry(), FWDialogBuilder::addTextButton(), FWDialogBuilder::addTextEdit(), FWDialogBuilder::addTextEntry(), FWDialogBuilder::addTextView(), FWDialogBuilder::addValidatingTextEntry(), FWDialogBuilder::hSpacer(), FWDialogBuilder::tabs(), and FWDialogBuilder::vSpacer().
{ if (m_floatLeft) { size_t left = m_leftSpacing; m_floatLeft = false; m_leftSpacing = 0; assert(m_currentHints); m_currentHints = new TGLayoutHints(kLHintsExpandX, left, 0, m_currentHints->GetPadTop(), 0); } else { size_t top = m_topSpacing; m_topSpacing = 3; m_currentHints = new TGLayoutHints(kLHintsExpandX, 0, 0, top, 0); } return m_currentHints; }
FWLayoutBuilder & FWLayoutBuilder::spaceDown | ( | size_t | spacing | ) | [protected] |
Reimplemented in FWDialogBuilder.
Definition at line 97 of file FWDialogBuilder.cc.
References m_currentHints.
{ if (m_currentHints) m_currentHints->SetPadBottom(spacing); return *this; }
FWLayoutBuilder & FWLayoutBuilder::spaceLeft | ( | size_t | spacing | ) | [protected] |
Reimplemented in FWDialogBuilder.
Definition at line 105 of file FWDialogBuilder.cc.
References m_currentHints.
{ if (m_currentHints) m_currentHints->SetPadLeft(spacing); return *this; }
FWLayoutBuilder & FWLayoutBuilder::spaceRight | ( | size_t | spacing | ) | [protected] |
Reimplemented in FWDialogBuilder.
Definition at line 113 of file FWDialogBuilder.cc.
References m_currentHints.
{ if (m_currentHints) m_currentHints->SetPadRight(spacing); return *this; }
FWLayoutBuilder & FWLayoutBuilder::spaceUp | ( | size_t | spacing | ) | [protected] |
Reimplemented in FWDialogBuilder.
Definition at line 89 of file FWDialogBuilder.cc.
References m_currentHints.
{ if (m_currentHints) m_currentHints->SetPadTop(spacing); return *this; }
FWLayoutBuilder & FWLayoutBuilder::unindent | ( | void | ) | [protected] |
Removes all the frames on the stack since last indent.
Reimplemented in FWDialogBuilder.
Definition at line 70 of file FWDialogBuilder.cc.
References m_framesStack.
{ assert(!m_framesStack.empty()); m_framesStack.pop_back(); return *this; }
TGVerticalFrame * FWLayoutBuilder::verticalFrame | ( | void | ) | [protected] |
Return the last vertical frame, for more control on the layout.
Definition at line 62 of file FWDialogBuilder.cc.
References m_framesStack.
Referenced by FWDialogBuilder::addTable().
{ assert(m_framesStack.size()); return m_framesStack.back(); }
TGCompositeFrame* FWLayoutBuilder::m_currentFrame [private] |
Definition at line 55 of file FWDialogBuilder.h.
Referenced by currentFrame(), and newRow().
TGLayoutHints* FWLayoutBuilder::m_currentFrameHints [private] |
Definition at line 61 of file FWDialogBuilder.h.
Referenced by frameSpaceDown(), frameSpaceLeft(), frameSpaceRight(), frameSpaceUp(), and newRow().
TGLayoutHints* FWLayoutBuilder::m_currentHints [private] |
Definition at line 60 of file FWDialogBuilder.h.
Referenced by expand(), indent(), newRow(), nextHints(), spaceDown(), spaceLeft(), spaceRight(), and spaceUp().
bool FWLayoutBuilder::m_floatLeft [private] |
Definition at line 57 of file FWDialogBuilder.h.
Referenced by floatLeft(), isFloatingLeft(), and nextHints().
std::vector<TGVerticalFrame *> FWLayoutBuilder::m_framesStack [private] |
Definition at line 53 of file FWDialogBuilder.h.
Referenced by FWLayoutBuilder(), indent(), newRow(), unindent(), and verticalFrame().
size_t FWLayoutBuilder::m_leftSpacing [private] |
Definition at line 59 of file FWDialogBuilder.h.
Referenced by floatLeft(), and nextHints().
size_t FWLayoutBuilder::m_topSpacing [private] |
Definition at line 58 of file FWDialogBuilder.h.
Referenced by nextHints().
TGCompositeFrame* FWLayoutBuilder::m_window [private] |
Definition at line 51 of file FWDialogBuilder.h.
Referenced by FWLayoutBuilder().