#include <YPushButton.h>
Public Member Functions | |
virtual | ~YPushButton () |
virtual const char * | widgetClass () const |
std::string | label () const |
virtual void | setLabel (const std::string &label) |
virtual void | setIcon (const std::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) |
bool | isRelNotesButton () const |
virtual void | setRelNotesButton (bool relNotesButton=true) |
virtual bool | setProperty (const std::string &propertyName, const YPropertyValue &val) |
virtual YPropertyValue | getProperty (const std::string &propertyName) |
virtual const YPropertySet & | propertySet () |
virtual std::string | shortcutString () const |
virtual void | setShortcutString (const std::string &str) |
virtual void | activate ()=0 |
![]() | |
virtual | ~YWidget () |
virtual std::string | debugLabel () const |
std::string | helpText () const |
void | setHelpText (const std::string &helpText) |
bool | hasChildren () const |
YWidget * | firstChild () const |
YWidget * | lastChild () const |
YWidgetListIterator | childrenBegin () const |
YWidgetListIterator | childrenEnd () const |
YWidgetListConstIterator | childrenConstBegin () const |
YWidgetListConstIterator | childrenConstEnd () const |
YWidgetListIterator | begin () |
YWidgetListIterator | end () |
int | childrenCount () const |
bool | contains (YWidget *child) const |
virtual void | addChild (YWidget *child) |
virtual void | removeChild (YWidget *child) |
void | deleteChildren () |
YWidget * | parent () const |
bool | hasParent () const |
void | setParent (YWidget *newParent) |
YDialog * | findDialog () |
YWidget * | findWidget (YWidgetID *id, bool doThrow=true) const |
virtual int | preferredWidth ()=0 |
virtual int | preferredHeight ()=0 |
virtual int | preferredSize (YUIDimension dim) |
virtual void | setSize (int newWidth, int newHeight)=0 |
bool | isValid () const |
bool | beingDestroyed () const |
void * | widgetRep () const |
void | setWidgetRep (void *toolkitWidgetRep) |
bool | hasId () const |
YWidgetID * | id () const |
void | setId (YWidgetID *newId_disown) |
virtual void | setEnabled (bool enabled=true) |
void | setDisabled () |
virtual bool | isEnabled () const |
virtual bool | stretchable (YUIDimension dim) 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 bool | setKeyboardFocus () |
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) |
void | operator delete (void *ptr) noexcept |
virtual void | startMultipleChanges () |
virtual void | doneMultipleChanges () |
Protected Member Functions | |
YPushButton (YWidget *parent, const std::string &label) | |
![]() | |
YWidget (YWidget *parent) | |
YWidgetChildrenManager * | childrenManager () const |
void | setChildrenManager (YWidgetChildrenManager *manager) |
void | setBeingDestroyed () |
void | dumpWidget (YWidget *w, int indentationLevel) |
A push button; may have an icon, and a F-key shortcut.
|
protected |
Constructor.
|
virtual |
Destructor.
|
pure virtual |
Activate the button. Can be used in tests to simulate user input.
Derived classes are required to implement this.
|
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.
bool YPushButton::isRelNotesButton | ( | ) | const |
Returns 'true' if this is a "Release Notes" button.
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 release notes will block the application until the user closes the text.
string YPushButton::label | ( | ) | const |
Get the label (the text on the button).
|
virtual |
YButtonRole YPushButton::role | ( | ) | const |
Return the role of this button.
|
virtual |
Make this button the default button.
Derived classes should reimplement this, but call this base class function in the overwritten function.
|
virtual |
|
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.
|
inlinevirtual |
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.
|
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.
|
virtual |
|
virtual |
Make this button a release notes button.
Derived classes are free to reimplement this, but they should call this base class method in the overloaded function.
|
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.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Return a descriptive name of this widget class for logging, debugging etc.
Reimplemented from YWidget.