FileDlg updates.
[wxWidgets.git] / include / wx / os2 / filedlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: filedlg.h
3 // Purpose: wxFileDialog class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/05/99
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_FILEDLG_H_
13 #define _WX_FILEDLG_H_
14
15 #include "wx/dialog.h"
16
17 /*
18 * File selector
19 */
20
21 WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr;
22 WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr;
23
24 class WXDLLEXPORT wxFileDialog: public wxDialog
25 {
26 DECLARE_DYNAMIC_CLASS(wxFileDialog)
27 public:
28 wxFileDialog( wxWindow* pParent
29 ,const wxString& rsMessage = wxFileSelectorPromptStr
30 ,const wxString& rsDefaultDir = ""
31 ,const wxString& rsDefaultFile = ""
32 ,const wxString& rsWildCard = wxFileSelectorDefaultWildcardStr
33 ,long lStyle = 0
34 ,const wxPoint& rPos = wxDefaultPosition
35 );
36
37 inline void SetMessage(const wxString& rsMessage) { m_sMessage = rsMessage; }
38 inline void SetPath(const wxString& rsPath) { m_sPath = rsPath; }
39 inline void SetDirectory(const wxString& rsDir) { m_sDir = rsDir; }
40 inline void SetFilename(const wxString& rsName) { m_sFileName = rsName; }
41 inline void SetWildcard(const wxString& rsWildCard) { m_sWildCard = rsWildCard; }
42 inline void SetStyle(long lStyle) { m_lDialogStyle = lStyle; }
43 inline void SetFilterIndex(int nFilterIndex) { m_nFilterIndex = nFilterIndex; }
44
45 inline wxString GetMessage(void) const { return m_sMessage; }
46 inline wxString GetPath(void) const { return m_sPath; }
47 void GetPaths(wxArrayString& rasPath) const;
48 inline wxString GetDirectory(void) const { return m_sDir; }
49 inline wxString GetFilename(void) const { return m_sFileName; }
50 inline void GetFilenames(wxArrayString& rasFilenames) { rasFilenames.Empty(); rasFilenames.Add( m_sFileName); }
51 inline wxString GetWildcard(void) const { return m_sWildCard; }
52 inline long GetStyle(void) const { return m_lDialogStyle; }
53 inline int GetFilterIndex() const { return m_nFilterIndex ; }
54
55 int ShowModal();
56
57 protected:
58 wxString m_sMessage;
59 long m_lDialogStyle;
60 wxWindow* m_pParent;
61 wxString m_sDir;
62 wxString m_sPath; // Full path
63 wxString m_sFileName;
64 wxArrayString m_asFileNames;
65 wxString m_sWildCard;
66 int m_nFilterIndex;
67 wxPoint m_vPos;
68 }; // end of CLASS wxFileDialog
69
70 #define wxOPEN 0x0001
71 #define wxSAVE 0x0002
72 #define wxOVERWRITE_PROMPT 0x0004
73 #define wxHIDE_READONLY 0x0008
74 #define wxFILE_MUST_EXIST 0x0010
75
76 //
77 // File selector - backward compatibility
78 //
79 WXDLLEXPORT wxString wxFileSelector( const char* pzMessage = wxFileSelectorPromptStr
80 ,const char* pzDefaultPath = NULL
81 ,const char* pzDefaultFilename = NULL
82 ,const char* pzDefaultExtension = NULL
83 ,const char* pzWildcard = wxFileSelectorDefaultWildcardStr
84 ,int nFlags = 0
85 ,wxWindow* pParent = NULL
86 ,int nX = -1
87 ,int nY = -1
88 );
89
90 //
91 // An extended version of wxFileSelector
92
93 WXDLLEXPORT wxString wxFileSelectorEx( const char* pzMessage = wxFileSelectorPromptStr
94 ,const char* pzDefaultPath = NULL
95 ,const char* pzDefaultFilename = NULL
96 ,int* pnIndexDefaultExtension = NULL
97 ,const char* pzWildcard = wxFileSelectorDefaultWildcardStr
98 ,int nFlags = 0
99 ,wxWindow* pParent = NULL
100 ,int nX = -1
101 ,int nY = -1
102 );
103
104 //
105 // Generic file load dialog
106 //
107 WXDLLEXPORT wxString wxLoadFileSelector( const char* pzWhat
108 ,const char* pzExtension
109 ,const char* pzDefaultName = NULL
110 ,wxWindow* pParent = NULL
111 );
112
113 //
114 // Generic file save dialog
115 //
116 WXDLLEXPORT wxString wxSaveFileSelector( const char* pzWhat
117 ,const char* pzExtension
118 ,const char* pzDefaultName = NULL
119 ,wxWindow* pParent = NULL
120 );
121
122 #endif
123
124 // _WX_FILEDLG_H_