libyui  3.0.10
YAlignment Class Reference

#include <YAlignment.h>

Inheritance diagram for YAlignment:
Collaboration diagram for YAlignment:

List of all members.

Public Member Functions

virtual ~YAlignment ()
virtual const char * widgetClass () const
YAlignmentType alignment (YUIDimension dim) const
int leftMargin () const
int rightMargin () const
int topMargin () const
int bottomMargin () const
int totalMargins (YUIDimension dim) const
void setLeftMargin (int margin)
void setRightMargin (int margin)
void setTopMargin (int margin)
void setBottomMargin (int margin)
int minWidth () const
int minHeight () const
void setMinWidth (int width)
void setMinHeight (int height)
virtual void setBackgroundPixmap (const std::string &pixmapFileName)
std::string backgroundPixmap () const
virtual void addChild (YWidget *child)
virtual void moveChild (YWidget *child, int newx, int newy)=0
virtual bool stretchable (YUIDimension dim) const
virtual int preferredWidth ()
virtual int preferredHeight ()
virtual void setSize (int newWidth, int newHeight)

Protected Member Functions

 YAlignment (YWidget *parent, YAlignmentType horAlign, YAlignmentType vertAlign)

Protected Attributes

ImplPtr< YAlignmentPrivatepriv

Detailed Description

Implementation of all the alignment widgets:

  • Left, Right, HCenter,
  • Top, Bottom, VCenter,
  • HVCenter
  • MinSize, MinWidth, MinHeight

Definition at line 41 of file YAlignment.h.


Constructor & Destructor Documentation

YAlignment::YAlignment ( YWidget parent,
YAlignmentType  horAlign,
YAlignmentType  vertAlign 
) [protected]

Constructor.

Definition at line 76 of file YAlignment.cc.

YAlignment::~YAlignment ( ) [virtual]

Destructor.

Definition at line 86 of file YAlignment.cc.


Member Function Documentation

void YAlignment::addChild ( YWidget child) [virtual]

Add a child widget.

Reimplemented from YSingleChildContainerWidget to propagate stretchability down to the single child.

Reimplemented from YWidget.

Definition at line 177 of file YAlignment.cc.

Here is the call graph for this function:

YAlignmentType YAlignment::alignment ( YUIDimension  dim) const

Return the alignment in the specified dimension.

Definition at line 93 of file YAlignment.cc.

std::string YAlignment::backgroundPixmap ( ) const

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

Definition at line 171 of file YAlignment.cc.

int YAlignment::bottomMargin ( ) const

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

Definition at line 117 of file YAlignment.cc.

int YAlignment::leftMargin ( ) const

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

Definition at line 99 of file YAlignment.cc.

int YAlignment::minHeight ( ) const

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

Definition at line 153 of file YAlignment.cc.

int YAlignment::minWidth ( ) const

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

Definition at line 147 of file YAlignment.cc.

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

Move a child widget to a new position.

int YAlignment::preferredHeight ( ) [virtual]

Preferred height of the widget.

Reimplemented from YWidget.

Reimplemented from YSingleChildContainerWidget.

Definition at line 207 of file YAlignment.cc.

Here is the call graph for this function:

int YAlignment::preferredWidth ( ) [virtual]

Preferred width of the widget.

Reimplemented from YWidget.

Reimplemented from YSingleChildContainerWidget.

Definition at line 195 of file YAlignment.cc.

Here is the call graph for this function:

int YAlignment::rightMargin ( ) const

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

Definition at line 105 of file YAlignment.cc.

void YAlignment::setBackgroundPixmap ( const std::string &  pixmapFileName) [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/libyui/theme/") if the path doesn't start with "/" or ".").

Definition at line 334 of file YAlignment.cc.

Here is the call graph for this function:

void YAlignment::setBottomMargin ( int  margin)

Set the bottom margin in pixels.

Definition at line 141 of file YAlignment.cc.

void YAlignment::setLeftMargin ( int  margin)

Set the left margin in pixels.

Definition at line 123 of file YAlignment.cc.

void YAlignment::setMinHeight ( int  height)

Set the minimum height to return for preferredHeight().

Definition at line 165 of file YAlignment.cc.

void YAlignment::setMinWidth ( int  width)

Set the minimum width to return for preferredWidth().

Definition at line 159 of file YAlignment.cc.

void YAlignment::setRightMargin ( int  margin)

Set the right margin in pixels.

Definition at line 129 of file YAlignment.cc.

void YAlignment::setSize ( int  newWidth,
int  newHeight 
) [virtual]

Set the current size and move the child widget according to its alignment.

Derived classes should reimplement this, but call this base class function in their own implementation.

Reimplemented from YSingleChildContainerWidget.

Definition at line 219 of file YAlignment.cc.

Here is the call graph for this function:

void YAlignment::setTopMargin ( int  margin)

Set the top margin in pixels.

Definition at line 135 of file YAlignment.cc.

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

Return this widget's stretchability. Reimplemented from YWidget.

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

Reimplemented from YSingleChildContainerWidget.

Definition at line 186 of file YAlignment.cc.

Here is the call graph for this function:

int YAlignment::topMargin ( ) const

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

Definition at line 111 of file YAlignment.cc.

int YAlignment::totalMargins ( YUIDimension  dim) const

Return the sum of all margins in the specified dimension.

Definition at line 326 of file YAlignment.cc.

Here is the call graph for this function:

const char * YAlignment::widgetClass ( ) const [virtual]

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

Reimplemented from YWidget.

Definition at line 353 of file YAlignment.cc.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Friends