#include <repeating_button.hpp>


Public Member Functions | |
| trepeating_button () | |
| ~trepeating_button () | |
| void | connect_signal_mouse_left_down (const event::tsignal_function &signal) |
| Connects a signal handler for a left mouse button down. | |
| void | disconnect_signal_mouse_left_down (const event::tsignal_function &signal) |
| Disconnects a signal handler for a left mouse button down. | |
| void | set_active (const bool active) |
| Inherited from tcontrol. | |
| bool | get_active () const |
| Inherited from tcontrol. | |
| unsigned | get_state () const |
| Inherited from tcontrol. | |
| void | connect_click_handler (const event::tsignal_function &signal) |
| Inherited from tclickable. | |
| void | disconnect_click_handler (const event::tsignal_function &signal) |
| Inherited from tclickable. | |
Private Types | |
| enum | tstate { ENABLED, DISABLED, PRESSED, FOCUSSED, COUNT } |
Possible states of the widget. More... | |
Private Member Functions | |
| void | set_state (const tstate state) |
| const std::string & | get_control_type () const |
| Inherited from tcontrol. | |
| void | signal_handler_mouse_enter (const event::tevent event, bool &handled) |
| void | signal_handler_mouse_leave (const event::tevent event, bool &handled) |
| void | signal_handler_left_button_down (const event::tevent event, bool &handled) |
| void | signal_handler_left_button_up (const event::tevent event, bool &handled) |
Private Attributes | |
| tstate | state_ |
| Current state of the widget. | |
| unsigned long | repeat_timer_ |
| The timer for the repeating events. | |
Definition at line 24 of file repeating_button.hpp.
enum gui2::trepeating_button::tstate [private] |
Possible states of the widget.
Note the order of the states must be the same as defined in settings.hpp.
Definition at line 81 of file repeating_button.hpp.
| gui2::trepeating_button::trepeating_button | ( | ) |
Definition at line 37 of file repeating_button.cpp.
References signal_handler_left_button_down(), signal_handler_left_button_up(), signal_handler_mouse_enter(), and signal_handler_mouse_leave().

| gui2::trepeating_button::~trepeating_button | ( | ) |
Definition at line 60 of file repeating_button.cpp.
References gui2::remove_timer(), and repeat_timer_.

| void gui2::trepeating_button::connect_click_handler | ( | const event::tsignal_function & | signal | ) | [inline, virtual] |
Inherited from tclickable.
Implements gui2::tclickable_.
Definition at line 64 of file repeating_button.hpp.
References connect_signal_mouse_left_down().

| void gui2::trepeating_button::connect_signal_mouse_left_down | ( | const event::tsignal_function & | signal | ) |
Connects a signal handler for a left mouse button down.
This event is triggered when the button is pressed and, as long as the button stays down, every x ms afterwards.
| signal | The signal to connect. |
Definition at line 67 of file repeating_button.cpp.
Referenced by connect_click_handler().

| void gui2::trepeating_button::disconnect_click_handler | ( | const event::tsignal_function & | signal | ) | [inline, virtual] |
Inherited from tclickable.
Implements gui2::tclickable_.
Definition at line 70 of file repeating_button.hpp.
References disconnect_signal_mouse_left_down().

| void gui2::trepeating_button::disconnect_signal_mouse_left_down | ( | const event::tsignal_function & | signal | ) |
Disconnects a signal handler for a left mouse button down.
| signal | The signal to disconnect (should be the same as send to the connect call. |
Definition at line 73 of file repeating_button.cpp.
Referenced by disconnect_click_handler().

| bool gui2::trepeating_button::get_active | ( | ) | const [inline] |
Inherited from tcontrol.
Definition at line 58 of file repeating_button.hpp.
References state_.
Referenced by set_active(), and signal_handler_left_button_up().

| const std::string & gui2::trepeating_button::get_control_type | ( | ) | const [private] |
| unsigned gui2::trepeating_button::get_state | ( | ) | const [inline] |
| void gui2::trepeating_button::set_active | ( | const bool | active | ) | [inline] |
Inherited from tcontrol.
Definition at line 54 of file repeating_button.hpp.
References DISABLED, ENABLED, get_active(), and set_state().

| void gui2::trepeating_button::set_state | ( | const tstate | state | ) | [private] |
Definition at line 79 of file repeating_button.cpp.
References DISABLED, gui2::remove_timer(), repeat_timer_, gui2::twidget::set_dirty(), and state_.
Referenced by set_active(), signal_handler_left_button_down(), signal_handler_left_button_up(), signal_handler_mouse_enter(), and signal_handler_mouse_leave().


| void gui2::trepeating_button::signal_handler_left_button_down | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 116 of file repeating_button.cpp.
References gui2::add_timer(), DBG_GUI_E, game_events::fire(), gui2::twidget::get_window(), gui2::event::LEFT_BUTTON_DOWN, LOG_HEADER, gui2::twindow::mouse_capture(), sound::play_UI_sound(), PRESSED, gui2::settings::repeat_button_repeat_time, repeat_timer_, set_state(), and gui2::settings::sound_button_click.
Referenced by trepeating_button().


| void gui2::trepeating_button::signal_handler_left_button_up | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 147 of file repeating_button.cpp.
References DBG_GUI_E, FOCUSSED, get_active(), LOG_HEADER, gui2::remove_timer(), repeat_timer_, and set_state().
Referenced by trepeating_button().


| void gui2::trepeating_button::signal_handler_mouse_enter | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 98 of file repeating_button.cpp.
References DBG_GUI_E, FOCUSSED, LOG_HEADER, and set_state().
Referenced by trepeating_button().


| void gui2::trepeating_button::signal_handler_mouse_leave | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 107 of file repeating_button.cpp.
References DBG_GUI_E, ENABLED, LOG_HEADER, and set_state().
Referenced by trepeating_button().


unsigned long gui2::trepeating_button::repeat_timer_ [private] |
The timer for the repeating events.
Definition at line 93 of file repeating_button.hpp.
Referenced by set_state(), signal_handler_left_button_down(), signal_handler_left_button_up(), and ~trepeating_button().
tstate gui2::trepeating_button::state_ [private] |
Current state of the widget.
The state of the widget determines what to render and how the widget reacts to certain 'events'.
Definition at line 90 of file repeating_button.hpp.
Referenced by get_active(), get_state(), and set_state().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:23:13 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |