From bc50666e86d5739ccde633eb630cc75b3e0fcb71 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 7 Oct 2008 20:35:52 +0000 Subject: libui updates --- src/ui/widget.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/ui/widget.h') diff --git a/src/ui/widget.h b/src/ui/widget.h index 13f392e..26832c7 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h @@ -45,7 +45,6 @@ public: inline float const height() const { return widget_size.y; } - inline Palette const *palette() const { return widget_palette; } inline std::string const &label() const { return widget_label; } @@ -53,10 +52,12 @@ public: inline bool background() const { return widget_background; } - inline Widget *parent() { return widget_parent; } + inline Widget *parent() const { return widget_parent; } inline bool visible() const { return widget_visible; } + Palette const *palette() const; + bool has_focus() const; @@ -99,17 +100,23 @@ public: /// draw event virtual void event_draw(); - /// handle mouse cursor - virtual void event_mousecursor(float x, float y); + /// handle mouse movement + virtual void mousemove(float x, float y); - /// handle keyboard input - virtual void event_keypress(unsigned int key, unsigned int modifier); + /// handle keyboard events + virtual void keypress(unsigned int key, unsigned int modifier); - virtual void event_keyrelease(unsigned int key, unsigned int modifier); + virtual void keyrelease(unsigned int key, unsigned int modifier); /// child widgets inline Children &children() { return widget_children; } + /// raise the widget to the top of the widget stack + void raise(); + + /// lower the widget to the bottom of the widget stack + void lower(); + protected: /// draw the widget virtual void draw(); @@ -171,8 +178,6 @@ protected: */ Widget *find_focus(math::Vector2f const & pos); - Palette *widget_palette; - private: bool widget_visible; bool widget_background; @@ -183,6 +188,7 @@ private: Children widget_children; + Palette *widget_palette; Widget *widget_parent; Children::iterator find_child(Widget *child); -- cgit v1.2.3