#include <distributor.hpp>
Public Member Functions | |
tmouse_motion (twidget &owner, const tdispatcher::tposition queue_position) | |
~tmouse_motion () | |
void | capture_mouse (const bool capture=true) |
Captures the mouse input. More... | |
Protected Member Functions | |
void | start_hover_timer (twidget *widget, const tpoint &coordinate) |
Starts the hover timer. More... | |
void | stop_hover_timer () |
Stops the current hover timer. More... | |
void | mouse_enter (twidget *mouse_over) |
Called when the mouse enters a widget. More... | |
void | mouse_leave () |
Called when the mouse leaves the current widget. More... | |
Protected Attributes | |
twidget * | mouse_focus_ |
The widget that currently has the mouse focus_. More... | |
bool | mouse_captured_ |
Did the current widget capture the focus_? More... | |
twidget & | owner_ |
The widget that owns us. More... | |
size_t | hover_timer_ |
The timer for the hover event. More... | |
twidget * | hover_widget_ |
The widget which should get the hover event. More... | |
tpoint | hover_position_ |
The anchor point of the hover event. More... | |
bool | hover_shown_ |
Has the hover been shown for the widget? More... | |
Private Member Functions | |
void | mouse_motion (twidget *mouse_over, const tpoint &coordinate) |
Called when the mouse moves over a widget. More... | |
void | show_tooltip () |
Called when the mouse wants the widget to show its tooltip. More... | |
void | signal_handler_sdl_mouse_motion (const event::tevent event, bool &handled, const tpoint &coordinate) |
void | signal_handler_sdl_wheel (const event::tevent event, bool &handled, const tpoint &coordinate) |
void | signal_handler_show_helptip (const event::tevent event, bool &handled, const tpoint &coordinate) |
Private Attributes | |
bool | signal_handler_sdl_mouse_motion_entered_ |
Definition at line 60 of file distributor.hpp.
gui2::event::tmouse_motion::tmouse_motion | ( | twidget & | owner, |
const tdispatcher::tposition | queue_position | ||
) |
Definition at line 112 of file distributor.cpp.
References gui2::event::tdispatcher::connect_signal(), owner_, gui2::event::SDL_MOUSE_MOTION, gui2::event::SDL_WHEEL_DOWN, gui2::event::SDL_WHEEL_LEFT, gui2::event::SDL_WHEEL_RIGHT, gui2::event::SDL_WHEEL_UP, gui2::event::SHOW_HELPTIP, signal_handler_sdl_mouse_motion(), signal_handler_sdl_wheel(), and signal_handler_show_helptip().
gui2::event::tmouse_motion::~tmouse_motion | ( | ) |
Definition at line 149 of file distributor.cpp.
References stop_hover_timer().
void gui2::event::tmouse_motion::capture_mouse | ( | const bool | capture = true | ) |
Captures the mouse input.
When capturing the widget that has the mouse focus_ does the capturing.
capture | Set or release the capturing. |
Definition at line 154 of file distributor.cpp.
References mouse_captured_, and mouse_focus_.
Called when the mouse enters a widget.
mouse_over | The widget that should receive the event. |
Definition at line 247 of file distributor.cpp.
References DBG_GUI_E, gui2::event::tdispatcher::fire(), gui2::get_mouse_position(), hover_shown_, LOG_HEADER, gui2::event::MOUSE_ENTER, mouse_focus_, owner_, and start_hover_timer().
Referenced by signal_handler_sdl_mouse_motion().
|
protected |
Called when the mouse leaves the current widget.
Definition at line 303 of file distributor.cpp.
References DBG_GUI_E, gui2::event::tdispatcher::fire(), gui2::tcontrol::get_active(), LOG_HEADER, mouse_focus_, gui2::event::MOUSE_LEAVE, gui2::event::NOTIFY_REMOVE_TOOLTIP, owner_, and stop_hover_timer().
Referenced by signal_handler_sdl_mouse_motion().
|
private |
Called when the mouse moves over a widget.
mouse_over | The widget that should receive the event. |
coordinate | The current screen coordinate of the mouse. |
Definition at line 260 of file distributor.cpp.
References DBG_GUI_E, gui2::event::tdispatcher::fire(), hover_position_, hover_timer_, LOG_HEADER, gui2::event::MOUSE_MOTION, owner_, start_hover_timer(), stop_hover_timer(), gui2::tpoint::x, and gui2::tpoint::y.
Referenced by signal_handler_sdl_mouse_motion().
|
private |
Called when the mouse wants the widget to show its tooltip.
Definition at line 278 of file distributor.cpp.
References DBG_GUI_E, ERR_GUI_E, gui2::event::tdispatcher::fire(), hover_position_, hover_shown_, hover_timer_, hover_widget_, LOG_HEADER, owner_, and gui2::event::SHOW_TOOLTIP.
Referenced by start_hover_timer().
|
private |
Definition at line 160 of file distributor.cpp.
References gui2::twidget::can_mouse_focus(), DBG_GUI_E, gui2::twidget::find_at(), gui2::event::tdispatcher::fire(), LOG_HEADER, mouse_captured_, mouse_enter(), mouse_focus_, mouse_leave(), mouse_motion(), owner_, gui2::twidget::parent(), and signal_handler_sdl_mouse_motion_entered_.
Referenced by tmouse_motion().
|
private |
Definition at line 205 of file distributor.cpp.
References DBG_GUI_E, gui2::twidget::find_at(), gui2::event::tdispatcher::fire(), LOG_HEADER, mouse_captured_, mouse_focus_, and owner_.
Referenced by tmouse_motion().
|
private |
Definition at line 223 of file distributor.cpp.
References DBG_GUI_E, gui2::twidget::find_at(), gui2::event::tdispatcher::fire(), LOG_HEADER, mouse_captured_, mouse_focus_, owner_, and stop_hover_timer().
Referenced by tmouse_motion().
|
protected |
Starts the hover timer.
widget | The widget that wants the tooltip. |
coordinate | The anchor coordinate. |
Definition at line 319 of file distributor.cpp.
References gui2::add_timer(), DBG_GUI_E, ERR_GUI_E, hover_position_, hover_shown_, hover_timer_, hover_widget_, gui2::twidget::id(), LOG_HEADER, show_tooltip(), stop_hover_timer(), and gui2::tevent_executor::wants_mouse_hover().
Referenced by mouse_enter(), and mouse_motion().
|
protected |
Stops the current hover timer.
Definition at line 342 of file distributor.cpp.
References DBG_GUI_E, ERR_GUI_E, hover_position_, hover_timer_, hover_widget_, gui2::twidget::id(), LOG_HEADER, and gui2::remove_timer().
Referenced by mouse_leave(), mouse_motion(), gui2::event::tdistributor::signal_handler_notify_removal(), signal_handler_show_helptip(), start_hover_timer(), and ~tmouse_motion().
|
protected |
The anchor point of the hover event.
Definition at line 94 of file distributor.hpp.
Referenced by mouse_motion(), show_tooltip(), start_hover_timer(), and stop_hover_timer().
|
protected |
Has the hover been shown for the widget?
A widget won't get a second hover event after the tooltip has been triggered. Only after (shortly) entering another widget it will be shown again for this widget.
Definition at line 103 of file distributor.hpp.
Referenced by mouse_enter(), show_tooltip(), and start_hover_timer().
|
protected |
The timer for the hover event.
Definition at line 88 of file distributor.hpp.
Referenced by mouse_motion(), show_tooltip(), start_hover_timer(), and stop_hover_timer().
|
protected |
The widget which should get the hover event.
Definition at line 91 of file distributor.hpp.
Referenced by show_tooltip(), gui2::event::tdistributor::signal_handler_notify_removal(), start_hover_timer(), and stop_hover_timer().
|
protected |
Did the current widget capture the focus_?
Definition at line 82 of file distributor.hpp.
Referenced by capture_mouse(), signal_handler_sdl_mouse_motion(), signal_handler_sdl_wheel(), and signal_handler_show_helptip().
|
protected |
The widget that currently has the mouse focus_.
Definition at line 79 of file distributor.hpp.
Referenced by capture_mouse(), mouse_enter(), mouse_leave(), gui2::event::tdistributor::signal_handler_notify_removal(), signal_handler_sdl_mouse_motion(), signal_handler_sdl_wheel(), and signal_handler_show_helptip().
|
protected |
The widget that owns us.
Definition at line 85 of file distributor.hpp.
Referenced by gui2::event::tdistributor::keyboard_capture(), mouse_enter(), mouse_leave(), mouse_motion(), show_tooltip(), gui2::event::tdistributor::signal_handler_sdl_key_down(), signal_handler_sdl_mouse_motion(), signal_handler_sdl_wheel(), signal_handler_show_helptip(), gui2::event::tdistributor::tdistributor(), gui2::event::tmouse_button< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >::tmouse_button(), tmouse_motion(), and gui2::event::tdistributor::~tdistributor().
|
private |
Definition at line 138 of file distributor.hpp.
Referenced by signal_handler_sdl_mouse_motion().