32#include "../View/view.h"
33#include "scroll_view.h"
37 class ListBoxViewImpl;
45 void set_items(
const std::vector<std::shared_ptr<View>> &items);
48 void set_items(
const std::vector<T> &items,
const std::function<std::shared_ptr<View>(
const T &item)> &map_function)
50 std::vector<std::shared_ptr<View>> views;
51 views.reserve(items.size());
52 for (
const auto &item : items)
54 views.push_back(map_function(item));
67 std::unique_ptr<ListBoxViewImpl> impl;
70 bool needScrollToSelected =
false;
2D Graphics Canvas
Definition: canvas.h:72
Definition: listbox_view.h:40
std::function< void()> & func_selection_changed()
int selected_item() const
void set_items(const std::vector< std::shared_ptr< View > > &items)
void set_selected_item(int index)
void set_items(const std::vector< T > &items, const std::function< std::shared_ptr< View >(const T &item)> &map_function)
Definition: listbox_view.h:48
void layout_children(Canvas &canvas) override
Sets the view geometry for all children of this view.