]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/filedlg.h
wxDataObject now defined in defs.h and not here
[wxWidgets.git] / include / wx / msw / filedlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: filedlg.h
3 // Purpose: wxFileDialog class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __FILEDLGH__
13 #define __FILEDLGH__
14
15 #ifdef __GNUG__
16 #pragma interface "filedlg.h"
17 #endif
18
19 #include "wx/dialog.h"
20
21 /*
22 * File selector
23 */
24
25 WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr;
26 WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr;
27
28 class WXDLLEXPORT wxFileDialog: public wxDialog
29 {
30 DECLARE_DYNAMIC_CLASS(wxFileDialog)
31 protected:
32 wxString m_message;
33 long m_dialogStyle;
34 wxWindow * m_parent;
35 wxString m_dir;
36 wxString m_path; // Full path
37 wxString m_fileName;
38 wxString m_wildCard;
39 int m_filterIndex;
40 public:
41 wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
42 const wxString& defaultDir = "", const wxString& defaultFile = "", const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
43 long style = 0, const wxPoint& pos = wxDefaultPosition);
44
45 inline void SetMessage(const wxString& message) { m_message = message; }
46 inline void SetPath(const wxString& path) { m_path = path; }
47 inline void SetDirectory(const wxString& dir) { m_dir = dir; }
48 inline void SetFilename(const wxString& name) { m_fileName = name; }
49 inline void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
50 inline void SetStyle(long style) { m_dialogStyle = style; }
51 inline void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
52
53 inline wxString GetMessage(void) const { return m_message; }
54 inline wxString GetPath(void) const { return m_path; }
55 inline wxString GetDirectory(void) const { return m_dir; }
56 inline wxString GetFilename(void) const { return m_fileName; }
57 inline wxString GetWildcard(void) const { return m_wildCard; }
58 inline long GetStyle(void) const { return m_dialogStyle; }
59 inline int GetFilterIndex(void) const { return m_filterIndex ; }
60
61 int ShowModal(void);
62 };
63
64 #define wxOPEN 1
65 #define wxSAVE 2
66 #define wxOVERWRITE_PROMPT 4
67 #define wxHIDE_READONLY 8
68
69 // File selector - backward compatibility
70 char* WXDLLEXPORT wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
71 const char *default_filename = NULL, const char *default_extension = NULL,
72 const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
73 wxWindow *parent = NULL, int x = -1, int y = -1);
74
75 // An extended version of wxFileSelector
76 char* WXDLLEXPORT wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
77 const char *default_filename = NULL, int *indexDefaultExtension = NULL,
78 const char *wildcard = wxFileSelectorDefaultWildcardStr, const int flags = 0,
79 wxWindow *parent = NULL, const int x = -1, const int y = -1);
80
81 // Generic file load dialog
82 char* WXDLLEXPORT wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
83
84 // Generic file save dialog
85 char* WXDLLEXPORT wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
86
87 #endif
88 // __FILEDLGH__