libyui
|
#include <YLayoutBox.h>
Public Types | |
typedef std::vector< int > | sizeVector |
typedef std::vector< int > | posVector |
Static Public Member Functions | |
static bool | isLayoutStretch (YWidget *child, YUIDimension dimension) |
Protected Member Functions | |
YLayoutBox (YWidget *parent, YUIDimension dim) | |
int | childrenTotalWeight (YUIDimension dimension) |
int | childrenMaxPreferredSize (YUIDimension dimension) |
int | totalNonWeightedChildrenPreferredSize (YUIDimension dimension) |
int | countNonWeightedChildren (YUIDimension dimension) |
int | countStretchableChildren (YUIDimension dimension) |
int | countLayoutStretchChildren (YUIDimension dimension) |
YWidget * | findDominatingChild () |
void | calcPrimaryGeometry (int newSize, sizeVector &childSize, posVector &childPos) |
void | calcSecondaryGeometry (int newSize, sizeVector &childSize, posVector &childPos) |
void | doResize (sizeVector &width, sizeVector &height, posVector &x_pos, posVector &y_pos) |
![]() | |
YWidget (YWidget *parent) | |
YWidgetChildrenManager * | childrenManager () const |
void | setChildrenManager (YWidgetChildrenManager *manager) |
void | setBeingDestroyed () |
void | dumpWidget (YWidget *w, int indentationLevel) |
A vertical or horizontal stacking of widgets, implementing HBox and VBox.
|
protected |
Constructor.
Creates a VBox for dim == YD_VERT or a HBox for YD_HORIZ.
|
virtual |
Destructor.
|
protected |
Calculate the sizes and positions of all children in the primary dimension and store them in "childSize" and "childPos".
|
protected |
Calculate the sizes and positions of all children in the secondary dimension and store them in "childSize" and "childPos".
|
protected |
Return the maximum preferred size of all children in the specified dimension.
|
protected |
Add up all the children's weights.
|
protected |
|
protected |
Count the number of non-weighted children.
|
protected |
Count the number of stretchable ( non-weighted ) children. Note: Weighted children are always considered stretchable.
bool YLayoutBox::debugLayout | ( | ) | const |
Returns 'true' if layout debugging (verbose logging during layout) is on.
|
protected |
Actually perform resizing and moving the child widgets to the appropriate position.
The vectors passed are the sizes previously calculated by calcPrimaryGeometry() and calcSecondaryGeometry().
|
protected |
Determine the number of the "dominating child" - the child widget that determines the overall size with respect to its weight.
Return 0 if there is no dominating child, i.e. none of the children has a weight specified.
Check if this is a layout stretch widget in the specfied dimension, i.e. an empty widget that is stretchable.
Move a child to a new position.
Derived classes are required to implement this.
|
virtual |
|
virtual |
|
virtual |
YUIDimension YLayoutBox::primary | ( | ) | const |
Return the primary dimension, i.e., the dimension this LayoutBox lays out its children in: YD_VERT for a VBox, YD_HORIZ for a HBox.
YUIDimension YLayoutBox::secondary | ( | ) | const |
Return the secondary dimension.
|
virtual |
|
protected |
Add up all the non-weighted children's preferred sizes in the specified dimension.
Returns a descriptive name of this widget class for logging, debugging etc.
Reimplemented from YWidget.