]> git.tdb.fi Git - libs/gltk.git/blob - source/draghandle.h
0aae73231877a819cecff1aff7ed733d9d4f6d17
[libs/gltk.git] / source / draghandle.h
1 #ifndef MSP_GLTK_DRAGHANDLE_H_
2 #define MSP_GLTK_DRAGHANDLE_H_
3
4 #include "mspgltk_api.h"
5 #include "widget.h"
6
7 namespace Msp {
8 namespace GLtk {
9
10 /**
11 Moves its parent widget when dragged.  This allows turning a Panel or Dialog
12 into a movable window.
13 */
14 class MSPGLTK_API DragHandle: public Widget
15 {
16 private:
17         bool dragging;
18         int drag_x;
19         int drag_y;
20
21 public:
22         DragHandle();
23
24         virtual const char *get_class() const { return "draghandle"; }
25
26         virtual void button_press(int, int, unsigned);
27         virtual void button_release(int, int, unsigned);
28         virtual void pointer_motion(int, int);
29 private:
30         virtual void on_reparent();
31 };
32
33 } // namespace GLtk
34 } // namespace Msp
35
36 #endif