1 /*=========================================================================
4 Module: $RCSfile: bbwxFileSelector.cxx,v $
6 Date: $Date: 2008/06/26 07:37:11 $
7 Version: $Revision: 1.3 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
24 #ifdef _USE_WXWIDGETS_
27 #include "bbwxFileSelector.h"
28 #include "bbwxPackage.h"
30 #include <wx/filedlg.h>
36 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,FileSelector);
39 BBTK_BLACK_BOX_IMPLEMENTATION(FileSelector,bbtk::AtomicBlackBox);
42 void FileSelector::Process()
44 bbtkDebugMessageInc("Core",9,"FileSelector::Process() ["
45 <<bbGetFullName()<<"]"<<std::endl);
48 if (bbGetInputOpenSave()=="Save")
50 style = wxSAVE | wxOVERWRITE_PROMPT;
54 style = wxOPEN | wxFILE_MUST_EXIST;
57 std::string wc(bbGetInputWildcard());
64 wxFileDialog* FD = new wxFileDialog( 0,
65 bbtk::std2wx(bbGetInputMessage()),
66 bbtk::std2wx(bbGetInputDefaultDir()),
67 bbtk::std2wx(bbGetInputDefaultFile()),
73 int result_FD = FD->ShowModal();
75 // This line is need it by windows //EED
76 FD->SetReturnCode( result_FD );
78 if (FD->GetReturnCode()==wxID_OK)
80 bbSetOutputOut( bbtk::wx2std (FD->GetPath()) );
87 bbtkDebugDecTab("Core",9);
91 void FileSelector::bbUserConstructor()
93 bbSetInputOpenSave("Open");
100 #endif // _USE_WXWIDGETS_