Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

YSpacing Class Reference

Implementation of the HSpacing and VSpacing and widgets. More...

#include <YSpacing.h>

Inheritance diagram for YSpacing:

YWidget List of all members.

Public Member Functions

 YSpacing (const YWidgetOpt &opt, float size, bool horizontal, bool vertical)
virtual char * widgetClass ()
long nicesize (YUIDimension dim)
bool isLayoutStretch (YUIDimension dim) const
virtual long absoluteSize (YUIDimension dim, float relativeSize)

Protected Attributes

float relativeSize [YUIAllDimensions]

Detailed Description

Implementation of the HSpacing and VSpacing and widgets.

HSpacing VSpacing

integer|float size `HSpacing( 0.3 ) Spacing1.ycp Layout-Buttons-Equal-Even-Spaced2.ycp Table2.ycp Table3.ycp

These widgets can be used to create empty space within a dialog to avoid widgets being cramped together - purely for aesthetical reasons. There is no functionality attached.

Do not try to use spacings with excessive sizes to create layouts! This is very likely to work for just one UI. Use spacings only to separate widgets from each other or from dialog borders. For other purposes, use `HWeight and `VWeight and describe the dialog logically rather than physically.

The size given is measured in units roughly equivalent to the size of a character in the respective UI. Fractional numbers can be used here, but text based UIs may choose to round the number as appropriate - even if this means simply ignoring a spacing when its size becomes zero.

If size is omitted, it defaults to 1.

HSpacing will create a horizontal spacing with default width and zero height.

VSpacing will create a vertical spacing with default height and zero width.

With options hstretch or vstretch, the spacing will at least take the amount of space specified with size, but it will be stretchable in the respective dimension. Thus,

`HSpacing( `opt( `hstretch )

is equivalent to

`HBox( `HSpacing( 0.5 ), `HSpacing( 0.5 ) )

See the Layout HOWTO for details.


Constructor & Destructor Documentation

YSpacing::YSpacing const YWidgetOpt opt,
float  size,
bool  horizontal,
bool  vertical
 

Constructor

Parameters:
size the relative size of this widget
horizontal flag: use "size" for the horizontal dimension?
vertical flag: use "size" for the vertical dimension?


Member Function Documentation

long YSpacing::absoluteSize YUIDimension  dim,
float  relativeSize
[virtual]
 

Convert a relative size in the given dimension in units actually used by the respective UI ( pixels or characters ). Overwrite this method to round sizes < 1.0 to zero or to make sure a widget gets at least one unit ( e.g. pixel ) in any direction if the UI cannot handle zero sizes.

Parameters:
dim Dimension, either YD_HORIZ or YD_VERT
relativeSize size as passed as widget parameter

bool YSpacing::isLayoutStretch YUIDimension  dim  )  const [virtual]
 

Returns true if this is a layout stretch space in dimension "dim". Such widgets will receive special treatment in layout calculations. Inherited from YWidget.

Reimplemented from YWidget.

long YSpacing::nicesize YUIDimension  dim  )  [virtual]
 

Minimum size the widget should have to make it look and feel nice. This is 0 for the empty widget.

Parameters:
dim Dimension, either YD_HORIZ or YD_VERT

Implements YWidget.

virtual char* YSpacing::widgetClass  )  [inline, virtual]
 

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

Reimplemented from YWidget.


Member Data Documentation

float YSpacing::relativeSize[ YUIAllDimensions ] [protected]
 

Relative size in both dimensions. The virtual absoluteSize() method is used in order to determine the real size in units used by the UI.


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:25 2007 for yast2-core by doxygen 1.3.6