1 #include <creaImageIOWxOutputDlg.h>
6 WxOutputDlg::WxOutputDlg(wxWindow *parent, const std::vector<std::string> filenames, int i_dim, bool single)
7 : wxDialog(parent, -1,_T("OUTPUT FORMAT"), wxDefaultPosition, wxSize(350,450))
10 int size = filenames.size();
15 sentence = "You select";
16 std::string sentence2 = "You have the possibility to select output format :";
18 std::vector<std::string> outsentences;
29 sentence += " single frames";
33 sentence += " multi-frames";
35 sentence += " as output";
42 outsentences.push_back("It shall be a single file with a single 2D frmae");
46 outsentences.push_back("It shall be multiple files with 2D frames");
47 outsentences.push_back("It shall be a single file with 3D frames");
54 outsentences.push_back("It shall be a single file with 3D frames");
55 outsentences.push_back("It shall be multiple files with 2D frames");
59 outsentences.push_back("It shall be a single file with (3D+t) frames");
60 outsentences.push_back("It shall be multiple (n+t) files with 2D frames");
61 outsentences.push_back("It shall be multiple (n) files with (2D+t) frames");
62 outsentences.push_back("It shall be a multiple (t) files with (2D+n) frames");
74 wxStaticText * ExportText=new wxStaticText(this,-1,crea::std2wx(sentence), wxPoint(5,10));
76 std::vector<std::string>::iterator it = outsentences.begin();
77 for(int i = 0;it != outsentences.end(); it++, i++, start_point += 45)
79 wxCheckBox *check = new wxCheckBox(this, -1, crea::std2wx((*it)), wxPoint(5,start_point) );
81 check->SetValue(true);
83 check->SetValue(false);
84 Connect( check->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxOutputDlg::OnChange );
85 checkOut.push_back(check);
88 checkAsking = new wxCheckBox(this, -1, _T("Do you want to save this output and no more asking"), wxPoint(5,start_point) );
91 wxButton *Ok = new wxButton(this, -1,_T("OK"), wxPoint(5,start_point+20) );
92 Connect( Ok->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxOutputDlg::OnOk );
94 wxButton *Cancel = new wxButton(this, wxID_CANCEL,_T("CANCEL"), wxPoint(100,start_point+20) );
99 WxOutputDlg::~WxOutputDlg(){}
101 void WxOutputDlg::OnOk(wxCommandEvent &event)
104 SetReturnCode(wxID_OK);
107 void WxOutputDlg::OnChange(wxCommandEvent& event)
109 std::vector<wxCheckBox*>::iterator it = checkOut.begin();
111 for(int i = 0;it != checkOut.end(); it++, i++)
113 if( (*it)->GetId() == event.GetId())
118 (*it)->SetValue(false);
123 const std::string WxOutputDlg::getDim()
126 std::vector<wxCheckBox*>::iterator it = checkOut.begin();
127 for(int i = 1;it != checkOut.end(); it++, i++)
129 if( (*it)->GetValue() )
131 sprintf(res,"%d", i);
140 const std::string WxOutputDlg::getAsking()
142 if(checkAsking->GetValue())