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 totalNonWeightedChildrenPreferredSize(YUIDimension dimension)
Add up all the non-weighted children's preferred sizes in the specified dimension.
YWidget * findDominatingChild()
Determine the number of the "dominating child" - the child widget that determines the overall size wi...
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 preferredSize(YUIDimension dim)
Preferred size of the widget in the specified dimension.
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.
int countStretchableChildren(YUIDimension dimension)
Count the number of stretchable ( non-weighted ) children.
virtual bool stretchable(YUIDimension dimension) const
Returns the stretchability of the layout box: The layout box is stretchable if one of the children is...
bool debugLayout() const
Returns 'true' if layout debugging (verbose logging during layout) is on.
virtual int preferredWidth()
Preferred width of the widget.
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...
YUIDimension secondary() const
Return the secondary dimension.
YUIDimension primary() const
Return the primary dimension, i.e., the dimension this LayoutBox lays out its children in: YD_VERT fo...
virtual ~YLayoutBox()
Destructor.
virtual void moveChild(YWidget *child, int newX, int newY)=0
Move a child to a new position.
int childrenTotalWeight(YUIDimension dimension)
Add up all the children's weights.
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.
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...
virtual int preferredHeight()
Preferred height of the widget.
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.
YLayoutBox(YWidget *parent, YUIDimension dim)
Constructor.
void setDebugLayout(bool deb=true)
Enable or disable layout debugging.