#include <creaImageIOWxOutputDlg.h>
Public Member Functions | |
WxOutputDlg (wxWindow *parent, const std::vector< std::string > filenames, int i_dim, bool single) | |
CTor. | |
~WxOutputDlg () | |
DTor. | |
const std::string | getAsking () |
Get selected storage. | |
const std::string | getDim () |
Private Member Functions | |
void | OnOk (wxCommandEvent &event) |
Validate selected storage. | |
void | OnChange (wxCommandEvent &event) |
Private Attributes | |
std::vector< wxCheckBox * > | checkOut |
wxCheckBox * | checkAsking |
WxOutputDlg allows to select the different output format
Definition at line 18 of file creaImageIOWxOutputDlg.h.
creaImageIO::WxOutputDlg::WxOutputDlg | ( | wxWindow * | parent, | |
const std::vector< std::string > | filenames, | |||
int | i_dim, | |||
bool | single | |||
) |
CTor.
Definition at line 6 of file creaImageIOWxOutputDlg.cpp.
References checkAsking, checkOut, OnChange(), and OnOk().
: wxDialog(parent, -1,_T("OUTPUT FORMAT"), wxDefaultPosition, wxSize(350,450)) { int size = filenames.size(); int deflt = 1; std::string sentence; sentence = "You select"; std::string sentence2 = "You have the possibility to select output format :"; int nbsent= 0; std::vector<std::string> outsentences; if (size == 1) { sentence += " 1 "; } else { sentence += " n "; } if(single) { sentence += " single frames"; } else { sentence += " multi-frames"; } sentence += " as output"; if (size == 1) { if(single) { outsentences.push_back("It shall be a single file with a single 2D frmae"); } else { outsentences.push_back("It shall be multiple files with 2D frames"); outsentences.push_back("It shall be a single file with 3D frames"); } } else { if(single) { outsentences.push_back("It shall be a single file with 3D frames"); outsentences.push_back("It shall be multiple files with 2D frames"); } else { outsentences.push_back("It shall be a single file with (3D+t) frames"); outsentences.push_back("It shall be multiple (n+t) files with 2D frames"); outsentences.push_back("It shall be multiple (n) files with (2D+t) frames"); outsentences.push_back("It shall be a multiple (t) files with (2D+n) frames"); deflt = 3; } } if(i_dim != -1) { deflt = i_dim; } int start_point = 45; wxStaticText * ExportText=new wxStaticText(this,-1,crea::std2wx(sentence), wxPoint(5,10)); std::vector<std::string>::iterator it = outsentences.begin(); for(int i = 0;it != outsentences.end(); it++, i++, start_point += 45) { wxCheckBox *check = new wxCheckBox(this, -1, crea::std2wx((*it)), wxPoint(5,start_point) ); if(i == deflt) check->SetValue(true); else check->SetValue(false); Connect( check->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxOutputDlg::OnChange ); checkOut.push_back(check); } checkAsking = new wxCheckBox(this, -1, _T("Do you want to save this output and no more asking"), wxPoint(5,start_point) ); // VALIDATION BUTTON wxButton *Ok = new wxButton(this, -1,_T("OK"), wxPoint(5,start_point+20) ); Connect( Ok->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxOutputDlg::OnOk ); wxButton *Cancel = new wxButton(this, wxID_CANCEL,_T("CANCEL"), wxPoint(100,start_point+20) ); Layout(); }
creaImageIO::WxOutputDlg::~WxOutputDlg | ( | ) |
const std::string creaImageIO::WxOutputDlg::getAsking | ( | ) |
Get selected storage.
Definition at line 140 of file creaImageIOWxOutputDlg.cpp.
References checkAsking.
{ if(checkAsking->GetValue()) return "false"; else return "true"; }
const std::string creaImageIO::WxOutputDlg::getDim | ( | ) |
Definition at line 123 of file creaImageIOWxOutputDlg.cpp.
References checkOut.
void creaImageIO::WxOutputDlg::OnChange | ( | wxCommandEvent & | event | ) | [private] |
Definition at line 107 of file creaImageIOWxOutputDlg.cpp.
References checkOut.
Referenced by WxOutputDlg().
{ std::vector<wxCheckBox*>::iterator it = checkOut.begin(); for(int i = 0;it != checkOut.end(); it++, i++) { if( (*it)->GetId() == event.GetId()) { } else { (*it)->SetValue(false); } } }
void creaImageIO::WxOutputDlg::OnOk | ( | wxCommandEvent & | event | ) | [private] |
Validate selected storage.
Definition at line 101 of file creaImageIOWxOutputDlg.cpp.
Referenced by WxOutputDlg().
{ Close(); SetReturnCode(wxID_OK); }
wxCheckBox* creaImageIO::WxOutputDlg::checkAsking [private] |
Definition at line 38 of file creaImageIOWxOutputDlg.h.
Referenced by getAsking(), and WxOutputDlg().
std::vector<wxCheckBox*> creaImageIO::WxOutputDlg::checkOut [private] |
Definition at line 35 of file creaImageIOWxOutputDlg.h.
Referenced by getDim(), OnChange(), and WxOutputDlg().