Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes

gui::combo_drag Class Reference

#include <combo_drag.hpp>

Inheritance diagram for gui::combo_drag:
Inheritance graph
[legend]
Collaboration diagram for gui::combo_drag:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Definition at line 28 of file combo_drag.hpp.


Member Enumeration Documentation

Enumerator:
NONE 
PRESSED 
PRESSED_MOVE 
MOVED 
RETURN 
DROP_DOWN 

Definition at line 54 of file combo_drag.hpp.


Constructor & Destructor Documentation

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.


Member Function Documentation

int gui::combo_drag::get_drop_target (  ) 

used to query if this object was dropped to a target

Returns:
: -1 if not dropped and other the id of target object

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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_.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:


Member Data Documentation

Definition at line 62 of file combo_drag.hpp.

Referenced by handle_move(), mouse_down(), mouse_motion(), mouse_up(), process(), and process_event().

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().

Definition at line 53 of file combo_drag.hpp.

Referenced by handle_move(), and mouse_down().

Definition at line 53 of file combo_drag.hpp.

Referenced by handle_move(), and mouse_down().

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:21:16 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs