16 #define GETTEXT_DOMAIN "wesnoth-lib"
26 :
widget(auto_join), scrollbar_(),
27 old_position_(0), recursive_(false), shown_scrollbar_(false),
28 shown_size_(0), full_size_(0), swipe_dy_(0)
154 if (event.type == SDL_MOUSEWHEEL) {
155 const SDL_MouseWheelEvent &ev =
event.wheel;
159 }
else if (ev.y < 0) {
165 if (event.type == SDL_FINGERUP) {
169 if (event.type == SDL_FINGERDOWN || event.type == SDL_FINGERMOTION) {
174 auto tx =
static_cast<int>(
event.tfinger.x * canvas_size.x);
175 auto ty =
static_cast<int>(
event.tfinger.y * canvas_size.y);
176 auto dy =
static_cast<int>(
event.tfinger.dy * canvas_size.y);
178 if (event.type == SDL_FINGERDOWN) {
184 if (event.type == SDL_FINGERMOTION) {
192 if (scrollbar_step <= 0) {
199 unsigned int pos = std::max(
std::vector< events::sdl_handler * > sdl_handler_vector
void rect(const SDL_Rect &rect)
Draw a rectangle.
point get_mouse_location()
Returns the current mouse location in draw space.
bool contains(const Container &container, const Value &value)
Returns true iff value is found in container.
point game_canvas_size()
The size of the game canvas, in drawing coordinates / game pixels.
Contains the SDL_Rect helper code.
An abstract description of a rectangle with integer coordinates.
bool contains(int x, int y) const
Whether the given point lies within the rectangle.