diff options
Diffstat (limited to 'src/wx/content_widget.h')
| -rw-r--r-- | src/wx/content_widget.h | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/src/wx/content_widget.h b/src/wx/content_widget.h index 32fabda97..eb264eae9 100644 --- a/src/wx/content_widget.h +++ b/src/wx/content_widget.h @@ -87,6 +87,28 @@ public: _sizer->Add (_wrapped, _position); } + + void update_from_model () + { + if (_content.empty ()) { + set_single (); + return; + } + + typename List::iterator i = _content.begin (); + int const v = boost::bind (_getter, _content.front().get())(); + while (i != _content.end() && boost::bind (_getter, i->get())() == v) { + ++i; + } + + if (i == _content.end ()) { + set_single (); + checked_set (_wrapped, v); + } else { + set_multiple (); + } + } + private: void set_single () @@ -132,27 +154,6 @@ private: } } - void update_from_model () - { - if (_content.empty ()) { - set_single (); - return; - } - - typename List::iterator i = _content.begin (); - int const v = boost::bind (_getter, _content.front().get())(); - while (i != _content.end() && boost::bind (_getter, i->get())() == v) { - ++i; - } - - if (i == _content.end ()) { - set_single (); - checked_set (_wrapped, v); - } else { - set_multiple (); - } - } - void model_changed (int property) { if (property == _property && !_ignore_model_changes) { |
