]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/wince/filedlgwce.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/wince/filedlgwce.cpp
3 // Purpose: wxFileDialog for WinCE (SmartPhone)
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "filedlg.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
31 // Only use this for MS SmartPhone. Use standard file dialog
34 #if wxUSE_FILEDLG && wxUSE_SMARTPHONE
38 #include "wx/msgdlg.h"
39 #include "wx/dialog.h"
40 #include "wx/filedlg.h"
41 #include "wx/filefn.h"
47 #include "wx/msw/private.h"
52 #include "wx/filename.h"
54 // ============================================================================
56 // ============================================================================
58 // ----------------------------------------------------------------------------
60 // ----------------------------------------------------------------------------
62 IMPLEMENT_CLASS(wxFileDialog
, wxDialog
)
64 // ----------------------------------------------------------------------------
66 // ----------------------------------------------------------------------------
68 wxFileDialog::wxFileDialog(wxWindow
*parent
,
69 const wxString
& message
,
70 const wxString
& defaultDir
,
71 const wxString
& defaultFileName
,
72 const wxString
& wildCard
,
74 const wxPoint
& WXUNUSED(pos
))
77 m_dialogStyle
= style
;
78 if ( ( m_dialogStyle
& wxMULTIPLE
) && ( m_dialogStyle
& wxSAVE
) )
79 m_dialogStyle
&= ~wxMULTIPLE
;
81 m_path
= wxEmptyString
;
82 m_fileName
= defaultFileName
;
84 m_wildCard
= wildCard
;
88 void wxFileDialog::GetPaths(wxArrayString
& paths
) const
93 if ( m_dir
.Last() != _T('\\') )
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 wxSplitPath(path
, &m_dir
, &m_fileName
, &ext
);
111 m_fileName
<< _T('.') << ext
;
114 int wxFileDialog::ShowModal()
116 wxWindow
* parentWindow
= GetParent();
118 parentWindow
= wxTheApp
->GetTopWindow();
120 wxString str
= wxGetTextFromUser(m_message
, _("File"), m_fileName
, parentWindow
);
124 m_fileNames
.Add(str
);
133 #endif // wxUSE_FILEDLG