YPushButton Class Reference

Implementation of the PushButton widget Derived classes need to check opt.isDefaultButton! More...

#include <YPushButton.h>

Inheritance diagram for YPushButton:

YWidget List of all members.

Public Member Functions

 YPushButton (const YWidgetOpt &opt, YCPString label)
virtual char * widgetClass ()
YCPValue changeWidget (const YCPSymbol &property, const YCPValue &newvalue)
YCPValue queryWidget (const YCPSymbol &property)
virtual void setLabel (const YCPString &label)
YCPString getLabel ()
virtual void setIcon (const YCPString &icon_name)
const char * shortcutProperty ()

Protected Attributes

YCPString label

Detailed Description

Implementation of the PushButton widget Derived classes need to check opt.isDefaultButton!

PushButton IconButton

A PushButton is a button with a text label the user can press in order to activate some action. If you call UserInput() and the user presses the button, UserInput() returns with the id of the pressed button.

You can (and should) provide keybord shortcuts along with the button label. For example "&amp; Apply" as a button label will allow the user to activate the button with Alt-A, even if it currently doesn't have keyboard focus. This is important for UIs that don't support using a mouse.

An IconButton is pretty much the same, but it has an icon in addition to the text. If the UI cannot handle icons, it displays only the text, and the icon is silently omitted.

Icons are (at the time of this writing) loaded from the theme directory, /usr/share/YaST2/theme/current.


Constructor & Destructor Documentation

YPushButton::YPushButton const YWidgetOpt opt,
YCPString  label
 

Creates a new YPushButton

Parameters:
label the button label
opt widget options


Member Function Documentation

YCPValue YPushButton::changeWidget const YCPSymbol property,
const YCPValue newvalue
[virtual]
 

Implements the ui command changeWidget for the widget specific properties.

Reimplemented from YWidget.

YCPString YPushButton::getLabel  ) 
 

Get the current label of the text entry. This method cannot be overidden. The value of the label cannot be changed other than by calling setLabel, i.e. not by the ui. Therefore setLabel stores the current label in label.

YCPValue YPushButton::queryWidget const YCPSymbol property  )  [virtual]
 

Implements the ui command changeWidget for the widget specific properties.

Reimplemented from YWidget.

virtual void YPushButton::setIcon const YCPString icon_name  )  [inline, virtual]
 

Set this button's icon from an icon file in the UI's default icon directory. Clear the icon if the name is empty.

This default implementation does nothing. UIs that can handle icons can choose to overwrite this method.

void YPushButton::setLabel const YCPString label  )  [virtual]
 

change the label of the push button. Overload this, but call YPushButton::setLabel at the end of your own function.

const char* YPushButton::shortcutProperty  )  [inline, virtual]
 

The name of the widget property that holds the keyboard shortcut. Inherited from YWidget.

Reimplemented from YWidget.

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

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

Reimplemented from YWidget.


Member Data Documentation

YCPString YPushButton::label [protected]
 

The button label


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 18:07:47 2006 for yast2-core by  doxygen 1.4.6