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

YAlignment Class Reference

Implemenation of the Left, Right, Bottom, Top, HCenter, VCenter and HVCenter widgets. More...

#include <YAlignment.h>

Inheritance diagram for YAlignment:

YContainerWidget YWidget List of all members.

Public Member Functions

 YAlignment (const YWidgetOpt &opt, YAlignmentType halign, YAlignmentType valign)
virtual char * widgetClass ()
virtual void moveChild (YWidget *child, long newx, long newy)=0
bool stretchable (YUIDimension dim) const
void setSize (long newwidth, long newheight)

Protected Attributes

YAlignmentType align [YUIAllDimensions]

Detailed Description

Implemenation of the Left, Right, Bottom, Top, HCenter, VCenter and HVCenter widgets.

Left Right Top Bottom HCenter VCenter HVCenter

The Alignment widgets are used to control the layout of a dialog. They are useful in situations, where to a widget is assigned more space than it can use. For example if you have a VBox containing four CheckBoxes, the width of the VBox is determined by the CheckBox with the longest label. The other CheckBoxes are centered per default. With `Left( widget ) you tell widget that it should be layouted leftmost of the space that is available to it. Right, Top and Bottom are working accordingly. The other three widgets center their child widget horizontally, vertically or in both directions. The important fact for all alignment widgets is, that they make their child widget stretchable in the dimension it is aligned.

See the Layout HOWTO for details.


Constructor & Destructor Documentation

YAlignment::YAlignment const YWidgetOpt opt,
YAlignmentType  halign,
YAlignmentType  valign
 

Constructor

Parameters:
halign How the child widget is aligned horizontally
valign How the child widget is aligned vertically
opt the widget options


Member Function Documentation

virtual void YAlignment::moveChild YWidget child,
long  newx,
long  newy
[pure virtual]
 

Moves a child widget to a new position.

void YAlignment::setSize long  newwidth,
long  newheight
[virtual]
 

Sets the size and move the child widget according to its alignment. The UI specific widget subclass overrides this function in order to resize the ui specific widget, but calls this method at the end.

Reimplemented from YContainerWidget.

bool YAlignment::stretchable YUIDimension  dim  )  const [virtual]
 

In an aligned dimension the widget is always stretchable. In an unchanged dimension the widget is stretchable if the child is stretchable.

Reimplemented from YContainerWidget.

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

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

Reimplemented from YContainerWidget.


Member Data Documentation

YAlignmentType YAlignment::align[ YUIAllDimensions ] [protected]
 

Alignment of the contained widget in each dimension


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