3 This file is part of libmspgltk
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GLTK_LIST_H_
9 #define MSP_GLTK_LIST_H_
11 #include <sigc++/signal.h>
20 Shows a list of items, allowing the user to select one. A slider is included
21 to allow scrolling through a long list.
23 class List: public Widget
26 class Loader: public Widget::Loader
31 void item(const std::string &);
35 std::vector<std::string> items;
40 const Part *items_part;
46 sigc::signal<void, unsigned, const std::string &> signal_item_selected;
48 List(const Resources &);
49 void append(const std::string &);
50 void insert(unsigned, const std::string &);
51 void remove(unsigned);
54 const std::string &get_selected() const;
55 int get_selected_index() const { return sel_index; }
57 virtual void button_press(int, int, unsigned);
58 virtual void button_release(int, int, unsigned);
59 virtual void pointer_motion(int, int);
62 virtual const char *get_class() const { return "list"; }
63 virtual void render_special(const Part &) const;
65 virtual void on_geometry_change();
66 virtual void on_style_change();
67 void reposition_slider();
68 void recalculate_parameters();
69 void slider_value_changed(double);