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 );
224 #endif // YLayoutBox_h 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.
virtual bool stretchable(YUIDimension dimension) const
Returns the stretchability of the layout box: The layout box is stretchable if one of the children is...
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.
bool debugLayout() const
Returns 'true' if layout debugging (verbose logging during layout) is on.
virtual int preferredWidth()
Preferred width of the widget.
YUIDimension secondary() const
Return the secondary dimension.
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.
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.
int countStretchableChildren(YUIDimension dimension)
Count the number of stretchable ( non-weighted ) children.
YWidget * findDominatingChild()
Determine the number of the "dominating child" - the child widget that determines the overall size wi...
virtual const char * widgetClass() const
Returns a descriptive name of this widget class for logging, debugging etc.
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.
YUIDimension primary() const
Return the primary dimension, i.e., the dimension this LayoutBox lays out its children in: YD_VERT fo...
virtual ~YLayoutBox()
Destructor.