43 #include <wx/cmdline.h>
47 wxXmlResource::Get()->LoadDialog(
this, parent, wxT(
"hdrmerge_options_dialog"));
49 m_mode=XRCCTRL(*
this,
"hdrmerge_option_mode",wxChoice);
51 m_panel_avg=XRCCTRL(*
this,
"hdrmerge_option_panel_avg",wxPanel);
53 m_panel_khan=XRCCTRL(*
this,
"hdrmerge_option_panel_khan",wxPanel);
54 m_option_c=XRCCTRL(*
this,
"hdrmerge_option_c",wxCheckBox);
55 m_khan_iter=XRCCTRL(*
this,
"hdrmerge_option_khan_iter",wxSpinCtrl);
57 m_khan_sigma=XRCCTRL(*
this,
"hdrmerge_option_khan_sigma",wxTextCtrl);
61 this->CenterOnParent();
72 static const wxCmdLineEntryDesc cmdLineDesc[] =
74 { wxCMD_LINE_OPTION,
"m", NULL, NULL, wxCMD_LINE_VAL_STRING },
75 { wxCMD_LINE_SWITCH,
"c", NULL, NULL},
76 { wxCMD_LINE_OPTION,
"i", NULL, NULL, wxCMD_LINE_VAL_NUMBER },
77 { wxCMD_LINE_OPTION,
"s", NULL, NULL, wxCMD_LINE_VAL_STRING },
78 { wxCMD_LINE_OPTION,
"a", NULL, NULL, wxCMD_LINE_VAL_STRING },
81 wxCmdLineParser parser;
82 parser.SetDesc(cmdLineDesc);
83 parser.SetCmdLine(
m_cmd);
86 if(parser.Found(wxT(
"m"),¶m))
88 if(param.CmpNoCase(wxT(
"avg_slow"))==0)
92 if(param.CmpNoCase(wxT(
"khan"))==0)
102 if(parser.Found(wxT(
"i"),&i))
106 if(parser.Found(wxT(
"s"),¶m))
109 char * p = setlocale(LC_NUMERIC,NULL);
110 char * old_locale = strdup(p);
111 setlocale(LC_NUMERIC,
"C");
113 param.ToDouble(&sigma);
115 setlocale(LC_NUMERIC,old_locale);
118 m_khan_sigma->SetValue(wxString::Format(wxT(
"%.2f"),sigma));
122 if(parser.Found(wxT(
"a"),¶m))
128 wxCommandEvent dummy;
134 int selection=
m_mode->GetSelection();
136 bool correct_input=
true;
138 wxString errorstring(_(
"Invalid input\n"));
142 m_cmd.Append(wxT(
"-m avg"));
144 m_cmd.Append(wxT(
" -c"));
147 m_cmd.Append(wxT(
"-m avg_slow"));
150 m_cmd.Append(wxT(
"-m khan"));
158 errorstring.Append(wxString::Format(_(
"Input \"%s\" for %s is not a valid number\n"),
164 char * p = setlocale(LC_NUMERIC,NULL);
165 char * old_locale = strdup(p);
166 setlocale(LC_NUMERIC,
"C");
167 m_cmd.Append(wxString::Format(wxT(
" -s %f"),i));
169 setlocale(LC_NUMERIC,old_locale);
175 errorstring.Append(wxString::Format(_(
"Input \"%s\" for %s is not a valid number\n"),
181 m_cmd.Append(wxT(
" -a "));
183 m_cmd.Append(wxT(
"f"));
185 m_cmd.Append(wxT(
"g"));
187 m_cmd.Append(wxT(
"m"));
192 wxMessageBox(errorstring,_(
"Wrong input"),wxOK | wxICON_INFORMATION);
193 return correct_input;
198 int selection=
m_mode->GetSelection();
202 GetSizer()->Fit(
this);
208 this->EndModal(wxOK);
void SetCommandLineArgument(wxString cmd)
sets the currents state of the hdrmerge options
bool BuildCommandLineArgument()
include file for the hugin project
wxCheckBox * m_option_khan_af
wxPanel * m_panel_avgslow
Definition of dialog for hdrmerge options.
void OnModeChanged(wxCommandEvent &e)
event handler when user selected different mode, refresh advanced option display
HDRMergeOptionsDialog(wxWindow *parent)
Constructor, read from xrc ressource.
#define HUGIN_HDRMERGE_ARGS
wxCheckBox * m_option_khan_ag
include file for the hugin project
void OnOk(wxCommandEvent &e)
check inputs
wxCheckBox * m_option_khan_am
wxTextCtrl * m_khan_sigma