- template <typename TImage>
- void WxISimpleDlg<TImage>::OnReadDirectory(wxCommandEvent &event)
- {
- int resultShowModal;
- bool bvalid = false;
- long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
- wxDirDialog* dirDlg = new wxDirDialog( 0, _T("Select the directory to display"), _T(""), style);
-
- resultShowModal = dirDlg->ShowModal();
- if ( resultShowModal==wxID_OK )
- {
- std::string path = crea::wx2std(dirDlg->GetPath());
- typedef boost::filesystem::directory_iterator dir_it;
- dir_it itr(path);
- dir_it end_itr;
- /*if (boost::filesystem::exists(path))
- {*/
- for(;itr != end_itr; ++itr)
- {
- bvalid = m_exts.size() == 0? true : false;
- std::vector<std::string>::iterator it = m_exts.begin();
- std::string ext = itr->filename().substr(itr->filename().find_last_of("."));
- for(; it != m_exts.end(); it++)
- {
- if(ext == (*it) )
- {
- bvalid = true;
- break;
- }
- }
- if (!boost::filesystem::is_directory(itr->status()) && bvalid)
- {
- readImg(itr->string().c_str());
- }
- }
- }
- SetReturnCode( resultShowModal );
-// Close();
- EndModal( resultShowModal );
- }
+// //
+//////////////////////////////////////////////////////////////////////
+ template <typename TImage>
+ void WxISimpleDlg<TImage>::OnReadDirectory(wxCommandEvent &event)
+ {
+ int resultShowModal;
+ bool bvalid = false;
+ long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
+ wxDirDialog* dirDlg = new wxDirDialog( 0, _T("Select the directory to display"), _T(""), style);
+
+ resultShowModal = dirDlg->ShowModal();
+ if ( resultShowModal==wxID_OK )
+ {
+ std::string path = crea::wx2std(dirDlg->GetPath());
+ typedef boost::filesystem::directory_iterator dir_it;
+ dir_it itr(path);
+ dir_it end_itr;
+ /*if (boost::filesystem::exists(path))
+ {*/
+ for(;itr != end_itr; ++itr)
+ {
+ bvalid = m_exts.size() == 0? true : false;
+ std::vector<std::string>::iterator it = m_exts.begin();
+ std::string ext = itr->filename().substr(itr->filename().find_last_of("."));
+ for(; it != m_exts.end(); it++)
+ {
+ if(ext == (*it) )
+ {
+ bvalid = true;
+ break;
+ }
+ }
+ if (!boost::filesystem::is_directory(itr->status()) && bvalid)
+ {
+ readImg(itr->string().c_str());
+ }
+ }
+ }
+ SetReturnCode( resultShowModal );
+// Close();
+ EndModal( resultShowModal );
+ }