- // VZ: I like the labels be centered - if the others don't mind, you may
- // remove "#ifdef __WXMSW__" and use it for all ports
-#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMAC__)
- c->left.SameAs(this, wxCentreX, LAYOUT_X_MARGIN);
-#else // !MSW
- c->right.SameAs(this, wxRight, 2*LAYOUT_X_MARGIN);
-#endif // MSW/!MSW
- c->top.Below(*lastWindow, LAYOUT_Y_MARGIN);
- c->width.AsIs();
- c->height.AsIs();
- label->SetConstraints(c);
-
- wxStaticText *dummy = new wxStaticText(this, wxID_ANY, text);
- c = new wxLayoutConstraints;
- c->right.LeftOf(label);
- c->top.SameAs(label, wxTop, 0);
- c->width.AsIs();
- c->height.AsIs();
- dummy->SetConstraints(c);
-
- *lastWindow = label;
-
- return label;
+ estimatedTime = m_display_estimated;
+ remainingTime = display_remaining;
+ }
+
+ elapsedTime = elapsed;
+}
+
+// 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;