#include <combo_drag.hpp>


Public Member Functions | |
| combo_drag (display &disp, 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 | |
| virtual void | process (events::pump_info &) |
| Implements return after drop. | |
Protected Member Functions | |
| virtual void | process_event () |
| virtual void | mouse_motion (const SDL_MouseMotionEvent &event) |
| virtual void | mouse_down (const SDL_MouseButtonEvent &event) |
| virtual void | mouse_up (const SDL_MouseButtonEvent &event) |
Private Types | |
| enum | drag_state { NONE, PRESSED, PRESSED_MOVE, MOVED, RETURN, DROP_DOWN } |
Private Member Functions | |
| void | handle_move (const SDL_MouseMotionEvent &event) |
| void | handle_drop () |
Private Attributes | |
| int | drag_target_ |
| int | old_drag_target_ |
| SDL_Rect | old_location_ |
| int | mouse_x_ |
| int | mouse_y_ |
| drag_state | drag_ |
Static Private Attributes | |
| static const float | MIN_DRAG_DISTANCE = 10.0 |
| static const float | RETURN_SPEED = 25.0 |
Definition at line 28 of file combo_drag.hpp.
enum gui::combo_drag::drag_state [private] |
Definition at line 54 of file combo_drag.hpp.
| gui::combo_drag::combo_drag | ( | display & | disp, | |
| const std::vector< std::string > & | items, | |||
| const drop_group_manager_ptr | group | |||
| ) |
Definition at line 29 of file combo_drag.cpp.
| int gui::combo_drag::get_drop_target | ( | ) |
used to query if this object was dropped to a target
Definition at line 43 of file combo_drag.cpp.
References drag_target_, and old_drag_target_.
| void gui::combo_drag::handle_drop | ( | ) | [private] |
Definition at line 112 of file combo_drag.cpp.
References drag_target_.
Referenced by mouse_up().

| void gui::combo_drag::handle_move | ( | const SDL_MouseMotionEvent & | event | ) | [private] |
Definition at line 50 of file combo_drag.cpp.
References gui::widget::aquire_mouse_lock(), gui::widget::clip_rect(), drag_, gui::widget::location(), MIN_DRAG_DISTANCE, mouse_x_, mouse_y_, old_location_, PRESSED, PRESSED_MOVE, and gui::widget::set_location().
Referenced by mouse_motion().


| void gui::combo_drag::mouse_down | ( | const SDL_MouseButtonEvent & | event | ) | [protected, virtual] |
Definition at line 151 of file combo_drag.cpp.
References drag_, gui::button::hit(), mouse_x_, and mouse_y_.

| void gui::combo_drag::mouse_motion | ( | const SDL_MouseMotionEvent & | event | ) | [protected, virtual] |
Definition at line 117 of file combo_drag.cpp.
References drag_, handle_move(), MOVED, PRESSED, and PRESSED_MOVE.

| void gui::combo_drag::mouse_up | ( | const SDL_MouseButtonEvent & | event | ) | [protected, virtual] |
Definition at line 129 of file combo_drag.cpp.
References drag_, gui::widget::free_mouse_lock(), handle_drop(), gui::widget::hide(), MOVED, PRESSED, and PRESSED_MOVE.

| void gui::combo_drag::process | ( | events::pump_info & | ) | [virtual] |
Implements return after drop.
Implements events::pump_monitor.
Definition at line 89 of file combo_drag.cpp.
References drag_, gui::widget::location(), old_location_, RETURN, RETURN_SPEED, and gui::widget::set_location().

| void gui::combo_drag::process_event | ( | ) | [protected, virtual] |
Definition at line 162 of file combo_drag.cpp.
References drag_, DROP_DOWN, and gui::combo::make_drop_down_menu().

drag_state gui::combo_drag::drag_ [private] |
Definition at line 62 of file combo_drag.hpp.
Referenced by handle_move(), mouse_down(), mouse_motion(), mouse_up(), process(), and process_event().
int gui::combo_drag::drag_target_ [private] |
Definition at line 51 of file combo_drag.hpp.
Referenced by get_drop_target(), and handle_drop().
const float gui::combo_drag::MIN_DRAG_DISTANCE = 10.0 [static, private] |
Definition at line 63 of file combo_drag.hpp.
Referenced by handle_move().
int gui::combo_drag::mouse_x_ [private] |
Definition at line 53 of file combo_drag.hpp.
Referenced by handle_move(), and mouse_down().
int gui::combo_drag::mouse_y_ [private] |
Definition at line 53 of file combo_drag.hpp.
Referenced by handle_move(), and mouse_down().
int gui::combo_drag::old_drag_target_ [private] |
Definition at line 51 of file combo_drag.hpp.
Referenced by get_drop_target().
SDL_Rect gui::combo_drag::old_location_ [private] |
Definition at line 52 of file combo_drag.hpp.
Referenced by handle_move(), and process().
const float gui::combo_drag::RETURN_SPEED = 25.0 [static, private] |
Definition at line 64 of file combo_drag.hpp.
Referenced by process().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:21:16 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |