1 #ifndef MSP_GLTK_LIST_H_
2 #define MSP_GLTK_LIST_H_
4 #include <sigc++/signal.h>
12 Shows a list of items, allowing the user to select one. A slider is included
13 to allow scrolling through a long list.
15 class List: virtual public Widget, private Container
18 class Loader: public Widget::Loader
23 void item(const std::string &);
26 sigc::signal<void, unsigned, const std::string &> signal_item_selected;
29 std::vector<std::string> items;
35 const Part *items_part;
42 virtual const char *get_class() const { return "list"; }
44 virtual void autosize();
45 void autosize_rows(unsigned);
48 void append(const std::string &);
49 void insert(unsigned, const std::string &);
50 void remove(unsigned);
52 unsigned get_n_items() const { return items.size(); }
54 void set_selected_index(int);
55 const std::string &get_selected() const;
56 int get_selected_index() const { return sel_index; }
59 virtual void render_special(const Part &) const;
62 virtual void button_press(int, int, unsigned);
64 virtual void on_geometry_change();
65 virtual void on_style_change();
67 void reposition_slider();
68 void check_view_range();
69 void slider_value_changed(double);