]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/wince/filedlgwce.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/wince/filedlgwce.cpp
3 // Purpose: wxFileDialog implementation for smart phones driven by WinCE
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
27 // Only use this for MS SmartPhone. Use standard file dialog
30 #if wxUSE_FILEDLG && defined(__SMARTPHONE__) && defined(__WXWINCE__)
32 #include "wx/filedlg.h"
36 #include "wx/msgdlg.h"
37 #include "wx/dialog.h"
38 #include "wx/filefn.h"
44 #include "wx/msw/private.h"
49 #include "wx/filename.h"
50 #include "wx/testing.h"
52 // ============================================================================
54 // ============================================================================
56 // ----------------------------------------------------------------------------
58 // ----------------------------------------------------------------------------
60 IMPLEMENT_CLASS(wxFileDialog
, wxDialog
)
62 // ----------------------------------------------------------------------------
64 // ----------------------------------------------------------------------------
66 wxFileDialog::wxFileDialog(wxWindow
*parent
,
67 const wxString
& message
,
68 const wxString
& defaultDir
,
69 const wxString
& defaultFileName
,
70 const wxString
& wildCard
,
72 const wxPoint
& WXUNUSED(pos
),
73 const wxSize
& WXUNUSED(sz
),
74 const wxString
& WXUNUSED(name
))
77 m_windowStyle
= style
;
78 if ( ( m_windowStyle
& wxFD_MULTIPLE
) && ( m_windowStyle
& wxFD_SAVE
) )
79 m_windowStyle
&= ~wxFD_MULTIPLE
;
81 m_path
= wxEmptyString
;
82 m_fileName
= defaultFileName
;
84 m_wildCard
= wildCard
;
88 void wxFileDialog::GetPaths(wxArrayString
& paths
) const
93 if ( m_dir
.Last() != wxT('\\') )
96 size_t count
= m_fileNames
.GetCount();
97 for ( size_t n
= 0; n
< count
; n
++ )
99 if (wxFileName(m_fileNames
[n
]).IsAbsolute())
100 paths
.Add(m_fileNames
[n
]);
102 paths
.Add(dir
+ m_fileNames
[n
]);
106 void wxFileDialog::SetPath(const wxString
& path
)
109 wxFileName::SplitPath(path
, &m_dir
, &m_fileName
, &ext
);
111 m_fileName
<< wxT('.') << ext
;
114 int wxFileDialog::ShowModal()
116 WX_TESTING_SHOW_MODAL_HOOK();
118 wxWindow
* parentWindow
= GetParent();
120 parentWindow
= wxTheApp
->GetTopWindow();
122 wxString str
= wxGetTextFromUser(m_message
, _("File"), m_fileName
, parentWindow
);
127 m_fileNames
.Add(str
);
131 void wxFileDialog::GetFilenames(wxArrayString
& files
) const
136 #endif // wxUSE_FILEDLG && __SMARTPHONE__ && __WXWINCE__