+// static
+wxString wxGenericProgressDialog::GetFormattedTime(unsigned long timeInSec)
+{
+ wxString timeAsHMS;
+
+ if ( timeInSec == (unsigned long)-1 )
+ {
+ timeAsHMS = _("Unknown");
+ }
+ else
+ {
+ unsigned hours = timeInSec / 3600;
+ unsigned minutes = (timeInSec % 3600) / 60;
+ unsigned seconds = timeInSec % 60;
+ timeAsHMS.Printf("%u:%02u:%02u", hours, minutes, seconds);
+ }
+
+ return timeAsHMS;
+}
+
+wxStaticText *
+wxGenericProgressDialog::CreateLabel(const wxString& text, wxSizer *sizer)
+{
+ wxStaticText *label = new wxStaticText(this, wxID_ANY, text);
+ wxStaticText *value = new wxStaticText(this, wxID_ANY, _("unknown"));
+
+ // select placement most native or nice on target GUI
+#if defined(__SMARTPHONE__)
+ // value and time to the left in two rows
+ sizer->Add(label, 1, wxALIGN_LEFT);
+ sizer->Add(value, 1, wxALIGN_LEFT);
+#elif defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMAC__) || defined(__WXGTK20__)
+ // value and time centered in one row
+ sizer->Add(label, 1, wxLARGESMALL(wxALIGN_RIGHT,wxALIGN_LEFT) | wxTOP | wxRIGHT, LAYOUT_MARGIN);
+ sizer->Add(value, 1, wxALIGN_LEFT | wxTOP, LAYOUT_MARGIN);
+#else
+ // value and time to the right in one row
+ sizer->Add(label);
+ sizer->Add(value, 0, wxLEFT, LAYOUT_MARGIN);
+#endif
+
+ return value;