YSplit Class Reference

Implementation of the Split widget. More...

#include <YSplit.h>

Inheritance diagram for YSplit:

YContainerWidget YWidget List of all members.

Public Types

typedef vector< long > sizeVector
typedef vector< long > posVector

Public Member Functions

 YSplit (const YWidgetOpt &opt, YUIDimension newPrimaryDimension)
virtual char * widgetClass ()
YUIDimension dimension () const
YUIDimension primaryDimension () const
YUIDimension secondaryDimension () const
virtual long nicesize (YUIDimension dimension)
virtual bool stretchable (YUIDimension dimension) const
void setSize (long newwidth, long newheight)
virtual void moveChild (YWidget *child, long newx, long newy)=0

Protected Member Functions

long childrenTotalWeight (YUIDimension dimension)
long childrenMaxNiceSize (YUIDimension dimension)
long totalNonWeightedChildrenNiceSize (YUIDimension dimension)
int countNonWeightedChildren (YUIDimension dimension)
int countStretchableChildren (YUIDimension dimension)
int countLayoutStretchChildren (YUIDimension dimension)
int bossChild ()
void calcPrimaryGeometry (long newSize, sizeVector &childSize, posVector &childPos)
void calcSecondaryGeometry (long newSize, sizeVector &childSize, posVector &childPos)
void doResize (sizeVector &width, sizeVector &height, posVector &x_pos, posVector &y_pos)

Protected Attributes

YUIDimension primary
YUIDimension secondary
bool debugLayout

Detailed Description

Implementation of the Split widget.


Member Typedef Documentation

typedef vector<long> YSplit::sizeVector

typedef vector<long> YSplit::posVector


Constructor & Destructor Documentation

YSplit::YSplit ( const YWidgetOpt opt,
YUIDimension  newPrimaryDimension 
)

Creates a new YSplit


Member Function Documentation

virtual char* YSplit::widgetClass (  )  [inline, virtual]

Returns a descriptive name of this widget class for logging, debugging etc.

Reimplemented from YContainerWidget.

YUIDimension YSplit::dimension (  )  const [inline]

Returns the dimensions.

YUIDimension YSplit::primaryDimension (  )  const [inline]

YUIDimension YSplit::secondaryDimension (  )  const [inline]

long YSplit::nicesize ( YUIDimension  dimension  )  [virtual]

Minimum size the widget should have to make it look and feel nice, i.e. all of the widget's preferred size.

For the "primary" dimension, this is the sum of the children's nice sizes with respect to any specified weight ratios - i.e. the weights will always be respected. Children may be stretched as appropriate.

For the "other" dimension, this is the maximum of the children's nice sizes in that dimension.

Parameters:
dim Dimension, either YD_HORIZ or YD_VERT

Reimplemented from YContainerWidget.

bool YSplit::stretchable ( YUIDimension  dimension  )  const [virtual]

The split is stretchable if one of the children is stretchable in that dimension.

Parameters:
dim Dimension, either YD_HORIZ or YD_VERT

Reimplemented from YContainerWidget.

void YSplit::setSize ( long  newwidth,
long  newheight 
) [virtual]

Sets the size of the Split. Here the layout policy is implemented. The ui specific widget must call this method at the end of it's own setSize method.

Reimplemented from YContainerWidget.

virtual void YSplit::moveChild ( YWidget child,
long  newx,
long  newy 
) [pure virtual]

Moves a child to a new position

long YSplit::childrenTotalWeight ( YUIDimension  dimension  )  [protected]

Add up all the children's weights.

long YSplit::childrenMaxNiceSize ( YUIDimension  dimension  )  [protected]

Return the maximum nice size of all children in dimension d.

long YSplit::totalNonWeightedChildrenNiceSize ( YUIDimension  dimension  )  [protected]

Add up all the non-weighted children's nice sizes in dimension d.

int YSplit::countNonWeightedChildren ( YUIDimension  dimension  )  [protected]

Count the number of non-weighted children.

int YSplit::countStretchableChildren ( YUIDimension  dimension  )  [protected]

Count the number of stretchable ( non-weighted ) children. Note: Weighted children are _always_ considered stretchable.

int YSplit::countLayoutStretchChildren ( YUIDimension  dimension  )  [protected]

Count the number of "rubber bands", i.e. the number of stretchable layout spacings ( e.g. {H|V}Weight, {H|V}Spacing ). Only those without a weight are counted.

int YSplit::bossChild (  )  [protected]

Determine the number of the "boss child" - the child widget that determines the overall size with respect to its weight. Returns -1 if there is no boss, i.e. none of the children has a weight specified.

void YSplit::calcPrimaryGeometry ( long  newSize,
sizeVector childSize,
posVector childPos 
) [protected]

Calculate the sizes and positions of all children in the primary dimension and store them in "childSize" and "childPos".

void YSplit::calcSecondaryGeometry ( long  newSize,
sizeVector childSize,
posVector childPos 
) [protected]

Calculate the sizes and positions of all children in the secondary dimension and store them in "childSize" and "childPos".

void YSplit::doResize ( sizeVector width,
sizeVector height,
posVector x_pos,
posVector y_pos 
) [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().


Member Data Documentation

YUIDimension YSplit::primary [protected]

Dimensions of the split. YD_HORIZ or YD_VERT

YUIDimension YSplit::secondary [protected]

bool YSplit::debugLayout [protected]


The documentation for this class was generated from the following files:
Generated on Tue Nov 6 01:20:23 2007 for yast2-core by  doxygen 1.5.0