CMS 3D CMS Logo

List of all members | Protected Member Functions | Private Attributes
FWLayoutBuilder Class Reference

#include <FWDialogBuilder.h>

Inheritance diagram for FWLayoutBuilder:
FWDialogBuilder

Protected Member Functions

TGCompositeFrame * currentFrame (void)
 
FWLayoutBuilderexpand (bool expandX=true, bool expandY=false)
 
FWLayoutBuilderfloatLeft (size_t spacing)
 
void frameForTab ()
 
FWLayoutBuilderframeSpaceDown (size_t spacing)
 
FWLayoutBuilderframeSpaceLeft (size_t spacing)
 
FWLayoutBuilderframeSpaceRight (size_t spacing)
 
FWLayoutBuilderframeSpaceUp (size_t spacing)
 
 FWLayoutBuilder (TGCompositeFrame *window, bool expandY=true)
 
FWLayoutBuilderindent (int left=2, int right=-1)
 
bool isFloatingLeft ()
 
FWLayoutBuildernewRow ()
 
TGCompositeFrame * nextFrame ()
 
TGLayoutHints * nextHints ()
 
FWLayoutBuilderspaceDown (size_t spacing)
 
FWLayoutBuilderspaceLeft (size_t spacing)
 
FWLayoutBuilderspaceRight (size_t spacing)
 
FWLayoutBuilderspaceUp (size_t spacing)
 
FWLayoutBuilderunindent (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
 

Detailed Description

Definition at line 24 of file FWDialogBuilder.h.

Constructor & Destructor Documentation

◆ FWLayoutBuilder()

FWLayoutBuilder::FWLayoutBuilder ( TGCompositeFrame *  window,
bool  expandY = true 
)
protected

Definition at line 19 of file FWDialogBuilder.cc.

20  : m_window(window),
21  m_currentFrame(nullptr),
22  m_floatLeft(false),
23  m_topSpacing(0),
24  m_leftSpacing(0),
25  m_currentHints(nullptr),
26  m_currentFrameHints(nullptr) {
27  TGVerticalFrame *mainFrame = new TGVerticalFrame(window);
28  TGLayoutHints *hints = new TGLayoutHints(expandY ? kLHintsExpandX | kLHintsExpandY : kLHintsExpandX, 0, 0, 0, 0);
29  m_window->AddFrame(mainFrame, hints);
30  m_framesStack.push_back(mainFrame);
31 }

References m_framesStack, m_window, and svgfig::window().

Member Function Documentation

◆ currentFrame()

TGCompositeFrame* FWLayoutBuilder::currentFrame ( void  )
inlineprotected

◆ expand()

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 125 of file FWDialogBuilder.cc.

125  {
126  UInt_t style = 0;
127  style |= expandX ? kLHintsExpandX : 0;
128  style |= expandY ? kLHintsExpandY : 0;
129 
130  if (m_currentHints)
131  m_currentHints->SetLayoutHints(style);
132  return *this;
133 }

References m_currentHints.

Referenced by FWDialogBuilder::expand(), and indent().

◆ floatLeft()

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.

Definition at line 68 of file FWDialogBuilder.cc.

68  {
69  m_floatLeft = true;
70  m_leftSpacing = spacing;
71  return *this;
72 }

References m_floatLeft, and m_leftSpacing.

Referenced by FWDialogBuilder::floatLeft().

◆ frameForTab()

void FWLayoutBuilder::frameForTab ( )
protected

Definition at line 158 of file FWDialogBuilder.cc.

158  {
159  m_currentFrame = new TGVerticalFrame(m_framesStack.back());
160  m_currentFrame->SetBackgroundColor(0x000000);
161  m_framesStack.back()->AddFrame(m_currentFrame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
162  // m_frameStack.push_back(m_currentFrame);
163 }

References m_currentFrame, and m_framesStack.

Referenced by FWDialogBuilder::tabs().

◆ frameSpaceDown()

FWLayoutBuilder & FWLayoutBuilder::frameSpaceDown ( size_t  spacing)
protected

Definition at line 104 of file FWDialogBuilder.cc.

104  {
106  m_currentFrameHints->SetPadBottom(spacing);
107  return *this;
108 }

References m_currentFrameHints.

Referenced by FWDialogBuilder::frameSpaceDown(), and FWDialogBuilder::frameSpaceUpDown().

◆ frameSpaceLeft()

FWLayoutBuilder & FWLayoutBuilder::frameSpaceLeft ( size_t  spacing)
protected

Definition at line 110 of file FWDialogBuilder.cc.

110  {
112  m_currentFrameHints->SetPadLeft(spacing);
113  return *this;
114 }

References m_currentFrameHints.

Referenced by FWDialogBuilder::frameSpaceLeft(), and FWDialogBuilder::frameSpaceLeftRight().

◆ frameSpaceRight()

FWLayoutBuilder & FWLayoutBuilder::frameSpaceRight ( size_t  spacing)
protected

Definition at line 116 of file FWDialogBuilder.cc.

116  {
118  m_currentFrameHints->SetPadRight(spacing);
119  return *this;
120 }

References m_currentFrameHints.

Referenced by FWDialogBuilder::frameSpaceLeftRight(), and FWDialogBuilder::frameSpaceRight().

◆ frameSpaceUp()

FWLayoutBuilder & FWLayoutBuilder::frameSpaceUp ( size_t  spacing)
protected

Definition at line 98 of file FWDialogBuilder.cc.

98  {
100  m_currentFrameHints->SetPadTop(spacing);
101  return *this;
102 }

References m_currentFrameHints.

Referenced by FWDialogBuilder::frameSpaceUp(), and FWDialogBuilder::frameSpaceUpDown().

◆ indent()

FWLayoutBuilder & FWLayoutBuilder::indent ( int  left = 2,
int  right = -1 
)
protected

Definition at line 40 of file FWDialogBuilder.cc.

40  {
41  if (right < 0)
42  right = left;
43 
44  TGVerticalFrame *parent = m_framesStack.back();
45  TGLayoutHints *hints = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, left, right, 0, 0);
46  m_currentHints = nullptr;
47  m_framesStack.push_back(new TGVerticalFrame(parent));
48  parent->AddFrame(m_framesStack.back(), hints);
49  return newRow().expand(true, false);
50 }

References expand(), m_currentHints, m_framesStack, newRow(), and class-composition::parent.

Referenced by ntuplePrintersDiff.TrackingParticlePrinter::_parentageChain(), FWDialogBuilder::indent(), ntuplePrintersDiff.SeedPrinter::printHits(), ntuplePrintersDiff.TrackPrinter::printHits(), and ntuplePrintersDiff.TrackingParticlePrinter::printTrackingParticle().

◆ isFloatingLeft()

bool FWLayoutBuilder::isFloatingLeft ( )
inlineprotected

Definition at line 44 of file FWDialogBuilder.h.

44 { return m_floatLeft; }

References m_floatLeft.

Referenced by nextFrame().

◆ newRow()

FWLayoutBuilder & FWLayoutBuilder::newRow ( void  )
protected

Definition at line 33 of file FWDialogBuilder.cc.

33  {
34  m_currentFrameHints = m_currentHints = new TGLayoutHints(kLHintsExpandX);
35  m_currentFrame = new TGHorizontalFrame(m_framesStack.back());
36  m_framesStack.back()->AddFrame(m_currentFrame, m_currentHints);
37  return *this;
38 }

References m_currentFrame, m_currentFrameHints, m_currentHints, and m_framesStack.

Referenced by indent(), FWDialogBuilder::newRow(), and nextFrame().

◆ nextFrame()

TGCompositeFrame * FWLayoutBuilder::nextFrame ( )
protected

◆ nextHints()

TGLayoutHints * FWLayoutBuilder::nextHints ( )
protected

◆ spaceDown()

FWLayoutBuilder & FWLayoutBuilder::spaceDown ( size_t  spacing)
protected

Definition at line 80 of file FWDialogBuilder.cc.

80  {
81  if (m_currentHints)
82  m_currentHints->SetPadBottom(spacing);
83  return *this;
84 }

References m_currentHints.

Referenced by FWDialogBuilder::spaceDown(), and FWDialogBuilder::spaceUpDown().

◆ spaceLeft()

FWLayoutBuilder & FWLayoutBuilder::spaceLeft ( size_t  spacing)
protected

Definition at line 86 of file FWDialogBuilder.cc.

86  {
87  if (m_currentHints)
88  m_currentHints->SetPadLeft(spacing);
89  return *this;
90 }

References m_currentHints.

Referenced by FWDialogBuilder::spaceLeft(), and FWDialogBuilder::spaceLeftRight().

◆ spaceRight()

FWLayoutBuilder & FWLayoutBuilder::spaceRight ( size_t  spacing)
protected

Definition at line 92 of file FWDialogBuilder.cc.

92  {
93  if (m_currentHints)
94  m_currentHints->SetPadRight(spacing);
95  return *this;
96 }

References m_currentHints.

Referenced by FWDialogBuilder::spaceLeftRight(), and FWDialogBuilder::spaceRight().

◆ spaceUp()

FWLayoutBuilder & FWLayoutBuilder::spaceUp ( size_t  spacing)
protected

Definition at line 74 of file FWDialogBuilder.cc.

74  {
75  if (m_currentHints)
76  m_currentHints->SetPadTop(spacing);
77  return *this;
78 }

References m_currentHints.

Referenced by FWDialogBuilder::spaceUp(), and FWDialogBuilder::spaceUpDown().

◆ unindent()

FWLayoutBuilder & FWLayoutBuilder::unindent ( void  )
protected

Removes all the frames on the stack since last indent.

Definition at line 59 of file FWDialogBuilder.cc.

59  {
60  assert(!m_framesStack.empty());
61  m_framesStack.pop_back();
62  return *this;
63 }

References cms::cuda::assert(), and m_framesStack.

Referenced by FWDialogBuilder::unindent().

◆ verticalFrame()

TGVerticalFrame * FWLayoutBuilder::verticalFrame ( void  )
protected

Return the last vertical frame, for more control on the layout.

Definition at line 53 of file FWDialogBuilder.cc.

53  {
54  assert(m_framesStack.size());
55  return m_framesStack.back();
56 }

References cms::cuda::assert(), and m_framesStack.

Referenced by FWDialogBuilder::addTable().

Member Data Documentation

◆ m_currentFrame

TGCompositeFrame* FWLayoutBuilder::m_currentFrame
private

Definition at line 55 of file FWDialogBuilder.h.

Referenced by currentFrame(), frameForTab(), and newRow().

◆ m_currentFrameHints

TGLayoutHints* FWLayoutBuilder::m_currentFrameHints
private

◆ m_currentHints

TGLayoutHints* FWLayoutBuilder::m_currentHints
private

Definition at line 60 of file FWDialogBuilder.h.

Referenced by expand(), indent(), newRow(), nextHints(), spaceDown(), spaceLeft(), spaceRight(), and spaceUp().

◆ m_floatLeft

bool FWLayoutBuilder::m_floatLeft
private

Definition at line 57 of file FWDialogBuilder.h.

Referenced by floatLeft(), isFloatingLeft(), and nextHints().

◆ m_framesStack

std::vector<TGVerticalFrame *> FWLayoutBuilder::m_framesStack
private

Definition at line 53 of file FWDialogBuilder.h.

Referenced by frameForTab(), FWLayoutBuilder(), indent(), newRow(), unindent(), and verticalFrame().

◆ m_leftSpacing

size_t FWLayoutBuilder::m_leftSpacing
private

Definition at line 59 of file FWDialogBuilder.h.

Referenced by floatLeft(), and nextHints().

◆ m_topSpacing

size_t FWLayoutBuilder::m_topSpacing
private

Definition at line 58 of file FWDialogBuilder.h.

Referenced by nextHints().

◆ m_window

TGCompositeFrame* FWLayoutBuilder::m_window
private

Definition at line 51 of file FWDialogBuilder.h.

Referenced by FWLayoutBuilder().

FWLayoutBuilder::m_currentFrame
TGCompositeFrame * m_currentFrame
Definition: FWDialogBuilder.h:55
FWLayoutBuilder::m_leftSpacing
size_t m_leftSpacing
Definition: FWDialogBuilder.h:59
FWLayoutBuilder::m_window
TGCompositeFrame * m_window
Definition: FWDialogBuilder.h:51
FWLayoutBuilder::m_currentHints
TGLayoutHints * m_currentHints
Definition: FWDialogBuilder.h:60
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
cms::cuda::assert
assert(be >=bs)
FWLayoutBuilder::currentFrame
TGCompositeFrame * currentFrame(void)
Definition: FWDialogBuilder.h:32
FWLayoutBuilder::expand
FWLayoutBuilder & expand(bool expandX=true, bool expandY=false)
Definition: FWDialogBuilder.cc:125
FWLayoutBuilder::m_topSpacing
size_t m_topSpacing
Definition: FWDialogBuilder.h:58
style
Definition: style.py:1
FWLayoutBuilder::m_framesStack
std::vector< TGVerticalFrame * > m_framesStack
Definition: FWDialogBuilder.h:53
FWLayoutBuilder::m_currentFrameHints
TGLayoutHints * m_currentFrameHints
Definition: FWDialogBuilder.h:61
FWLayoutBuilder::isFloatingLeft
bool isFloatingLeft()
Definition: FWDialogBuilder.h:44
FWLayoutBuilder::m_floatLeft
bool m_floatLeft
Definition: FWDialogBuilder.h:57
FWLayoutBuilder::newRow
FWLayoutBuilder & newRow()
Definition: FWDialogBuilder.cc:33
class-composition.parent
parent
Definition: class-composition.py:88