A drag event occurs when the user moves the mouse with one of the mouse buttons pressed down. In VGUI there is no vgui_DRAG event (there is only vgui_MOTION for when the mouse is moving). So if you want to capture drag events you may find this class handy.
The drag_mixin records the last mouse button to be pressed and will send vgui_MOTION events to the function mouse_drag() if the mouse is being moved with a button depressed.
An easy way to use vgui_drag_mixin is to derive your tableau from vgui_drag_tableau. You would then be able to implement mouse_drag and all the other function like key_press, mouse_down in vgui_tableau to handle events.
Public Member Functions
|Constructor - create a default vgui_drag_mixin. |
|virtual bool||handle (vgui_event const &)|
|Look for drag events and pass them to mouse_drag(). |
|virtual bool||mouse_drag (int, int, vgui_button, vgui_modifier)|
|Called when the user is dragging the mouse. |
|Mouse button the user is pressing (vgui_BUTTON_NULL if none is pressed). |
|bool vgui_drag_mixin::handle||(||vgui_event const &||event||)||