1 #ifndef MSP_GLTK_DROPDOWN_H_
2 #define MSP_GLTK_DROPDOWN_H_
4 #include <sigc++/signal.h>
6 #include "mspgltk_api.h"
15 class MSPGLTK_API Dropdown: virtual public Widget, private Container
18 class MSPGLTK_API Loader: public DataFile::DerivedObjectLoader<Dropdown, Widget::Loader>
23 void item(const std::string &);
26 sigc::signal<void, unsigned> signal_item_selected;
40 virtual const char *get_class() const { return "dropdown"; }
43 virtual void autosize_special(const Part &, Geometry &) const;
46 void set_data(ListData &d) { list.set_data(d); }
47 ListData &get_data() { return list.get_data(); }
48 const ListData &get_data() const { return list.get_data(); }
51 void set_item_type() { list.set_item_type<T>(); }
53 void set_selected_index(int i) { list.set_selected_index(i); }
54 int get_selected_index() const { return list.get_selected_index(); }
57 virtual void rebuild_special(const Part &);
58 virtual void render_special(const Part &, GL::Renderer &) const;
61 virtual void button_press(int, int, unsigned);
62 virtual bool navigate(Navigation);
64 virtual void on_size_change();
65 virtual void on_style_change();
69 void list_autosize_changed();
71 void list_item_selected(unsigned);
72 void list_selection_cleared();