44 #include <wx/cmdline.h>
48 wxXmlResource::Get()->LoadDialog(
this, parent,
"hdrmerge_options_dialog");
50 m_mode=XRCCTRL(*
this,
"hdrmerge_option_mode",wxChoice);
52 m_panel_avg=XRCCTRL(*
this,
"hdrmerge_option_panel_avg",wxPanel);
54 m_panel_khan=XRCCTRL(*
this,
"hdrmerge_option_panel_khan",wxPanel);
55 m_option_c=XRCCTRL(*
this,
"hdrmerge_option_c",wxCheckBox);
56 m_khan_iter=XRCCTRL(*
this,
"hdrmerge_option_khan_iter",wxSpinCtrl);
58 m_khan_sigma=XRCCTRL(*
this,
"hdrmerge_option_khan_sigma",wxTextCtrl);
62 this->CenterOnParent();
73 static const wxCmdLineEntryDesc cmdLineDesc[] =
75 { wxCMD_LINE_OPTION,
"m", NULL, NULL, wxCMD_LINE_VAL_STRING },
76 { wxCMD_LINE_SWITCH,
"c", NULL, NULL},
77 { wxCMD_LINE_OPTION,
"i", NULL, NULL, wxCMD_LINE_VAL_NUMBER },
78 { wxCMD_LINE_OPTION,
"s", NULL, NULL, wxCMD_LINE_VAL_STRING },
79 { wxCMD_LINE_OPTION,
"a", NULL, NULL, wxCMD_LINE_VAL_STRING },
82 wxCmdLineParser parser;
83 parser.SetDesc(cmdLineDesc);
84 parser.SetCmdLine(
m_cmd);
87 if(parser.Found(
"m",¶m))
89 if(param.CmpNoCase(
"avg_slow")==0)
93 if(param.CmpNoCase(
"khan")==0)
103 if(parser.Found(
"i",&i))
107 if(parser.Found(
"s",¶m))
110 char * p = setlocale(LC_NUMERIC,NULL);
111 char * old_locale = strdup(p);
112 setlocale(LC_NUMERIC,
"C");
114 param.ToDouble(&sigma);
116 setlocale(LC_NUMERIC,old_locale);
123 if(parser.Found(
"a",¶m))
129 wxCommandEvent dummy;
135 int selection=
m_mode->GetSelection();
137 bool correct_input=
true;
139 wxString errorstring(_(
"Invalid input\n"));
143 m_cmd.Append(
"-m avg");
148 m_cmd.Append(
"-m avg_slow");
151 m_cmd.Append(
"-m khan");
159 errorstring.Append(wxString::Format(_(
"Input \"%s\" for %s is not a valid number\n"),
165 char * p = setlocale(LC_NUMERIC,NULL);
166 char * old_locale = strdup(p);
167 setlocale(LC_NUMERIC,
"C");
168 m_cmd.Append(wxString::Format(
" -s %f",i));
170 setlocale(LC_NUMERIC,old_locale);
176 errorstring.Append(wxString::Format(_(
"Input \"%s\" for %s is not a valid number\n"),
182 m_cmd.Append(
" -a ");
194 return correct_input;
199 int selection=
m_mode->GetSelection();
203 GetSizer()->Fit(
this);
209 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
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)