Simple push button. More...
#include <button.hpp>


Public Member Functions | |
| tbutton () | |
| 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. | |
| void | set_retval (const int retval) |
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) |
| void | signal_handler_left_button_click (const event::tevent event, bool &handled) |
Private Attributes | |
| tstate | state_ |
| Current state of the widget. | |
| int | retval_ |
| The return value of the button. | |
Simple push button.
Definition at line 27 of file button.hpp.
enum gui2::tbutton::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 68 of file button.hpp.
| gui2::tbutton::tbutton | ( | ) |
Definition at line 36 of file button.cpp.
References signal_handler_left_button_click(), signal_handler_left_button_down(), signal_handler_left_button_up(), signal_handler_mouse_enter(), and signal_handler_mouse_leave().

| void gui2::tbutton::connect_click_handler | ( | const event::tsignal_function & | signal | ) | [inline, virtual] |
Inherited from tclickable.
Implements gui2::tclickable_.
Definition at line 47 of file button.hpp.
References gui2::event::connect_signal_mouse_left_click().
Referenced by gui2::tchat_log::view::bind().


| void gui2::tbutton::disconnect_click_handler | ( | const event::tsignal_function & | signal | ) | [inline, virtual] |
Inherited from tclickable.
Implements gui2::tclickable_.
Definition at line 53 of file button.hpp.
References gui2::event::disconnect_signal_mouse_left_click().

| bool gui2::tbutton::get_active | ( | ) | const [inline] |
Inherited from tcontrol.
Definition at line 41 of file button.hpp.
References state_.
Referenced by set_active().

| const std::string & gui2::tbutton::get_control_type | ( | ) | const [private] |
| unsigned gui2::tbutton::get_state | ( | ) | const [inline] |
| void gui2::tbutton::set_active | ( | const bool | active | ) | [inline] |
Inherited from tcontrol.
Definition at line 37 of file button.hpp.
References DISABLED, ENABLED, get_active(), and set_state().
Referenced by gui2::tlobby_main::adjust_game_row_contents(), gui2::tformula_debugger::pre_show(), gui2::tlobby_player_info::update_relation(), and gui2::tchat_log::controller::update_view_from_model().


| void gui2::tbutton::set_retval | ( | const int | retval | ) | [inline] |
Definition at line 60 of file button.hpp.
References retval_.
Referenced by gui2::tmessage_implementation::init_button().

| void gui2::tbutton::set_state | ( | const tstate | state | ) | [private] |
Definition at line 55 of file button.cpp.
References 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::tbutton::signal_handler_left_button_click | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 110 of file button.cpp.
References DBG_GUI_E, gui2::twidget::get_window(), LOG_HEADER, sound::play_UI_sound(), retval_, gui2::twindow::set_retval(), and gui2::settings::sound_button_click.
Referenced by tbutton().


| void gui2::tbutton::signal_handler_left_button_down | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 87 of file button.cpp.
References DBG_GUI_E, gui2::twidget::get_window(), LOG_HEADER, gui2::twindow::mouse_capture(), PRESSED, and set_state().
Referenced by tbutton().


| void gui2::tbutton::signal_handler_left_button_up | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 101 of file button.cpp.
References DBG_GUI_E, FOCUSSED, LOG_HEADER, and set_state().
Referenced by tbutton().


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


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


int gui2::tbutton::retval_ [private] |
The return value of the button.
If this value is not 0 and the button is clicked it sets the retval of the window and the window closes itself.
Definition at line 85 of file button.hpp.
Referenced by set_retval(), and signal_handler_left_button_click().
tstate gui2::tbutton::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 77 of file button.hpp.
Referenced by get_active(), get_state(), and set_state().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:22:40 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |