25#include <wx/translation.h>
82 const bool maximized =
config->Read(
"/" + basename +
"/maximized", 0l) != 0;
92 const int w =
config->Read(
"/" + basename +
"/width", -1l);
93 const int h =
config->Read(
"/" + basename +
"/height", -1l);
96 frame->SetClientSize(
w, h);
116 config->Write(
"/" + basename +
"/maximized", 1l);
117 config->DeleteEntry(
"/" + basename +
"/width");
118 config->DeleteEntry(
"/" + basename +
"/height");
119 config->DeleteEntry(
"/" + basename +
"/positionX");
120 config->DeleteEntry(
"/" + basename +
"/positionY");
124 if (!frame->IsIconized())
127 config->Write(
"/" + basename +
"/width",
sz.GetWidth());
128 config->Write(
"/" + basename +
"/height",
sz.GetHeight());
130 config->Write(
"/" + basename +
"/positionX",
ps.x);
131 config->Write(
"/" + basename +
"/positionY",
ps.y);
135 config->DeleteEntry(
"/" + basename +
"/width");
136 config->DeleteEntry(
"/" + basename +
"/height");
137 config->DeleteEntry(
"/" + basename +
"/positionX");
138 config->DeleteEntry(
"/" + basename +
"/positionY");
140 config->Write(
"/" + basename +
"/maximized", 0l);
151 const int x =
config->Read(
"/" + basename +
"/positionX", -1l);
152 const int y =
config->Read(
"/" + basename +
"/positionY", -1l);
153 if (y >= 0 && x >= 0 && x < dx && y < dy)
167 config->Write(
"/" + basename +
"/positionX",
ps.x);
168 config->Write(
"/" + basename +
"/positionY",
ps.y);
172#include <wx/msgdlg.h>
173#include <wx/settings.h>
179 if (wxSystemSettings::GetAppearance().
IsDark())
185 switch (
dlg.ShowModal())
215 if (wxSystemSettings::GetAppearance().
IsDark())
235 if (
HuginMessageBox(wxString::Format(
_(
"File %s already exists.\nShould this file overwritten?"), filename),
DisableWindow(wxWindow *window)
namespace for various utils
void StoreFramePositionOnly(wxTopLevelWindow *frame, const wxString &basename)
WXIMPEX wxString GetFormattedTimeSpan(const wxTimeSpan &timeSpan)
bool AskUserOverwrite(const wxString &filename, const wxString &caption, wxWindow *parent)
ask user if the given file should be overwritten, return true if the user confirmed the overwritting
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
void RestoreFramePositionOnly(wxTopLevelWindow *frame, const wxString &basename)
std::unique_ptr< wxMessageDialogBase > MessageDialog
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
MessageDialog GetMessageDialog(const wxString &message, const wxString &caption, int style, wxWindow *parent)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.