diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-09-23 01:34:15 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-09-23 01:34:15 +0100 |
| commit | 69e46a5803c9c015f3da4153340b3d4554deea2e (patch) | |
| tree | edae6849bb2523c3d688100def95e7671aa320e6 /src/wx/wx_util.cc | |
| parent | dc9e313384e77a2cad31f40b87b42b7378e9be36 (diff) | |
Add checked_set for wxDirPickerCtrl.
Diffstat (limited to 'src/wx/wx_util.cc')
| -rw-r--r-- | src/wx/wx_util.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 7edcabf40..91fd42624 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -30,6 +30,7 @@ #include <dcp/locale_convert.h> #include <wx/spinctrl.h> #include <wx/splash.h> +#include <wx/filepicker.h> #include <boost/thread.hpp> using namespace std; @@ -196,6 +197,20 @@ checked_set (FilePickerCtrl* widget, boost::filesystem::path value) } void +checked_set (wxDirPickerCtrl* widget, boost::filesystem::path value) +{ + if (widget->GetPath() != std_to_wx (value.string())) { + if (value.empty()) { + /* Hack to make wxWidgets clear the control when we are passed + an empty value. + */ + value = " "; + } + widget->SetPath (std_to_wx (value.string())); + } +} + +void checked_set (wxSpinCtrl* widget, int value) { if (widget->GetValue() != value) { |
