]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxDirectorySelector.cxx
*** empty log message ***
[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/02/15 12:47:18 $
7   Version:   $Revision: 1.1 $
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/filedlg.h>
31
32
33 namespace bbwx
34 {
35
36   BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,DirectorySelector);
37   
38
39   BBTK_USER_BLACK_BOX_IMPLEMENTATION(DirectorySelector,bbtk::AtomicBlackBox);
40
41
42   void DirectorySelector::Process() 
43   { 
44     bbtkDebugMessageInc("Core",9,"DirectorySelector::Process() ["
45                         <<bbGetFullName()<<"]"<<std::endl);
46
47     wxFileDialog* FD = 
48       new wxFileDialog( 0, 
49                         bbtk::std2wx(bbGetInputMessage()),
50                         bbtk::std2wx(bbGetInputDefaultDir()));
51     
52     FD->ShowModal();
53     
54     if (FD->GetReturnCode()==wxID_OK)
55       {
56         bbSetOutputOut( bbtk::wx2std (FD->GetPath()) );
57         bbSetInputDefaultDir( bbtk::wx2std (FD->GetPath()) );
58     }
59     else
60       { 
61         bbSetOutputOut("");
62         bbSetInputDefaultDir("");
63       }
64     
65     bbtkDebugDecTab("Core",9); 
66   }
67   
68
69
70 }//namespace bbtk
71
72 #endif // _USE_WXWIDGETS_ 
73