From 5fbcaf2e42228f38941bc24b8ab193a74a9e6422 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 28 Aug 2011 18:15:52 +0000 Subject: Made a number of ui::Widget child managment methods public. --- src/ui/widget.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src/ui/widget.h') diff --git a/src/ui/widget.h b/src/ui/widget.h index e98d4c5..9aae10e 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h @@ -27,6 +27,10 @@ class Widget { public: + /// type definition for child widgets + typedef std::list Children; + + /// types of custom events a widget can emit enum Event { EventNone = 0, @@ -51,6 +55,13 @@ public: /* -- inspectors -------------------------------------------- */ + /// child widgets + inline Children &children() { + return widget_children; + } + + + /// pixel coordinates of the top-left corner of this widget within its parent inline const math::Vector2f &location() const { return widget_location; @@ -161,6 +172,10 @@ public: /// return true of the widget is a child widget bool is_child(const Widget *widget) const; + /// return the next sibling + Widget *next_sibling(); + + /* -- mutators --------------------------------------------- */ /// raise the widget to the top of the widget stack @@ -262,7 +277,7 @@ public: /** * @brief calls the custom event handler and sends unhandled events to the parent widget - * @see on_event + * @see on_emit **/ bool event_emit(Widget *sender, const Event event, void *data = 0); @@ -272,16 +287,6 @@ public: } protected: - /// type definition for child widgets - typedef std::list Children; - - /// child widgets - inline Children &children() { - return widget_children; - } - - /// return the next sibling - Widget *next_sibling(); /// find the widget that has input focus virtual Widget *find_input_focus(); -- cgit v1.2.3