#include <distributor.hpp>
Public Member Functions | |
mouse_motion (widget &owner, const dispatcher::queue_position queue_position) | |
~mouse_motion () | |
void | capture_mouse (const bool capture=true) |
Captures the mouse input. More... | |
Protected Member Functions | |
void | start_hover_timer (widget *widget, const point &coordinate) |
Starts the hover timer. More... | |
void | stop_hover_timer () |
Stops the current hover timer. More... | |
void | mouse_enter (widget *mouse_over) |
Called when the mouse enters a widget. More... | |
void | mouse_leave () |
Called when the mouse leaves the current widget. More... | |
Protected Attributes | |
widget * | mouse_focus_ |
The widget that currently has the mouse focus_. More... | |
bool | mouse_captured_ |
Did the current widget capture the focus_? More... | |
widget & | owner_ |
The widget that owns us. More... | |
std::size_t | hover_timer_ |
The timer for the hover event. More... | |
widget * | hover_widget_ |
The widget which should get the hover event. More... | |
point | 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_hover (widget *mouse_over, const point &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::ui_event event, bool &handled, const point &coordinate) |
void | signal_handler_sdl_touch_motion (const event::ui_event event, bool &handled, const point &coordinate, const point &distance) |
void | signal_handler_sdl_wheel (const event::ui_event event, bool &handled, const point &coordinate) |
void | signal_handler_show_helptip (const event::ui_event event, bool &handled, const point &coordinate) |
Private Attributes | |
bool | signal_handler_sdl_mouse_motion_entered_ |
Definition at line 58 of file distributor.hpp.
gui2::event::mouse_motion::mouse_motion | ( | widget & | owner, |
const dispatcher::queue_position | queue_position | ||
) |
Definition at line 67 of file distributor.cpp.
References gui2::event::dispatcher::connect_signal(), owner_, gui2::event::SDL_MOUSE_MOTION, gui2::event::SDL_TOUCH_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_touch_motion(), signal_handler_sdl_wheel(), and signal_handler_show_helptip().
gui2::event::mouse_motion::~mouse_motion | ( | ) |
Definition at line 135 of file distributor.cpp.
References stop_hover_timer().
void gui2::event::mouse_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 140 of file distributor.cpp.
References mouse_captured_, and mouse_focus_.
|
protected |
Called when the mouse enters a widget.
mouse_over | The widget that should receive the event. |
Definition at line 242 of file distributor.cpp.
References DBG_GUI_E, gui2::event::dispatcher::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().
|
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 255 of file distributor.cpp.
References DBG_GUI_E, gui2::event::dispatcher::fire(), hover_position_, hover_timer_, LOG_HEADER, gui2::event::MOUSE_MOTION, owner_, start_hover_timer(), stop_hover_timer(), map_location::x, and map_location::y.
Referenced by signal_handler_sdl_mouse_motion().
|
protected |
Called when the mouse leaves the current widget.
Definition at line 295 of file distributor.cpp.
References DBG_GUI_E, gui2::event::dispatcher::fire(), gui2::styled_widget::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 wants the widget to show its tooltip.
Definition at line 271 of file distributor.cpp.
References DBG_GUI_E, ERR_GUI_E, gui2::event::dispatcher::fire(), hover_position_, hover_shown_, hover_timer_, hover_widget_, LOG_HEADER, owner_, draw::point(), and gui2::event::SHOW_TOOLTIP.
Referenced by start_hover_timer().
|
private |
Definition at line 146 of file distributor.cpp.
References gui2::widget::can_mouse_focus(), DBG_GUI_E, gui2::widget::find_at(), gui2::event::dispatcher::fire(), LOG_HEADER, mouse_captured_, mouse_enter(), mouse_focus_, mouse_hover(), mouse_leave(), owner_, gui2::widget::parent(), and signal_handler_sdl_mouse_motion_entered_.
Referenced by mouse_motion().
|
private |
Definition at line 190 of file distributor.cpp.
References DBG_GUI_E, gui2::widget::find_at(), gui2::event::dispatcher::fire(), LOG_HEADER, mouse_captured_, mouse_focus_, and owner_.
Referenced by mouse_motion().
|
private |
Definition at line 206 of file distributor.cpp.
References DBG_GUI_E, gui2::widget::find_at(), gui2::event::dispatcher::fire(), LOG_HEADER, mouse_captured_, mouse_focus_, and owner_.
Referenced by mouse_motion().
|
private |
Definition at line 221 of file distributor.cpp.
References DBG_GUI_E, gui2::widget::find_at(), gui2::event::dispatcher::fire(), LOG_HEADER, mouse_captured_, mouse_focus_, owner_, and stop_hover_timer().
Referenced by mouse_motion().
|
protected |
Starts the hover timer.
widget | The widget that wants the tooltip. |
coordinate | The anchor coordinate. |
Definition at line 311 of file distributor.cpp.
References gui2::add_timer(), DBG_GUI_E, ERR_GUI_E, hover_position_, hover_shown_, hover_timer_, hover_widget_, gui2::widget::id(), LOG_HEADER, show_tooltip(), stop_hover_timer(), and gui2::event_executor::wants_mouse_hover().
Referenced by mouse_enter(), and mouse_hover().
|
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::widget::id(), LOG_HEADER, draw::point(), and gui2::remove_timer().
Referenced by mouse_hover(), mouse_leave(), gui2::event::distributor::signal_handler_notify_removal(), signal_handler_show_helptip(), start_hover_timer(), and ~mouse_motion().
|
protected |
The anchor point of the hover event.
Definition at line 91 of file distributor.hpp.
Referenced by mouse_hover(), 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 100 of file distributor.hpp.
Referenced by mouse_enter(), show_tooltip(), and start_hover_timer().
|
protected |
The timer for the hover event.
Definition at line 85 of file distributor.hpp.
Referenced by mouse_hover(), show_tooltip(), start_hover_timer(), and stop_hover_timer().
|
protected |
The widget which should get the hover event.
Definition at line 88 of file distributor.hpp.
Referenced by show_tooltip(), gui2::event::distributor::signal_handler_notify_removal(), start_hover_timer(), and stop_hover_timer().
|
protected |
Did the current widget capture the focus_?
Definition at line 79 of file distributor.hpp.
Referenced by capture_mouse(), signal_handler_sdl_mouse_motion(), signal_handler_sdl_touch_motion(), signal_handler_sdl_wheel(), and signal_handler_show_helptip().
|
protected |
The widget that currently has the mouse focus_.
Definition at line 76 of file distributor.hpp.
Referenced by capture_mouse(), mouse_enter(), mouse_leave(), gui2::event::distributor::signal_handler_notify_removal(), signal_handler_sdl_mouse_motion(), signal_handler_sdl_touch_motion(), signal_handler_sdl_wheel(), and signal_handler_show_helptip().
|
protected |
The widget that owns us.
Definition at line 82 of file distributor.hpp.
Referenced by gui2::event::distributor::distributor(), gui2::event::distributor::keyboard_capture(), gui2::event::mouse_button< I >::mouse_button(), mouse_enter(), mouse_hover(), mouse_leave(), mouse_motion(), show_tooltip(), gui2::event::distributor::signal_handler_keyboard_internal(), signal_handler_sdl_mouse_motion(), signal_handler_sdl_touch_motion(), signal_handler_sdl_wheel(), signal_handler_show_helptip(), and gui2::event::distributor::~distributor().
|
private |
Definition at line 135 of file distributor.hpp.
Referenced by signal_handler_sdl_mouse_motion().