diff options
Diffstat (limited to 'src/wx/wx_util.cc')
| -rw-r--r-- | src/wx/wx_util.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index cd3d39c67..a46ba98e2 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -180,6 +180,29 @@ checked_set (wxChoice* widget, string value) } void +checked_set (wxChoice* widget, vector<pair<string, string> > items) +{ + vector<pair<string, string> > current; + for (unsigned int i = 0; i < widget->GetCount(); ++i) { + current.push_back ( + make_pair ( + wx_to_std (widget->GetString (i)), + string_client_data (widget->GetClientObject (i)) + ) + ); + } + + if (current == items) { + return; + } + + widget->Clear (); + for (vector<pair<string, string> >::const_iterator i = items.begin(); i != items.end(); ++i) { + widget->Append (std_to_wx (i->first), new wxStringClientData (std_to_wx (i->second))); + } +} + +void checked_set (wxTextCtrl* widget, string value) { if (widget->GetValue() != std_to_wx (value)) { @@ -188,6 +211,14 @@ checked_set (wxTextCtrl* widget, string value) } void +checked_set (wxTextCtrl* widget, wxString value) +{ + if (widget->GetValue() != value) { + widget->ChangeValue (value); + } +} + +void checked_set (wxStaticText* widget, string value) { if (widget->GetLabel() != std_to_wx (value)) { |
