Move locale_convert into libdcp.
[dcpomatic.git] / src / wx / time_picker.cc
index a18182138af0be609e4136315d329333f80ef4d8..309e5c713b564cea157d8f772270786284e5b292 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "time_picker.h"
 #include "wx_util.h"
-#include "lib/raw_convert.h"
+#include <dcp/locale_convert.h>
 #include <wx/spinctrl.h>
 #include <boost/bind.hpp>
 #include <iomanip>
@@ -32,6 +32,7 @@ using std::max;
 using std::string;
 using std::cout;
 using boost::bind;
+using dcp::locale_convert;
 
 TimePicker::TimePicker (wxWindow* parent, wxDateTime time)
        : wxPanel (parent)
@@ -80,11 +81,8 @@ TimePicker::update_text ()
 
        _block_update = true;
 
-       _hours->SetValue (std_to_wx (raw_convert<string> (_hours_spin->GetValue ())));
-
-       locked_stringstream m;
-       m << setfill('0') << setw(2) << _minutes_spin->GetValue();
-       _minutes->SetValue (std_to_wx (m.str()));
+       _hours->SetValue (wxString::Format ("%d", _hours_spin->GetValue ()));
+       _minutes->SetValue (wxString::Format ("%02d", _minutes_spin->GetValue ()));
 
        _block_update = false;
 
@@ -99,8 +97,8 @@ TimePicker::update_spin ()
        }
 
        _block_update = true;
-       _hours_spin->SetValue (raw_convert<int> (wx_to_std (_hours->GetValue())));
-       _minutes_spin->SetValue (raw_convert<int> (wx_to_std (_minutes->GetValue())));
+       _hours_spin->SetValue (locale_convert<int> (wx_to_std (_hours->GetValue())));
+       _minutes_spin->SetValue (locale_convert<int> (wx_to_std (_minutes->GetValue())));
        _block_update = false;
 
        Changed ();