25 #include <wx/translation.h>
31 if (timeSpan.IsNull())
35 if (timeSpan.GetHours() >= 1)
38 return timeSpan.Format(_(
"%H:%M h"));
43 if (timeSpan.GetSeconds() > 60)
46 return timeSpan.Format(_(
"%M:%S min"));
50 if (timeSpan.GetSeconds() < 1)
58 return timeSpan.Format(_(
"%S s"));
65 #include <wx/config.h>
70 wxConfigBase* config = wxConfigBase::Get();
74 wxDisplaySize(&dx, &dy);
80 const int w = config->Read(
"/" + basename +
"/width", -1l);
81 const int h = config->Read(
"/" + basename +
"/height", -1l);
84 frame->SetClientSize(w, h);
91 const int x = config->Read(
"/" + basename +
"/positionX", -1l);
92 const int y = config->Read(
"/" + basename +
"/positionY", -1l);
93 if (y >= 0 && x >= 0 && x < dx && y < dy)
102 const bool maximized = config->Read(
"/" + basename +
"/maximized", 0l) != 0;
110 const int w = config->Read(
"/" + basename +
"/width", -1l);
111 const int h = config->Read(
"/" + basename +
"/height", -1l);
112 if (w > 0 && w <= dx)
114 frame->SetClientSize(w, h);
121 const int x = config->Read(
"/" + basename +
"/positionX", -1l);
122 const int y = config->Read(
"/" + basename +
"/positionY", -1l);
123 if (y >= 0 && x >= 0 && x < dx && y < dy)
138 wxConfigBase* config = wxConfigBase::Get();
143 wxSize sz = frame->GetClientSize();
144 config->Write(
"/" + basename +
"/width", sz.GetWidth());
145 config->Write(
"/" + basename +
"/height", sz.GetHeight());
146 wxPoint ps = frame->GetPosition();
147 config->Write(
"/" + basename +
"/positionX", ps.x);
148 config->Write(
"/" + basename +
"/positionY", ps.y);
149 config->Write(
"/" + basename +
"/maximized", 0);
151 if ((!frame->IsMaximized()) && (!frame->IsIconized()))
153 const wxSize sz = frame->GetClientSize();
154 config->Write(
"/" + basename +
"/width", sz.GetWidth());
155 config->Write(
"/" + basename +
"/height", sz.GetHeight());
156 wxPoint ps = frame->GetPosition();
157 config->Write(
"/" + basename +
"/positionX", ps.x);
158 config->Write(
"/" + basename +
"/positionY", ps.y);
159 config->Write(
"/" + basename +
"/maximized", 0);
163 if (frame->IsMaximized())
165 config->Write(
"/" + basename +
"/maximized", 1l);
WXIMPEX wxString GetFormattedTimeSpan(const wxTimeSpan &timeSpan)
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)