#include <YSpacing.h>
Inheritance diagram for YSpacing:
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] |
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
|
|
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.
|
|
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. |
|
Minimum size the widget should have to make it look and feel nice. This is 0 for the empty widget.
Implements YWidget. |
|
Returns a descriptive name of this widget class for logging, debugging etc. Reimplemented from YWidget. |
|
Relative size in both dimensions. The virtual absoluteSize() method is used in order to determine the real size in units used by the UI. |