#include "dcpomatic_button.h"
#include <wx/wx.h>
#include <wx/listctrl.h>
-#include <boost/function.hpp>
#include <vector>
class EditableListColumn
EditableList (
wxWindow* parent,
std::vector<EditableListColumn> columns,
- boost::function<std::vector<T> ()> get,
- boost::function<void (std::vector<T>)> set,
- boost::function<std::string (T, int)> column,
+ std::function<std::vector<T> ()> get,
+ std::function<void (std::vector<T>)> set,
+ std::function<std::string (T, int)> column,
bool can_edit = true,
bool title = true
)
}
int total_width = 0;
- BOOST_FOREACH (EditableListColumn i, _columns) {
+ for (auto i: _columns) {
total_width += i.width.get_value_or (_default_width);
}
#endif
int j = 0;
- BOOST_FOREACH (EditableListColumn i, _columns) {
+ for (auto i: _columns) {
wxListItem ip;
ip.SetId (j);
ip.SetText (i.name);
int fixed_width = 0;
int growable = 0;
int j = 0;
- BOOST_FOREACH (EditableListColumn i, _columns) {
+ for (auto i: _columns) {
fixed_width += i.width.get_value_or (_default_width);
if (!i.growable) {
_list->SetColumnWidth (j, i.width.get_value_or(_default_width));
}
j = 0;
- BOOST_FOREACH (EditableListColumn i, _columns) {
+ for (auto i: _columns) {
if (i.growable) {
_list->SetColumnWidth (j, i.width.get_value_or(_default_width) + (w - fixed_width) / growable);
}
ev.Skip ();
}
- boost::function <std::vector<T> ()> _get;
- boost::function <void (std::vector<T>)> _set;
+ std::function <std::vector<T> ()> _get;
+ std::function <void (std::vector<T>)> _set;
std::vector<EditableListColumn> _columns;
- boost::function<std::string (T, int)> _column;
+ std::function<std::string (T, int)> _column;
wxButton* _add;
wxButton* _edit;