From f54bd48a884e4e3c95818f042a4b2418a6e070a4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 7 Oct 2008 17:14:27 +0000 Subject: working button click --- src/ui/ui.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/ui/ui.h') diff --git a/src/ui/ui.h b/src/ui/ui.h index 527d959..28b6997 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -39,8 +39,18 @@ public: /// return the active window Window *active() { return ui_active_window; } - /// set mouse cursor position - void set_mouse_cursor(float x, float y); + /// handle mouse cursor + virtual void event_mousecursor(float x, float y); + + /// handle keyboard input + virtual void event_keypress(unsigned int key, unsigned int modifier); + virtual void event_keyrelease(unsigned int key, unsigned int modifier); + + /// run a user interface frame + void frame(); + + /// return the widget that has the focus + inline Widget *focus() { return ui_focus; } protected: virtual void add_window(Window *window); @@ -48,6 +58,7 @@ protected: private: Window *ui_active_window; + Widget *ui_focus; math::Vector2f mouse_cursor; }; @@ -57,8 +68,6 @@ void init(); /// shutdown the user interface void shutdown(); -void frame(); - /// the global root window UI *root(); -- cgit v1.2.3