40 typedef std::vector<int> sizeVector;
41 typedef std::vector<int> posVector;
114 virtual void setSize(
int newWidth,
int newHeight );
124 virtual bool stretchable( YUIDimension dimension )
const;
190 sizeVector & childSize,
191 posVector & childPos );
198 sizeVector & childSize,
199 posVector & childPos );
A vertical or horizontal stacking of widgets, implementing HBox and VBox.
bool debugLayout() const
Returns 'true' if layout debugging (verbose logging during layout) is on.
void calcPrimaryGeometry(int newSize, sizeVector &childSize, posVector &childPos)
Calculate the sizes and positions of all children in the primary dimension and store them in "childSi...
static bool isLayoutStretch(YWidget *child, YUIDimension dimension)
Check if this is a layout stretch widget in the specfied dimension, i.e.
virtual bool stretchable(YUIDimension dimension) const
Returns the stretchability of the layout box: The layout box is stretchable if one of the children is...
int childrenMaxPreferredSize(YUIDimension dimension)
Return the maximum preferred size of all children in the specified dimension.
virtual int preferredHeight()
Preferred height of the widget.
YUIDimension primary() const
Return the primary dimension, i.e., the dimension this LayoutBox lays out its children in: YD_VERT fo...
YWidget * findDominatingChild()
Determine the number of the "dominating child" - the child widget that determines the overall size wi...
virtual ~YLayoutBox()
Destructor.
int childrenTotalWeight(YUIDimension dimension)
Add up all the children's weights.
virtual void moveChild(YWidget *child, int newX, int newY)=0
Move a child to a new position.
int countStretchableChildren(YUIDimension dimension)
Count the number of stretchable ( non-weighted ) children.
virtual int preferredSize(YUIDimension dim)
Preferred size of the widget in the specified dimension.
void doResize(sizeVector &width, sizeVector &height, posVector &x_pos, posVector &y_pos)
Actually perform resizing and moving the child widgets to the appropriate position.
virtual void setSize(int newWidth, int newHeight)
Sets the size of the layout box.
void setDebugLayout(bool deb=true)
Enable or disable layout debugging.
YLayoutBox(YWidget *parent, YUIDimension dim)
Constructor.
void calcSecondaryGeometry(int newSize, sizeVector &childSize, posVector &childPos)
Calculate the sizes and positions of all children in the secondary dimension and store them in "child...
int countLayoutStretchChildren(YUIDimension dimension)
Count the number of "rubber bands", i.e.
int countNonWeightedChildren(YUIDimension dimension)
Count the number of non-weighted children.
virtual const char * widgetClass() const
Returns a descriptive name of this widget class for logging, debugging etc.
virtual int preferredWidth()
Preferred width of the widget.
int totalNonWeightedChildrenPreferredSize(YUIDimension dimension)
Add up all the non-weighted children's preferred sizes in the specified dimension.
YUIDimension secondary() const
Return the secondary dimension.