+ public:
+ TypedItemFactory(const ListData &d)
+ { set_data(d); }
+
+ void set_data(const ListData &d) override
+ {
+ if(const ListDataStore<ValueType> *ds = dynamic_cast<const ListDataStore<ValueType> *>(&d))
+ data = ds;
+ else
+ throw incompatible_data(typeid(ValueType));
+ }
+
+ Item *create_item(std::size_t i) const override
+ {
+ return new I(data->get(i));
+ }
+ };
+
+ struct Row
+ {
+ std::size_t first;
+ unsigned height;
+
+ Row(std::size_t f): first(f), height(0) { }
+ };
+
+public:
+ sigc::signal<void, std::size_t> signal_item_selected;
+ sigc::signal<void> signal_selection_cleared;
+
+private:
+ ListData *data = nullptr;
+ bool own_data = false;
+ DataObserver *observer = nullptr;
+ ItemFactory *item_factory = nullptr;
+ ViewMode view_mode = LIST;
+ std::size_t sel_index = INVALID_INDEX;
+ std::size_t focus_index = INVALID_INDEX;
+ std::size_t first_row = 0;
+ std::size_t max_scroll = 0;
+ unsigned view_rows = 5;
+ unsigned view_columns = 5;
+ const Part *items_part = nullptr;
+ bool ignore_slider_change = false;
+ bool dragging = false;
+ int drag_start_x = 0;
+ int drag_start_y = 0;