15 #define GETTEXT_DOMAIN "wesnoth-lib"
29 ,
const std::vector<std::string>&
items
34 , old_drag_target_(-1)
57 const int diff_x =
event.x -
mouse_x_;
58 const int diff_y =
event.y -
mouse_y_;
60 && std::sqrt(static_cast<float>(diff_x*diff_x + diff_y*diff_y)) >
MIN_DRAG_DISTANCE)
77 if (loc.x + loc.w > clip->x + clip->w)
78 loc.x = clip->x + clip->w - loc.w;
81 if (loc.y + loc.h > clip->y + clip->h)
82 loc.y = clip->y + clip->h - loc.h;
95 const float length = std::sqrt(static_cast<float>(x_diff*x_diff + y_diff*y_diff));
152 if (
hit(event.x, event.y) && event.button == SDL_BUTTON_LEFT)
static const float MIN_DRAG_DISTANCE
virtual void mouse_motion(const SDL_MouseMotionEvent &event)
static const float RETURN_SPEED
const std::vector< std::string > items
virtual void mouse_down(const SDL_MouseButtonEvent &event)
GLuint GLsizei GLsizei * length
virtual void process_event()
int handle_drop()
Called by widget object when droping happens.
combo_drag(CVideo &v, const std::vector< std::string > &items, const drop_group_manager_ptr group)
int get_drop_target()
used to query if this object was dropped to a target
Encapsulates the map of the game.
void handle_move(const SDL_MouseMotionEvent &event)
virtual void mouse_up(const SDL_MouseButtonEvent &event)
void make_drop_down_menu()
virtual void process(events::pump_info &)
Implements return after drop.
Handles droping for drag able ui items.