You.i Engine
YiLinearLayout.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_LINEAR_LAYOUT_H_
3 #define _YI_LINEAR_LAYOUT_H_
4 
6 
93 {
94 public:
95  enum class Orientation
96  {
97  Horizontal,
98  Vertical,
99  Shaft
100  };
101 
102  enum class Overflow
103  {
104  Ignore,
105  Hide,
106  Wrap,
107  WrapAndHide
108  };
109 
110  enum class LineGravity
111  {
112  Default,
113  Start,
114  Middle,
115  End,
116  Justify
117  };
118 
119  CYILinearLayout();
120  virtual ~CYILinearLayout();
121 
129  void SetSpacing(float spacing);
130 
131  float GetSpacing() const;
132 
138  void SetJustify(bool justify);
139 
140  bool IsUsingJustify() const;
141 
149  void SetOrientation(Orientation orientation);
150 
151  Orientation GetOrientation() const;
152 
158  void SetOverflowMode(Overflow mode);
159 
160  Overflow GetOverflowMode() const;
161 
169  void SetLineGravity(LineGravity lineGravity);
170 
171  LineGravity GetLineGravity() const;
172 
173 protected:
174  virtual void Configure() override;
175  virtual void OnMeasure(const CYISceneNode::MeasureSpec &widthSpec, const CYISceneNode::MeasureSpec &heightSpec, const CYISceneNode::MeasureSpec &depthSpec) override;
176  virtual void OnApplyMeasurements() override;
177 
178  float m_spacing;
179  bool m_justify;
183 
184 private:
185  class CYILinearLayoutPriv;
186 
187  std::unique_ptr<CYILinearLayoutPriv> m_pPriv;
188 
190 };
191 
194 #endif // _YI_LINEAR_LAYOUT_H_
virtual void Configure() override
void SetOrientation(Orientation orientation)
Overflow m_overflowMode
Definition: YiLinearLayout.h:181
A layout that positions all of its children in a row, a column, or a &#39;shaft&#39;.
Definition: YiLinearLayout.h:92
virtual ~CYILinearLayout()
Orientation GetOrientation() const
LineGravity m_lineGravity
Definition: YiLinearLayout.h:182
Align children on top of one another along the z axis.
Overflow GetOverflowMode() const
virtual void OnApplyMeasurements() override
float m_spacing
Definition: YiLinearLayout.h:178
void SetSpacing(float spacing)
bool IsUsingJustify() const
Align children along the y axis.
void SetOverflowMode(Overflow mode)
Definition: YiSceneNode.h:373
virtual void OnMeasure(const CYISceneNode::MeasureSpec &widthSpec, const CYISceneNode::MeasureSpec &heightSpec, const CYISceneNode::MeasureSpec &depthSpec) override
bool m_justify
Definition: YiLinearLayout.h:179
void SetJustify(bool justify)
A layout that can animate its children&#39;s position and size.
Definition: YiAnimatingLayout.h:67
Orientation
Definition: YiLinearLayout.h:95
Overflow
Definition: YiLinearLayout.h:102
float GetSpacing() const
#define YI_TYPE_BASES(CLASS, BASES...)
Definition: YiRtti.h:257
Align children side-by-side along the x axis.
LineGravity GetLineGravity() const
void SetLineGravity(LineGravity lineGravity)
Orientation m_orientation
Definition: YiLinearLayout.h:180
LineGravity
Definition: YiLinearLayout.h:110