Inherited by BButton, CheckButton, HighlightButton, RepeatButton, ReturnButton, and ToggleButton.
Public Types | |
enum | { HIDDEN } |
Public Member Functions | |
bool | value () const |
bool | value (bool v) |
int | handle (int) |
int | handle (int event, const Rectangle &) |
Button (int, int, int, int, const char *=0) | |
virtual void | draw () |
void | draw (int glyph_width) const |
Static Public Attributes | |
NamedStyle * | default_style |
Buttons can also generate callbacks in response to SHORTCUT events. The button can either have an explicit shortcut() value or a letter shortcut can be indicated in the label() with an '&' character before it. For the label shortcut it does not matter if Alt is held down, but if you have an input field in the same window, the user will have to hold down the Alt key so that the input field does not eat the event first as an KEY event.
|
This function provides a mess of back-compatabilty and Windows emulation to subclasses of Button to draw with. It will draw the button according to the current state of being pushed and it's value. If non-zero is passed for glyph_width then the glyph() is drawn in that space on the left (or on the right if negative), and it assummes the glyph indicates the value, so the box is only used to indicate the pushed state. |
|
Change the value(). Redraws the button and returns true if the new value is different. This is the same function as Widget::state(). See also Widget::set(), Widget::clear(), and Widget::setonly(). If you turn it on, a normal button will draw pushed-in, until the user clicks it and releases it. |
|
The current value. True means it is pushed down, false means it is not pushed down. The ToggleButton subclass provides the ability for the user to change this value permanently, otherwise it is just temporary while the user is holding the button down. This is the same as Widget::state(). |