X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flist.h;h=56fe6aafd92ee5d2fd033eab45c045c2c724ebe4;hb=c1faa54a3218b53757b8b55de0ff8aa64412253b;hp=dee57ed55c98587182976bf5b338a5683b79f93c;hpb=8a0058b5b90bb7e9eacf1646142f4d73b426fd66;p=libs%2Fgltk.git diff --git a/source/list.h b/source/list.h index dee57ed..56fe6aa 100644 --- a/source/list.h +++ b/source/list.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspgltk -Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GLTK_LIST_H_ #define MSP_GLTK_LIST_H_ @@ -30,6 +23,8 @@ public: void item(const std::string &); }; + sigc::signal signal_item_selected; + private: std::vector items; int sel_index; @@ -42,9 +37,13 @@ private: VSlider slider; public: - sigc::signal signal_item_selected; + List(); + + virtual const char *get_class() const { return "list"; } - List(const Resources &); + virtual void autosize(); + void autosize_rows(unsigned); + void autosize_all(); void append(const std::string &); void insert(unsigned, const std::string &); @@ -56,16 +55,17 @@ public: const std::string &get_selected() const; int get_selected_index() const { return sel_index; } - virtual void button_press(int, int, unsigned); - private: - virtual const char *get_class() const { return "list"; } virtual void render_special(const Part &) const; +public: + virtual void button_press(int, int, unsigned); +private: virtual void on_geometry_change(); virtual void on_style_change(); + void reposition_slider(); - void recalculate_parameters(); + void check_view_range(); void slider_value_changed(double); };