diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-12 17:27:00 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-12 17:27:00 +0000 |
commit | 574bf11742c40203a4433c0b69264014b10b5a96 (patch) | |
tree | 5fdaa40d22c38e5d8cce47d43a1a892008322598 /src/ui/widget.h | |
parent | b417df720584c101f3799874a0c836a543a8d0a8 (diff) |
container widget
Diffstat (limited to 'src/ui/widget.h')
-rw-r--r-- | src/ui/widget.h | 24 |
1 files changed, 13 insertions, 11 deletions
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<Widget *> 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<Widget *> 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; |