libyui
|
#include <YRadioButton.h>
Public Member Functions | |
virtual | ~YRadioButton () |
virtual const char * | widgetClass () const |
virtual bool | value ()=0 |
virtual void | setValue (bool checked)=0 |
string | label () const |
virtual void | setLabel (const string &label) |
bool | useBoldFont () const |
virtual void | setUseBoldFont (bool bold=true) |
YRadioButtonGroup * | buttonGroup () |
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) |
const char * | userInputProperty () |
Protected Member Functions | |
YRadioButton (YWidget *parent, const string &label) | |
YRadioButtonGroup * | findRadioButtonGroup () const |
virtual void | saveUserInput (YMacroRecorder *macroRecorder) |
RadioButton: Widget for one-out-of-many selection.
Only one RadioButton in a RadioBox (in a RadioButtonGroup) can be set to "on" at the same time. Setting any RadioButton of a RadioButtonGroup to "on" automatically sets all others in the same RadioButtonGroup to "off".
RadioButtons customarily have a distinct visual appearance from CheckBoxes:
( ) RadioButton 1 (*) RadioButton 2 ( ) RadioButton 3
[ ] CheckBox 1 [*] CheckBox 2 [*] CheckBox 3
YRadioButton::YRadioButton | ( | YWidget * | parent, |
const string & | label | ||
) | [protected] |
Constructor.
Creates a new RadioButton with user-visible text 'label'. 'label' can and should contain a keyboard shortcut (designated with '&').
The caller has to take care to add this RadioButton to its RadioButtonGroup:
if ( radioButton->buttonGroup() ) radioButton->buttonGroup()->addRadioButton( radioButton );
This can't be done in the constructor because it would involve calling a virtual function, which doesn't work yet within the constructor.
YRadioButton::~YRadioButton | ( | ) | [virtual] |
Destructor: Removes the button from the radio button group.
YRadioButtonGroup * YRadioButton::buttonGroup | ( | ) |
Get a pointer to the radio button group this button belongs to.
YRadioButtonGroup * YRadioButton::findRadioButtonGroup | ( | ) | const [protected] |
Traverse the widget hierarchy upwards to find the corresponding YRadioButtonGroup, i.e. the class that controls the radio box behaviour (i.e. that makes sure that no more than one RadioButton is set to "on" at the same time).
YPropertyValue YRadioButton::getProperty | ( | const string & | propertyName | ) | [virtual] |
string YRadioButton::label | ( | ) | const |
Get the label (the text on the RadioButton).
const YPropertySet & YRadioButton::propertySet | ( | ) | [virtual] |
void YRadioButton::saveUserInput | ( | YMacroRecorder * | macroRecorder | ) | [protected, virtual] |
void YRadioButton::setLabel | ( | const string & | label | ) | [virtual] |
Set the label (the text on the RadioButton).
Derived classes are free to reimplement this, but they should call this base class method at the end of the overloaded function.
bool YRadioButton::setProperty | ( | const string & | propertyName, |
const YPropertyValue & | val | ||
) | [virtual] |
Set a property. Reimplemented from YWidget.
This method may throw exceptions, for example
This function returns 'true' if the value was successfully set and 'false' if that value requires special handling (not in error cases: those are covered by exceptions).
Reimplemented from YWidget.
virtual void YRadioButton::setShortcutString | ( | const string & | str | ) | [inline, virtual] |
void YRadioButton::setUseBoldFont | ( | bool | bold = true | ) | [virtual] |
Indicate whether or not a bold font should be used.
Derived classes are free to reimplement this, but they should call this base class method at the end of the overloaded function.
virtual void YRadioButton::setValue | ( | bool | checked | ) | [pure virtual] |
Set the radio button value (on/off).
Derived classes are required to implement this.
virtual string YRadioButton::shortcutString | ( | ) | const [inline, virtual] |
bool YRadioButton::useBoldFont | ( | ) | const |
Returns 'true' if a bold font should be used.
const char* YRadioButton::userInputProperty | ( | ) | [inline, virtual] |
virtual bool YRadioButton::value | ( | ) | [pure virtual] |
Get the current on/off value: 'true' if checked, 'false' if unchecked.
Derived classes are required to implement this.
virtual const char* YRadioButton::widgetClass | ( | ) | const [inline, virtual] |