]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxDirectorySelector.cxx
a0b4f5c7a6b4a3c450acf5bb7d483cff445963d0
[bbtk.git] / packages / wx / src / bbwxDirectorySelector.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbwxDirectorySelector.cxx,v $
5   Language:  C++
6   Date:      $Date: 2008/03/17 07:04:09 $
7   Version:   $Revision: 1.3 $
8                                                                                 
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.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*/
18 /**
19  *  \file 
20  *  \brief 
21  */
22
23
24 #ifdef _USE_WXWIDGETS_
25
26
27 #include "bbwxDirectorySelector.h"
28 #include "bbwxPackage.h"
29  
30 #include <wx/dirdlg.h>
31
32 namespace bbwx
33 {
34
35   BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,DirectorySelector);
36   
37
38   BBTK_USER_BLACK_BOX_IMPLEMENTATION(DirectorySelector,bbtk::AtomicBlackBox);
39
40
41   void DirectorySelector::Process() 
42   { 
43     bbtkDebugMessageInc("Core",9,"DirectorySelector::Process() ["
44                         <<bbGetFullName()<<"]"<<std::endl);
45
46     wxDirDialog* FD = 
47       new wxDirDialog( 0, 
48                         bbtk::std2wx(bbGetInputMessage()),
49                         bbtk::std2wx(bbGetInputDefaultDir()));
50     
51         if (FD->ShowModal()==wxID_OK)
52       {
53         bbSetOutputOut( bbtk::wx2std (FD->GetPath()) );
54         bbSetInputDefaultDir( bbtk::wx2std (FD->GetPath()) );
55     }
56     else
57       {  
58         bbSetOutputOut("");
59         bbSetInputDefaultDir("");
60       }
61     
62     bbtkDebugDecTab("Core",9); 
63   }
64   
65
66
67 }//namespace bbtk
68
69 #endif // _USE_WXWIDGETS_ 
70