From 574bf11742c40203a4433c0b69264014b10b5a96 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 12 Oct 2008 17:27:00 +0000 Subject: container widget --- src/ui/widget.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/ui/widget.h') diff --git a/src/ui/widget.h b/src/ui/widget.h index e069220..41ad795 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h @@ -27,9 +27,6 @@ class Widget { public: - /// type definition for child widgets - typedef std::list Children; - /// create a new widget Widget(Widget *parent=0); @@ -178,12 +175,6 @@ public: ///enable or disable widget background void set_background(bool background = true); - /// child widgets - inline Children &children() { - return widget_children; - } - - /* -- event distributors ----------------------------------- */ /// distribute resize event @@ -199,6 +190,14 @@ public: virtual bool event_mouse(const math::Vector2f &cursor); protected: + /// type definition for child widgets + typedef std::list Children; + + /// child widgets + inline Children &children() { + return widget_children; + } + /// find the widget that has input focus virtual Widget *find_input_focus(); @@ -212,6 +211,9 @@ protected: /// print widget description virtual void print(const size_t indent) const; + + /// true of this sibling has local focus + inline bool focus() const { return widget_focus; } /* -- coordinate mapping ----------------------------------- */ @@ -276,8 +278,8 @@ protected: /// draw the widget border virtual void draw_border(); - void add_child(Widget *child); - void remove_child(Widget *child); + virtual void add_child(Widget *child); + virtual void remove_child(Widget *child); private: bool widget_visible; -- cgit v1.2.3