43 #include <wx/cmdline.h>
52 wxXmlResource::Get()->LoadDialog(
this, parent, wxT(
"hdrmerge_options_dialog"));
55 wxIconBundle myIcons(
huginApp::Get()->GetXRCPath() + wxT(
"data/hugin.ico"),wxBITMAP_TYPE_ICO);
58 wxIcon myIcon(
huginApp::Get()->GetXRCPath() + wxT(
"data/hugin.png"),wxBITMAP_TYPE_PNG);
62 m_mode=XRCCTRL(*
this,
"hdrmerge_option_mode",wxChoice);
63 m_panel_avg=XRCCTRL(*
this,
"hdrmerge_option_panel_avg",wxPanel);
64 m_panel_avgslow=XRCCTRL(*
this,
"hdrmerge_option_panel_avgslow",wxPanel);
65 m_panel_khan=XRCCTRL(*
this,
"hdrmerge_option_panel_khan",wxPanel);
66 m_option_c=XRCCTRL(*
this,
"hdrmerge_option_c",wxCheckBox);
67 m_khan_iter=XRCCTRL(*
this,
"hdrmerge_option_khan_iter",wxSpinCtrl);
68 m_khan_iter->SetRange(1,100);
69 m_khan_sigma=XRCCTRL(*
this,
"hdrmerge_option_khan_sigma",wxTextCtrl);
70 m_option_khan_af=XRCCTRL(*
this,
"hdrmerge_option_khan_af",wxCheckBox);
71 m_option_khan_ag=XRCCTRL(*
this,
"hdrmerge_option_khan_ag",wxCheckBox);
72 m_option_khan_am=XRCCTRL(*
this,
"hdrmerge_option_khan_am",wxCheckBox);
73 this->CenterOnParent();
83 static const wxCmdLineEntryDesc cmdLineDesc[] =
85 { wxCMD_LINE_OPTION,
"m", NULL, NULL, wxCMD_LINE_VAL_STRING },
86 { wxCMD_LINE_SWITCH,
"c", NULL, NULL},
87 { wxCMD_LINE_OPTION,
"i", NULL, NULL, wxCMD_LINE_VAL_NUMBER },
88 { wxCMD_LINE_OPTION,
"s", NULL, NULL, wxCMD_LINE_VAL_STRING },
89 { wxCMD_LINE_OPTION,
"a", NULL, NULL, wxCMD_LINE_VAL_STRING },
92 wxCmdLineParser parser;
93 parser.SetDesc(cmdLineDesc);
94 parser.SetCmdLine(
m_cmd);
97 if(parser.Found(wxT(
"m"),¶m))
99 if(param.CmpNoCase(wxT(
"avg_slow"))==0)
103 if(param.CmpNoCase(wxT(
"khan"))==0)
113 if(parser.Found(wxT(
"i"),&i))
117 if(parser.Found(wxT(
"s"),¶m))
120 char * p = setlocale(LC_NUMERIC,NULL);
121 char * old_locale = strdup(p);
122 setlocale(LC_NUMERIC,
"C");
124 param.ToDouble(&sigma);
126 setlocale(LC_NUMERIC,old_locale);
129 m_khan_sigma->SetValue(wxString::Format(wxT(
"%.2f"),sigma));
133 if(parser.Found(wxT(
"a"),¶m))
139 wxCommandEvent dummy;
145 int selection=
m_mode->GetSelection();
147 bool correct_input=
true;
149 wxString errorstring(_(
"Invalid input\n"));
153 m_cmd.Append(wxT(
"-m avg"));
155 m_cmd.Append(wxT(
" -c"));
158 m_cmd.Append(wxT(
"-m avg_slow"));
161 m_cmd.Append(wxT(
"-m khan"));
169 errorstring.Append(wxString::Format(_(
"Input \"%s\" for %s is not a valid number\n"),
175 char * p = setlocale(LC_NUMERIC,NULL);
176 char * old_locale = strdup(p);
177 setlocale(LC_NUMERIC,
"C");
178 m_cmd.Append(wxString::Format(wxT(
" -s %f"),i));
180 setlocale(LC_NUMERIC,old_locale);
186 errorstring.Append(wxString::Format(_(
"Input \"%s\" for %s is not a valid number\n"),
192 m_cmd.Append(wxT(
" -a "));
194 m_cmd.Append(wxT(
"f"));
196 m_cmd.Append(wxT(
"g"));
198 m_cmd.Append(wxT(
"m"));
203 wxMessageBox(errorstring,_(
"Wrong input"),wxOK | wxICON_INFORMATION);
204 return correct_input;
209 int selection=
m_mode->GetSelection();
213 GetSizer()->Fit(
this);
219 this->EndModal(wxOK);
Dialog for reset panorama settings.
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
static huginApp * Get()
hack.. kind of a pseudo singleton...
Definition of dialog for hdrmerge options.
void OnModeChanged(wxCommandEvent &e)
event handler when user selected different mode, refresh advanced option display
#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