Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes

gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click > Class Template Reference

#include <distributor.hpp>

Inheritance diagram for gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >:
Inheritance graph
[legend]
Collaboration diagram for gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 tmouse_button (const std::string &name_, twidget &owner, const tdispatcher::tposition queue_position)
void initialize_state (const bool is_down)
 Initializes the state of the button.

Protected Attributes

Uint32 last_click_stamp_
 The time of the last click used for double clicking.
twidgetlast_clicked_widget_
 The widget the last click was on, used for double clicking.
twidgetfocus_
 If the mouse isn't captured we need to verify the up is on the same widget as the down so we send a proper click, also needed to send the up to the right widget.

Private Member Functions

void signal_handler_sdl_button_down (const event::tevent event, bool &handled, const tpoint &coordinate)
void signal_handler_sdl_button_up (const event::tevent event, bool &handled, const tpoint &coordinate)
void mouse_button_click (twidget *widget)

Private Attributes

const std::string name_
 used for debug messages.
bool is_down_
 Is the button down?
bool signal_handler_sdl_button_down_entered_
bool signal_handler_sdl_button_up_entered_

Detailed Description

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
class gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >

Definition at line 161 of file distributor.hpp.


Constructor & Destructor Documentation

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::tmouse_button ( const std::string &  name_,
twidget owner,
const tdispatcher::tposition  queue_position 
)

Definition at line 376 of file distributor.cpp.


Member Function Documentation

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
void gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::initialize_state ( const bool  is_down  ) 

Initializes the state of the button.

Parameters:
is_down The initial state of the button, if true down else initialized as up.

Definition at line 425 of file distributor.cpp.

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
void gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::mouse_button_click ( twidget widget  )  [private]

Definition at line 579 of file distributor.cpp.

References DBG_GUI_E, and gui2::settings::double_click_time.

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
void gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::signal_handler_sdl_button_down ( const event::tevent  event,
bool &  handled,
const tpoint coordinate 
) [private]

Definition at line 447 of file distributor.cpp.

References assert, DBG_GUI_E, gui2::twidget::find_at(), and WRN_GUI_E.

Here is the call graph for this function:

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
void gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::signal_handler_sdl_button_up ( const event::tevent  event,
bool &  handled,
const tpoint coordinate 
) [private]

Definition at line 512 of file distributor.cpp.

References DBG_GUI_E, gui2::twidget::find_at(), and WRN_GUI_E.

Here is the call graph for this function:


Member Data Documentation

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
twidget* gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::focus_ [protected]

If the mouse isn't captured we need to verify the up is on the same widget as the down so we send a proper click, also needed to send the up to the right widget.

Definition at line 191 of file distributor.hpp.

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
bool gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::is_down_ [private]

Is the button down?

Definition at line 198 of file distributor.hpp.

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
Uint32 gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::last_click_stamp_ [protected]

The time of the last click used for double clicking.

Definition at line 181 of file distributor.hpp.

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
twidget* gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::last_clicked_widget_ [protected]

The widget the last click was on, used for double clicking.

Definition at line 184 of file distributor.hpp.

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
const std::string gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::name_ [private]

used for debug messages.

Definition at line 195 of file distributor.hpp.

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
bool gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::signal_handler_sdl_button_down_entered_ [private]

Definition at line 200 of file distributor.hpp.

template<tevent sdl_button_down, tevent sdl_button_up, tevent button_down, tevent button_up, tevent button_click, tevent button_double_click>
bool gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::signal_handler_sdl_button_up_entered_ [private]

Definition at line 206 of file distributor.hpp.


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 Fri Jan 27 2012 01:11:12 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs