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/ui.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/ui/ui.h') diff --git a/src/ui/ui.h b/src/ui/ui.h index eb2d4e0..583f76c 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -34,17 +34,17 @@ public: void load(); /// make a window the active window - void show_window(const char *label); + void show_menu(const char *label); /// hide the active window - void hide_window(); + void hide_menu(); /// show previous window - void previous_window(); + void previous_menu(); - /// return the active window + /// return the active menu Window *active() { - return ui_active_window; + return ui_active_menu; } /// return the widget with global mouse focus @@ -79,11 +79,13 @@ public: } protected: - Window *find_window(const char *label) const; - - virtual void add_window(Window *window); - virtual void remove_window(Window *window); + typedef std::list Menus; + Menus::iterator find_menu(Window *menu); + Window *find_menu(const char *label); + + void add_menu(Window *window); + /* -- event handlers --------------------------------------- */ /// handle keypress events @@ -97,9 +99,11 @@ private: Font *ui_font_small; Font *ui_font_large; - Window *ui_active_window; + Window *ui_active_menu; Widget *ui_mouse_focus; Widget *ui_input_focus; + + Menus ui_menus; /// TODO move to separate object to handle mouse cursor drawing math::Vector2f mouse_cursor; -- cgit v1.2.3