Public Member Functions | Private Types | Private Member Functions | Private Attributes

gui2::trepeating_button Class Reference

#include <repeating_button.hpp>

Inheritance diagram for gui2::trepeating_button:
Inheritance graph
[legend]
Collaboration diagram for gui2::trepeating_button:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

Definition at line 24 of file repeating_button.hpp.


Member Enumeration Documentation

Possible states of the widget.

Note the order of the states must be the same as defined in settings.hpp.

Enumerator:
ENABLED 
DISABLED 
PRESSED 
FOCUSSED 
COUNT 

Definition at line 81 of file repeating_button.hpp.


Constructor & Destructor Documentation

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().

Here is the call graph for this function:

gui2::trepeating_button::~trepeating_button (  ) 

Definition at line 60 of file repeating_button.cpp.

References gui2::remove_timer(), and repeat_timer_.

Here is the call graph for this function:


Member Function Documentation

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().

Here is the call graph for this function:

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.

Parameters:
signal The signal to connect.

Definition at line 67 of file repeating_button.cpp.

Referenced by connect_click_handler().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

void gui2::trepeating_button::disconnect_signal_mouse_left_down ( const event::tsignal_function signal  ) 

Disconnects a signal handler for a left mouse button down.

Parameters:
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

const std::string & gui2::trepeating_button::get_control_type (  )  const [private]

Inherited from tcontrol.

Definition at line 92 of file repeating_button.cpp.

References type.

unsigned gui2::trepeating_button::get_state (  )  const [inline]

Inherited from tcontrol.

Definition at line 61 of file repeating_button.hpp.

References state_.

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void gui2::trepeating_button::signal_handler_left_button_down ( const event::tevent  event,
bool &  handled 
) [private]
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

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().

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:23:13 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs