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)
long nicesize (YUIDimension dim)
long leftMargin () const
long rightMargin () const
long topMargin () const
long bottomMargin () const
long totalMargins (YUIDimension dim) const
void setLeftMargin (long margin)
void setRightMargin (long margin)
void setTopMargin (long margin)
void setBottomMargin (long margin)
long minWidth () const
long minHeight () const
void setMinWidth (long width)
void setMinHeight (long height)
virtual void setBackgroundPixmap (string px)
string backgroundPixmap () const

Protected Attributes

YAlignmentType align [YUIAllDimensions]
long _leftMargin
long _rightMargin
long _topMargin
long _bottomMargin
long _minWidth
long _minHeight
string _backgroundPixmap

Detailed Description

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

Left Right Top Bottom HCenter VCenter HVCenter Alignment

`BackgroundPixmap( "dir/pixmap.png" ) background pixmap


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 char* YAlignment::widgetClass (  )  [inline, virtual]

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

Reimplemented from YContainerWidget.

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

Moves a child widget to a new position.

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.

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.

long YAlignment::nicesize ( YUIDimension  dim  )  [virtual]

Returns the preferred size of this widget, taking margins into account.

Reimplemented from YContainerWidget.

Parameters:
dim Dimension, either YD_HORIZ or YD_VERT

Reimplemented from YContainerWidget.

long YAlignment::leftMargin (  )  const [inline]

Returns the left margin in pixels, the distance between the left edge of this alignment and the left edge of the child widget.

long YAlignment::rightMargin (  )  const [inline]

Returns the right margin in pixels, the distance between the right edge of this alignment and the right edge of the child widget.

long YAlignment::topMargin (  )  const [inline]

Returns the top margin in pixels, the distance between the top edge of this alignment and the top edge of the child widget.

long YAlignment::bottomMargin (  )  const [inline]

Returns the bottom margin in pixels, the distance between the bottom edge of this alignment and the bottom edge of the child widget.

long YAlignment::totalMargins ( YUIDimension  dim  )  const

Returns the sum of all margins in the specified dimension.

void YAlignment::setLeftMargin ( long  margin  )  [inline]

Set the left margin in pixels.

void YAlignment::setRightMargin ( long  margin  )  [inline]

Set the right margin in pixels.

void YAlignment::setTopMargin ( long  margin  )  [inline]

Set the top margin in pixels.

void YAlignment::setBottomMargin ( long  margin  )  [inline]

Set the bottom margin in pixels.

long YAlignment::minWidth (  )  const [inline]

Returns the minimum width of this alignment or 0 if none is set. nicesize() will never return less than this value.

long YAlignment::minHeight (  )  const [inline]

Returns the minimum height of this alignment or 0 if none is set. nicesize() will never return less than this value.

void YAlignment::setMinWidth ( long  width  )  [inline]

Set the minimum width to return for nicesize().

void YAlignment::setMinHeight ( long  height  )  [inline]

Set the minimum height to return for nicesize().

void YAlignment::setBackgroundPixmap ( string  px  )  [virtual]

Set a background pixmap.

Derived classes may want to overwrite this.

This parent method should be called first in the overwritten method to ensure path expansion is done as specified (prepend the theme path ("/usr/share/YaST2/theme/current/") if the path doesn't start with "/" or ".").

string YAlignment::backgroundPixmap (  )  const [inline]

Returns the name of the background pixmap or an empty string, if there is none.


Member Data Documentation

YAlignmentType YAlignment::align[YUIAllDimensions] [protected]

long YAlignment::_leftMargin [protected]

long YAlignment::_rightMargin [protected]

long YAlignment::_topMargin [protected]

long YAlignment::_bottomMargin [protected]

long YAlignment::_minWidth [protected]

long YAlignment::_minHeight [protected]

string YAlignment::_backgroundPixmap [protected]


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