#include <button.hh>
Inheritance diagram for otk::Button:


Public Methods | |
| Button (Widget *parent) | |
| ~Button () | |
| const RenderTexture * | getPressedFocusTexture (void) const |
| void | setPressedFocusTexture (RenderTexture *texture) |
| const RenderTexture * | getPressedUnfocusTexture (void) const |
| void | setPressedUnfocusTexture (RenderTexture *texture) |
| void | setTexture (RenderTexture *texture) |
| void | setUnfocusTexture (RenderTexture *texture) |
| bool | isPressed (void) const |
| void | press (unsigned int mouse_button) |
| void | release (unsigned int mouse_button) |
| void | buttonPressHandler (const XButtonEvent &e) |
| Called whenever a button of the pointer is pressed. | |
| void | buttonReleaseHandler (const XButtonEvent &e) |
| Called whenever a button of the pointer is released. | |
| virtual void | setStyle (RenderStyle *style) |
Private Attributes | |
| bool | _pressed |
| unsigned int | _mouse_button |
| RenderTexture * | _pressed_focus_tx |
| RenderTexture * | _pressed_unfocus_tx |
| RenderTexture * | _unpr_focus_tx |
| RenderTexture * | _unpr_unfocus_tx |
|
|
Definition at line 11 of file button.cc. References setStyle().
00012 : FocusLabel(parent), _pressed(false), _pressed_focus_tx(0), 00013 _pressed_unfocus_tx(0), _unpr_focus_tx(0), _unpr_unfocus_tx(0) 00014 { 00015 setStyle(_style); 00016 } |
|
|
Definition at line 18 of file button.cc.
00019 {
00020 }
|
|
|
Called whenever a button of the pointer is pressed.
Reimplemented from otk::EventHandler. Definition at line 67 of file button.cc. References press(), and otk::FocusLabel::update().
|
|
|
Called whenever a button of the pointer is released.
Reimplemented from otk::EventHandler. Definition at line 74 of file button.cc. References release(), and otk::FocusLabel::update().
|
|
|
Definition at line 16 of file button.hh. References _pressed_focus_tx.
00017 { return _pressed_focus_tx; }
|
|
|
Definition at line 21 of file button.hh. References _pressed_unfocus_tx.
00022 { return _pressed_unfocus_tx; }
|
|
|
Definition at line 29 of file button.hh. References _pressed.
00029 { return _pressed; }
|
|
|
Definition at line 34 of file button.cc. References _mouse_button, and _pressed. Referenced by buttonPressHandler().
00035 {
00036 if (_pressed) return;
00037
00038 if (_pressed_focus_tx)
00039 FocusWidget::setTexture(_pressed_focus_tx);
00040 if (_pressed_unfocus_tx)
00041 FocusWidget::setUnfocusTexture(_pressed_unfocus_tx);
00042 _pressed = true;
00043 _mouse_button = mouse_button;
00044 }
|
|
|
Definition at line 46 of file button.cc. References _mouse_button, and _pressed. Referenced by buttonReleaseHandler().
00047 {
00048 if (_mouse_button != mouse_button) return; // wrong button
00049
00050 FocusWidget::setTexture(_unpr_focus_tx);
00051 FocusWidget::setUnfocusTexture(_unpr_unfocus_tx);
00052 _pressed = false;
00053 }
|
|
|
Definition at line 18 of file button.hh. References _pressed_focus_tx.
00019 { _pressed_focus_tx = texture; }
|
|
|
Definition at line 23 of file button.hh. References _pressed_unfocus_tx.
00024 { _pressed_unfocus_tx = texture; }
|
|
|
Reimplemented from otk::FocusLabel. Definition at line 23 of file button.cc. References _pressed_focus_tx, _pressed_unfocus_tx, otk::RenderStyle::buttonPressFocusBackground(), otk::RenderStyle::buttonPressUnfocusBackground(), otk::RenderStyle::buttonUnpressFocusBackground(), otk::RenderStyle::buttonUnpressUnfocusBackground(), setTexture(), and setUnfocusTexture(). Referenced by Button().
00024 {
00025 FocusLabel::setStyle(style);
00026
00027 setTexture(style->buttonUnpressFocusBackground());
00028 setUnfocusTexture(style->buttonUnpressUnfocusBackground());
00029 _pressed_focus_tx = style->buttonPressFocusBackground();
00030 _pressed_unfocus_tx = style->buttonPressUnfocusBackground();
00031 }
|
|
|
Reimplemented from otk::FocusWidget. Definition at line 55 of file button.cc. References _unpr_focus_tx. Referenced by setStyle().
00056 {
00057 FocusWidget::setTexture(texture);
00058 _unpr_focus_tx = texture;
00059 }
|
|
|
Reimplemented from otk::FocusWidget. Definition at line 61 of file button.cc. References _unpr_unfocus_tx. Referenced by setStyle().
00062 {
00063 FocusWidget::setUnfocusTexture(texture);
00064 _unpr_unfocus_tx = texture;
00065 }
|
|
|
|
|
|
Definition at line 40 of file button.hh. Referenced by isPressed(), press(), and release(). |
|
|
Definition at line 43 of file button.hh. Referenced by getPressedFocusTexture(), setPressedFocusTexture(), and setStyle(). |
|
|
Definition at line 44 of file button.hh. Referenced by getPressedUnfocusTexture(), setPressedUnfocusTexture(), and setStyle(). |
|
|
Definition at line 46 of file button.hh. Referenced by setTexture(). |
|
|
Definition at line 47 of file button.hh. Referenced by setUnfocusTexture(). |
1.3-rc2