]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/widget.h
Rework event passing system to allow for pointer grabs
[libs/gltk.git] / source / widget.h
index f64e2ea08235c1a9f41e47059c813c3ce49acf30..322fbfa8a53f0b052ce94c45ab5fed847c7a6837 100644 (file)
@@ -22,9 +22,11 @@ public:
        void set_style(const std::string &);
        const Geometry &get_geometry() const { return geom; }
        void render() const;
-       bool button_press(int, int, unsigned);
-       bool button_release(int, int, unsigned);
-       bool pointer_motion(int, int);
+       virtual void button_press(int, int, unsigned) { }
+       virtual void button_release(int, int, unsigned) { }
+       virtual void pointer_motion(int, int) { }
+       virtual void pointer_enter() { }
+       virtual void pointer_leave() { }
 protected:
        const Resources &res;
        Geometry geom;
@@ -38,11 +40,6 @@ protected:
        virtual void render_part(const Part &) const;
        void render_graphic(const Part &) const;
        void render_text(const Part &, const std::string &) const;
-       virtual void on_button_press(int, int, unsigned) { }
-       virtual void on_button_release(int, int, unsigned) { }
-       virtual void on_pointer_motion(int, int, unsigned) { }
-       virtual void on_pointer_enter() { }
-       virtual void on_pointer_leave() { }
 };
 
 } // namespace GLtk