]>
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
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // For compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
26 // Only use this for MS SmartPhone. Use standard file dialog
29 #if wxUSE_FILEDLG && defined(__SMARTPHONE__) && defined(__WXWINCE__)
31 #include "wx/filedlg.h"
35 #include "wx/msgdlg.h"
36 #include "wx/dialog.h"
37 #include "wx/filefn.h"
43 #include "wx/msw/private.h"
48 #include "wx/filename.h"
49 #include "wx/modalhook.h"
51 // ============================================================================
53 // ============================================================================
55 // ----------------------------------------------------------------------------
57 // ----------------------------------------------------------------------------
59 IMPLEMENT_CLASS(wxFileDialog
, wxDialog
)
61 // ----------------------------------------------------------------------------
63 // ----------------------------------------------------------------------------
65 wxFileDialog::wxFileDialog(wxWindow
*parent
,
66 const wxString
& message
,
67 const wxString
& defaultDir
,
68 const wxString
& defaultFileName
,
69 const wxString
& wildCard
,
71 const wxPoint
& WXUNUSED(pos
),
72 const wxSize
& WXUNUSED(sz
),
73 const wxString
& WXUNUSED(name
))
76 m_windowStyle
= style
;
77 if ( ( m_windowStyle
& wxFD_MULTIPLE
) && ( m_windowStyle
& wxFD_SAVE
) )
78 m_windowStyle
&= ~wxFD_MULTIPLE
;
80 m_path
= wxEmptyString
;
81 m_fileName
= defaultFileName
;
83 m_wildCard
= wildCard
;
87 void wxFileDialog::GetPaths(wxArrayString
& paths
) const
92 if ( m_dir
.Last() != wxT('\\') )
95 size_t count
= m_fileNames
.GetCount();
96 for ( size_t n
= 0; n
< count
; n
++ )
98 if (wxFileName(m_fileNames
[n
]).IsAbsolute())
99 paths
.Add(m_fileNames
[n
]);
101 paths
.Add(dir
+ m_fileNames
[n
]);
105 void wxFileDialog::SetPath(const wxString
& path
)
108 wxFileName::SplitPath(path
, &m_dir
, &m_fileName
, &ext
);
110 m_fileName
<< wxT('.') << ext
;
113 int wxFileDialog::ShowModal()
115 WX_HOOK_MODAL_DIALOG();
117 wxWindow
* parentWindow
= GetParent();
119 parentWindow
= wxTheApp
->GetTopWindow();
121 wxString str
= wxGetTextFromUser(m_message
, _("File"), m_fileName
, parentWindow
);
126 m_fileNames
.Add(str
);
130 void wxFileDialog::GetFilenames(wxArrayString
& files
) const
135 #endif // wxUSE_FILEDLG && __SMARTPHONE__ && __WXWINCE__