libyui  2.42.5
 All Classes Functions Variables Enumerations Friends
YAlignment Class Referenceabstract

#include <YAlignment.h>

Inheritance diagram for YAlignment:
YSingleChildContainerWidget YWidget

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)
 
- Public Member Functions inherited from YSingleChildContainerWidget
virtual ~YSingleChildContainerWidget ()
 
- Public Member Functions inherited from YWidget
virtual ~YWidget ()
 
virtual std::string debugLabel () const
 
std::string helpText () const
 
void setHelpText (const std::string &helpText)
 
virtual const YPropertySetpropertySet ()
 
virtual bool setProperty (const std::string &propertyName, const YPropertyValue &val)
 
virtual YPropertyValue getProperty (const std::string &propertyName)
 
bool hasChildren () const
 
YWidgetfirstChild () const
 
YWidgetlastChild () const
 
YWidgetListConstIterator childrenBegin () const
 
YWidgetListConstIterator childrenEnd () const
 
int childrenCount () const
 
bool contains (YWidget *child) const
 
virtual void removeChild (YWidget *child)
 
void deleteChildren ()
 
YWidgetparent () const
 
bool hasParent () const
 
void setParent (YWidget *newParent)
 
YDialogfindDialog ()
 
YWidgetfindWidget (YWidgetID *id, bool doThrow=true) const
 
virtual int preferredSize (YUIDimension dim)
 
bool isValid () const
 
bool beingDestroyed () const
 
void * widgetRep () const
 
void setWidgetRep (void *toolkitWidgetRep)
 
bool hasId () const
 
YWidgetIDid () const
 
void setId (YWidgetID *newId_disown)
 
virtual void setEnabled (bool enabled=true)
 
void setDisabled ()
 
virtual bool isEnabled () const
 
void setStretchable (YUIDimension dim, bool newStretch)
 
void setDefaultStretchable (YUIDimension dim, bool newStretch)
 
virtual int weight (YUIDimension dim)
 
bool hasWeight (YUIDimension dim)
 
void setWeight (YUIDimension dim, int weight)
 
void setNotify (bool notify=true)
 
bool notify () const
 
void setNotifyContextMenu (bool notifyContextMenu=true)
 
bool notifyContextMenu () const
 
bool sendKeyEvents () const
 
void setSendKeyEvents (bool doSend)
 
bool autoShortcut () const
 
void setAutoShortcut (bool _newAutoShortcut)
 
int functionKey () const
 
bool hasFunctionKey () const
 
virtual void setFunctionKey (int fkey_no)
 
virtual bool setKeyboardFocus ()
 
virtual std::string shortcutString () const
 
virtual void setShortcutString (const std::string &str)
 
virtual const char * userInputProperty ()
 
void dumpWidgetTree (int indentationLevel=0)
 
void dumpDialogWidgetTree ()
 
void setChildrenEnabled (bool enabled)
 
virtual void saveUserInput (YMacroRecorder *macroRecorder)
 
void * operator new (size_t size)
 
virtual void startMultipleChanges ()
 
virtual void doneMultipleChanges ()
 

Protected Member Functions

 YAlignment (YWidget *parent, YAlignmentType horAlign, YAlignmentType vertAlign)
 
- Protected Member Functions inherited from YSingleChildContainerWidget
 YSingleChildContainerWidget (YWidget *parent)
 
- Protected Member Functions inherited from YWidget
 YWidget (YWidget *parent)
 
YWidgetChildrenManagerchildrenManager () const
 
void setChildrenManager (YWidgetChildrenManager *manager)
 
void setBeingDestroyed ()
 
void dumpWidget (YWidget *w, int indentationLevel)
 

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.

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.

int YAlignment::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

Reimplemented from YSingleChildContainerWidget.

Definition at line 195 of file YAlignment.cc.

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.

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.

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.

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.

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: