]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/draghandle.h
Rename some get functions as find because they can return null
[libs/gltk.git] / source / draghandle.h
index 5643df4a00c3f994e39db1f212898df9861ad3e3..68381feba520b4b0be7e0d3bc4e2dda96cb51cc5 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MSP_GLTK_DRAGHANDLE_H_
 #define MSP_GLTK_DRAGHANDLE_H_
 
+#include "mspgltk_api.h"
 #include "widget.h"
 
 namespace Msp {
@@ -10,23 +11,21 @@ namespace GLtk {
 Moves its parent widget when dragged.  This allows turning a Panel or Dialog
 into a movable window.
 */
-class DragHandle: public Widget
+class MSPGLTK_API DragHandle: public Widget
 {
 private:
-       bool dragging;
-       int drag_x;
-       int drag_y;
+       bool dragging = false;
+       int drag_x = 0;
+       int drag_y = 0;
 
 public:
-       DragHandle();
+       const char *get_class() const override { return "draghandle"; }
 
-       virtual const char *get_class() const { return "draghandle"; }
-
-       virtual void button_press(int, int, unsigned);
-       virtual void button_release(int, int, unsigned);
-       virtual void pointer_motion(int, int);
+       void button_press(int, int, unsigned) override;
+       void button_release(int, int, unsigned) override;
+       void pointer_motion(int, int) override;
 private:
-       virtual void on_reparent();
+       void on_reparent() override;
 };
 
 } // namespace GLtk