wxWindow* parent,
T* wrapped,
int property,
- boost::function<boost::shared_ptr<S> (Content*)> part,
+ boost::function<std::shared_ptr<S> (Content*)> part,
boost::function<U (S*)> model_getter,
boost::function<void (S*, U)> model_setter,
boost::function<void ()> view_changed,
return _wrapped;
}
- typedef std::vector<boost::shared_ptr<Content> > List;
+ typedef std::vector<std::shared_ptr<Content> > List;
/** Set the content that this control is working on (i.e. the selected content) */
void set_content (List content)
}
/** Add this widget to a wxGridBagSizer */
- void add (wxGridBagSizer* sizer, wxGBPosition position, wxGBSpan span = wxDefaultSpan)
+ void add (wxGridBagSizer* sizer, wxGBPosition position, wxGBSpan span = wxDefaultSpan, int flag = 0)
{
_sizer = sizer;
_position = position;
_span = span;
- _sizer->Add (_wrapped, _position, _span);
+ _sizer->Add (_wrapped, _position, _span, flag);
}
/** Update the view from the model */
void button_clicked ()
{
U const v = boost::bind (_model_getter, _part(_content.front().get()).get())();
- for (typename List::iterator i = _content.begin (); i != _content.end(); ++i) {
- boost::bind (_model_setter, _part(i->get()).get(), v) ();
+ for (auto const& i: _content) {
+ boost::bind (_model_setter, _part(i.get()).get(), v)();
}
}
void model_changed (ChangeType type, int property)
{
- if (type == CHANGE_TYPE_DONE && property == _property && !_ignore_model_changes) {
+ if (type == ChangeType::DONE && property == _property && !_ignore_model_changes) {
update_from_model ();
}
}
wxButton* _button;
List _content;
int _property;
- boost::function<boost::shared_ptr<S> (Content *)> _part;
+ boost::function<std::shared_ptr<S> (Content *)> _part;
boost::function<U (S*)> _model_getter;
boost::function<void (S*, U)> _model_setter;
boost::function<void ()> _view_changed;
wxWindow* parent,
wxSpinCtrl* wrapped,
int property,
- boost::function<boost::shared_ptr<S> (Content *)> part,
+ boost::function<std::shared_ptr<S> (Content *)> part,
boost::function<int (S*)> getter,
boost::function<void (S*, int)> setter,
boost::function<void ()> view_changed = boost::function<void ()>()
wxWindow* parent,
wxSpinCtrlDouble* wrapped,
int property,
- boost::function<boost::shared_ptr<S> (Content *)> part,
+ boost::function<std::shared_ptr<S> (Content *)> part,
boost::function<double (S*)> getter,
boost::function<void (S*, double)> setter,
boost::function<void ()> view_changed = boost::function<void ()>()
wxWindow* parent,
wxChoice* wrapped,
int property,
- boost::function<boost::shared_ptr<S> (Content *)> part,
+ boost::function<std::shared_ptr<S> (Content *)> part,
boost::function<U (S*)> getter,
boost::function<void (S*, U)> setter,
boost::function<U (int)> view_to_model,