libyui
|
Public Member Functions | |
virtual | ~YPushButton () |
virtual const char * | widgetClass () const |
string | label () const |
virtual void | setLabel (const string &label) |
virtual void | setIcon (const string &iconName) |
bool | isDefaultButton () const |
virtual void | setDefaultButton (bool def=true) |
virtual void | setRole (YButtonRole role) |
YButtonRole | role () const |
virtual void | setFunctionKey (int fkey_no) |
bool | isHelpButton () const |
virtual void | setHelpButton (bool helpButton=true) |
virtual bool | setProperty (const string &propertyName, const YPropertyValue &val) |
virtual YPropertyValue | getProperty (const string &propertyName) |
virtual const YPropertySet & | propertySet () |
virtual string | shortcutString () const |
virtual void | setShortcutString (const string &str) |
Protected Member Functions | |
YPushButton (YWidget *parent, const string &label) |
YPushButton::YPushButton | ( | YWidget * | parent, |
const string & | label | ||
) | [protected] |
Constructor.
YPushButton::~YPushButton | ( | ) | [virtual] |
Destructor.
YPropertyValue YPushButton::getProperty | ( | const string & | propertyName | ) | [virtual] |
bool YPushButton::isDefaultButton | ( | ) | const |
Returns 'true' if this is the dialog's default button, i.e. the one button that gets activated if the user hits the [Return] key anywhere in the dialog.
bool YPushButton::isHelpButton | ( | ) | const |
Returns 'true' if this is a "Help" button.
When activated, a help button will traverse up its widget hierarchy and search for the topmost widget with a helpText() set and display that help text in a pop-up dialog (with a local event loop).
NOTE that this is only done during YDialog::waitForEvent() (i.e. in YCP UI::WaitForEvent(), UI::UserInput(), UI::TimeoutUserInput() ) and not during YDialog::pollEvent() (i.e. YCP UI::PollInput()) since displaying the help text will block the application until the user closes the help text.
string YPushButton::label | ( | ) | const |
Get the label (the text on the button).
const YPropertySet & YPushButton::propertySet | ( | ) | [virtual] |
YButtonRole YPushButton::role | ( | ) | const |
Return the role of this button.
void YPushButton::setDefaultButton | ( | bool | def = true | ) | [virtual] |
Make this button the default button.
Derived classes should reimplement this, but call this base class function in the overwritten function.
void YPushButton::setFunctionKey | ( | int | fkey_no | ) | [virtual] |
void YPushButton::setHelpButton | ( | bool | helpButton = true | ) | [virtual] |
Make this button a help button.
Derived classes are free to reimplement this, but they should call this base class method in the overloaded function.
virtual void YPushButton::setIcon | ( | const string & | iconName | ) | [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 string & | label | ) | [virtual] |
Set the label (the text on the button).
Derived classes are free to reimplement this, but they should call this base class method at the end of the overloaded function.
bool YPushButton::setProperty | ( | const string & | propertyName, |
const YPropertyValue & | val | ||
) | [virtual] |
void YPushButton::setRole | ( | YButtonRole | role | ) | [virtual] |
Set a predefined role for this button.
This is important when the button is a child of a YButtonBox so the layout can be arranged according to the conventions of the current UI or desktop environment.
See YButtonBox.h for more details. YButtonRole is defined in YTypes.h
The default is YCustomButton, i.e., no predefined role. setFunctionKey() uses some heuristics to map function keys to buttons:
F10 -> YOkButton F9 -> YCancelButton F1 -> YHelpButton
Derived classes are free to reimplement this, but they should call this base class function in the overwritten function.
virtual void YPushButton::setShortcutString | ( | const string & | str | ) | [inline, virtual] |
virtual string YPushButton::shortcutString | ( | ) | const [inline, virtual] |
virtual const char* YPushButton::widgetClass | ( | ) | const [inline, virtual] |
Return a descriptive name of this widget class for logging, debugging etc.
Reimplemented from YWidget.