From c62fe609a69058e2e30f757e9a06f72a98464232 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 17 Sep 2010 15:19:34 +0000 Subject: Bump network protocol version to 19, menudescriptions use the info infrastructure, client-side lazy info update requests. Updated ROADMAP --- src/ui/widget.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/ui/widget.h') diff --git a/src/ui/widget.h b/src/ui/widget.h index 50678fa..856fca0 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h @@ -28,7 +28,7 @@ class Widget public: /// types of custom events a widget can emit - enum Event {EventNone = 0, EventSelected = 1}; + enum Event {EventNone = 0, EventButtonClicked, EventListItemClicked}; /// create a new widget Widget(Widget *parent = 0); @@ -202,9 +202,6 @@ public: /// enable or disable widget background void set_background(bool background = true); - /// emit a custom event - void emit(const Event event, const void *data=0); - /* -- event distributors --------------------------------------- */ /** @@ -239,6 +236,14 @@ public: **/ bool event_emit(Widget *sender, const Event event, void *data = 0); + /// emit a custom event + inline void emit(const Event event, void *data=0) { + event_emit(this, event, data); + } + + /// remove all child widgets + virtual void remove_children(); + protected: /// type definition for child widgets typedef std::list Children; @@ -339,9 +344,6 @@ protected: /// remove a child widget virtual void remove_child(Widget *child); - /// remove all child widgets - virtual void remove_children(); - private: void draw_debug_border(); -- cgit v1.2.3