diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-11-11 16:09:31 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-11-11 16:09:31 +0000 |
| commit | 329de46d6fb600c1958678ec5d09ef21532130d5 (patch) | |
| tree | e9311d45cd79ef86736479ee2b532bb6f9c13214 /src/wx/content_widget.h | |
| parent | 0d38c2e4042a521eb3fdcd0d715177eb1e5293fc (diff) | |
Add a couple of audio properties to the multi-select list.
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) { |
