X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flist.h;h=1032db7e551229368ff57bc83ccb43e649cc9279;hb=754751fd474c6eac073fa7e89a18142fc89cb4fb;hp=caf403a84a0f1b5ddaf39f8f0ce9e70a5ce71401;hpb=d75275638b2dfeb5e346c42ec2c4498da3671042;p=libs%2Fgltk.git diff --git a/source/list.h b/source/list.h index caf403a..1032db7 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 &); @@ -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; }