1 #ifndef MSP_GLTK_LIST_H_
2 #define MSP_GLTK_LIST_H_
4 #include <sigc++/signal.h>
13 Shows a list of items, allowing the user to select one. A slider is included
14 to allow scrolling through a long list.
16 class List: virtual public Widget, private Container
19 class Loader: public Widget::Loader
24 void item(const std::string &);
28 /// This exists to make disconnecting signals easier
29 class DataObserver: public sigc::trackable
37 void item_added(unsigned);
38 void item_removed(unsigned);
40 void refresh_strings();
44 sigc::signal<void, unsigned> signal_item_selected;
49 DataObserver *observer;
55 const Part *items_part;
67 virtual const char *get_class() const { return "list"; }
69 virtual void autosize();
70 void autosize_rows(unsigned);
73 void set_data(ListData &);
74 ListData &get_data() { return *data; }
75 const ListData &get_data() const { return *data; }
80 void set_selected_index(int);
81 int get_selected_index() const { return sel_index; }
84 virtual void rebuild_special(const Part &, CachedPart &);
85 virtual void render_special(const Part &, GL::Renderer &) const;
88 virtual void button_press(int, int, unsigned);
90 virtual void on_geometry_change();
91 virtual void on_style_change();
93 void reposition_slider();
94 void check_view_range();
95 void slider_value_changed(double);