X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flist.h;h=14d9eac291e3bb2b7daee7c9862a268108689182;hb=3f77f3542a6405fd832ababe48b950d1a65b00ed;hp=caf403a84a0f1b5ddaf39f8f0ce9e70a5ce71401;hpb=d75275638b2dfeb5e346c42ec2c4498da3671042;p=libs%2Fgltk.git diff --git a/source/list.h b/source/list.h index caf403a..14d9eac 100644 --- a/source/list.h +++ b/source/list.h @@ -17,7 +17,7 @@ to allow scrolling through a long list. class List: virtual public Widget, private Container { public: - class Loader: public Widget::Loader + class Loader: public DataFile::DerivedObjectLoader { public: Loader(List &); @@ -38,7 +38,7 @@ private: void item_added(unsigned); void item_removed(unsigned); void cleared(); - void refresh_strings(); + void refresh_item(unsigned); }; protected: @@ -47,7 +47,9 @@ protected: public: virtual const char *get_class() const { return "listitem"; } - virtual void autosize(); + protected: + virtual void autosize_special(const Part &, Geometry &); + public: void set_active(bool); virtual void render_special(const Part &, GL::Renderer &) const; @@ -76,6 +78,7 @@ private: int sel_index; unsigned first; unsigned max_scroll; + unsigned view_size; VSlider slider; std::vector items; @@ -90,10 +93,10 @@ public: virtual const char *get_class() const { return "list"; } - virtual void autosize(); - void autosize_rows(unsigned); - void autosize_all(); +private: + virtual void autosize_special(const Part &, Geometry &); +public: void set_data(ListData &); ListData &get_data() { return *data; } const ListData &get_data() const { return *data; } @@ -101,7 +104,10 @@ private: void items_changed(); protected: virtual Item *create_item(unsigned); + public: + void set_view_size(unsigned); + void set_view_all(); void set_selected_index(int); int get_selected_index() const { return sel_index; }