{
///Ctor
- WxSimpleDlg::WxSimpleDlg(wxWindow *parent, wxString i_title)
+ WxSimpleDlg::WxSimpleDlg(wxWindow *parent,
+ wxString i_title,
+ const std::string i_namedescp ,
+ const std::string i_namedb)
: wxDialog(parent, -1,_T("DISPLAY IMAGES"), wxDefaultPosition, wxSize(230,150))
{
+ namedescp = i_namedescp;
+ namedb = i_namedb;
+
if(!i_title.empty())
{
this->SetTitle(i_title);
//////////////////////////////////////////////////////////////////////
void WxSimpleDlg::OnReadFile(wxCommandEvent& event)
{
- wxFileDialog* FD = new wxFileDialog( 0, _T("Select file"), _T(""), _T(""), crea::std2wx("*"), wxOPEN |wxFD_MULTIPLE, wxDefaultPosition);
+ int resultShowModal;
+ wxFileDialog* fileDlg = new wxFileDialog( 0, _T("Select file"), _T(""), _T(""), crea::std2wx("*"), wxOPEN |wxFD_MULTIPLE, wxDefaultPosition);
- if (FD->ShowModal()==wxID_OK)
+ resultShowModal = fileDlg->ShowModal();
+ if ( resultShowModal==wxID_OK )
{
wxArrayString wxArray;
- FD->GetPaths(wxArray);
+ fileDlg->GetPaths(wxArray);
if(wxArray.size() >0)
{
std::vector<std::string> files;
// TO DO WARNING MESSAGES
}
}
- Close();
+ SetReturnCode( resultShowModal );
+// Close();
+ EndModal( resultShowModal );
}
//////////////////////////////////////////////////////////////////////
void WxSimpleDlg::OnReadDirectory(wxCommandEvent &event)
{
+ int resultShowModal;
long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
- wxDirDialog* FD = new wxDirDialog( 0, _T("Select the directory to display"), _T(""), style);
+ wxDirDialog* dirDlg = new wxDirDialog( 0, _T("Select the directory to display"), _T(""), style);
- if (FD->ShowModal()==wxID_OK)
+ resultShowModal = dirDlg->ShowModal();
+ if ( resultShowModal==wxID_OK )
{
- if(! m_view.readDirectory(crea::wx2std(FD->GetPath()),m_results))
+ if(! m_view.readDirectory(crea::wx2std(dirDlg->GetPath()),m_results))
{
//TO DO WARNING MESSAGE;
}
}
- Close();
+ SetReturnCode( resultShowModal );
+// Close();
+ EndModal( resultShowModal );
}
//////////////////////////////////////////////////////////////////////
void WxSimpleDlg::OnReadGimmick(wxCommandEvent &event)
{
// Run Gimmick
- WxGimmickReaderDialog dlg(0,-1, "localdatabase_Descriptor.dscp",
- "Local Database", _T("Select image(s) - Gimmick! (c) CREATIS-LRMN 2008"),
+ WxGimmickReaderDialog dlg(0,-1,
+ namedescp,
+ namedb,
+ _T("Select image(s) - Gimmick! (c) CREATIS-LRMN 2008"),
wxDefaultPosition,
wxSize(810,750),
GIMMICK_2D_IMAGE_SELECTION,
dlg.GetSelectedImages(m_results,3);
dlg.OnExit();
}
- Close();
+ SetReturnCode( dlg.GetReturnCode() );
+// Close();
+ EndModal( dlg.GetReturnCode() );
}
//////////////////////////////////////////////////////////////////////