X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdropdown.h;h=c5b535d599bcaae434bb29f0fd53f06f0334890f;hb=d10d1de6d17c285c63d7b3cea549017aaa1ddb01;hp=ad8b4619bc4a00789e6bd53ab6ac6dae3ba83829;hpb=08b48157dc9ca5a4bd59d8eec9fa4e3bff8f0503;p=libs%2Fgltk.git diff --git a/source/dropdown.h b/source/dropdown.h index ad8b461..c5b535d 100644 --- a/source/dropdown.h +++ b/source/dropdown.h @@ -3,6 +3,7 @@ #include #include "list.h" +#include "mspgltk_api.h" #include "text.h" #include "widget.h" @@ -11,10 +12,10 @@ namespace GLtk { class List; -class Dropdown: virtual public Widget, private Container +class MSPGLTK_API Dropdown: virtual public Widget, private Container { public: - class Loader: public DataFile::DerivedObjectLoader + class MSPGLTK_API Loader: public DataFile::DerivedObjectLoader { public: Loader(Dropdown &); @@ -26,7 +27,7 @@ public: private: List list; - bool dropped; + bool dropped = false; Text text; public: @@ -36,10 +37,10 @@ private: void init(); public: - virtual const char *get_class() const { return "dropdown"; } + const char *get_class() const override { return "dropdown"; } private: - virtual void autosize_special(const Part &, Geometry &) const; + void autosize_special(const Part &, Geometry &) const override; public: void set_data(ListData &d) { list.set_data(d); } @@ -53,18 +54,22 @@ public: int get_selected_index() const { return list.get_selected_index(); } private: - virtual void rebuild_special(const Part &); - virtual void render_special(const Part &, GL::Renderer &) const; + void rebuild_special(const Part &) override; + void render_special(const Part &, GL::Renderer &) const override; public: - virtual void button_press(int, int, unsigned); + void button_press(int, int, unsigned) override; + bool navigate(Navigation) override; private: - virtual void on_geometry_change(); - virtual void on_style_change(); + void on_size_change() override; + void on_style_change() override; + void open_list(); + void close_list(); void list_autosize_changed(); void resize_list(); void list_item_selected(unsigned); + void list_selection_cleared(); }; } // namespace GLtk