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;
191 sizeVector & childSize,
192 posVector & childPos );
199 sizeVector & childSize,
200 posVector & childPos );
225 #endif // YLayoutBox_h bool debugLayout() const
Returns 'true' if layout debugging (verbose logging during layout) is on.
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.
static bool isLayoutStretch(YWidget *child, YUIDimension dimension)
Check if this is a layout stretch widget in the specfied dimension, i.e.
A vertical or horizontal stacking of widgets, implementing HBox and VBox.
virtual int preferredWidth()
Preferred width of the widget.
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...
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...
void setDebugLayout(bool deb=true)
Enable or disable layout debugging.
virtual void setSize(int newWidth, int newHeight)
Sets the size of the layout box.
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 const char * widgetClass() const
Returns a descriptive name of this widget class for logging, debugging etc.
YUIDimension secondary() const
Return the secondary dimension.
int countNonWeightedChildren(YUIDimension dimension)
Count the number of non-weighted children.
int totalNonWeightedChildrenPreferredSize(YUIDimension dimension)
Add up all the non-weighted children's preferred sizes in the specified dimension.
virtual int preferredSize(YUIDimension dim)
Preferred size of the widget in the specified dimension.
virtual int preferredHeight()
Preferred height of the widget.
YLayoutBox(YWidget *parent, YUIDimension dim)
Constructor.
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 countStretchableChildren(YUIDimension dimension)
Count the number of stretchable ( non-weighted ) children.
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...
int childrenMaxPreferredSize(YUIDimension dimension)
Return the maximum preferred size of all children in the specified dimension.
int countLayoutStretchChildren(YUIDimension dimension)
Count the number of "rubber bands", i.e.
virtual ~YLayoutBox()
Destructor.