]>
Commit | Line | Data |
---|---|---|
7c78e7c7 RR |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: filedlg.h | |
01b2eeec KB |
3 | // Purpose: wxFileDialog class |
4 | // Author: AUTHOR | |
5 | // Modified by: | |
6 | // Created: ??/??/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) AUTHOR | |
9 | // Licence: wxWindows licence | |
7c78e7c7 RR |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
01b2eeec KB |
12 | #ifndef _WX_FILEDLG_H_ |
13 | #define _WX_FILEDLG_H_ | |
7c78e7c7 RR |
14 | |
15 | #ifdef __GNUG__ | |
01b2eeec | 16 | #pragma interface "filedlg.h" |
7c78e7c7 RR |
17 | #endif |
18 | ||
19 | #include "wx/dialog.h" | |
20 | ||
01b2eeec KB |
21 | /* |
22 | * File selector | |
23 | */ | |
7c78e7c7 | 24 | |
01b2eeec KB |
25 | WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr; |
26 | WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr; | |
7c78e7c7 | 27 | |
01b2eeec | 28 | class WXDLLEXPORT wxFileDialog: public wxDialog |
7c78e7c7 | 29 | { |
01b2eeec KB |
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: | |
7c78e7c7 | 41 | wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr, |
01b2eeec | 42 | const wxString& defaultDir = "", const wxString& defaultFile = "", const wxString& wildCard = wxFileSelectorDefaultWildcardStr, |
7c78e7c7 RR |
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 | ||
01b2eeec KB |
53 | inline wxString GetMessage() const { return m_message; } |
54 | inline wxString GetPath() const { return m_path; } | |
55 | inline wxString GetDirectory() const { return m_dir; } | |
56 | inline wxString GetFilename() const { return m_fileName; } | |
57 | inline wxString GetWildcard() const { return m_wildCard; } | |
58 | inline long GetStyle() const { return m_dialogStyle; } | |
59 | inline int GetFilterIndex() const { return m_filterIndex ; } | |
7c78e7c7 | 60 | |
01b2eeec | 61 | int ShowModal(); |
7c78e7c7 RR |
62 | }; |
63 | ||
01b2eeec KB |
64 | #define wxOPEN 0x0001 |
65 | #define wxSAVE 0x0002 | |
66 | #define wxOVERWRITE_PROMPT 0x0004 | |
67 | #define wxHIDE_READONLY 0x0008 | |
68 | #define wxFILE_MUST_EXIST 0x0010 | |
7c78e7c7 RR |
69 | |
70 | // File selector - backward compatibility | |
01b2eeec KB |
71 | char* WXDLLEXPORT wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, |
72 | const char *default_filename = NULL, const char *default_extension = NULL, | |
73 | const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, | |
74 | wxWindow *parent = NULL, int x = -1, int y = -1); | |
7c78e7c7 | 75 | |
01b2eeec KB |
76 | // An extended version of wxFileSelector |
77 | char* WXDLLEXPORT wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, | |
78 | const char *default_filename = NULL, int *indexDefaultExtension = NULL, | |
79 | const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, | |
80 | wxWindow *parent = NULL, int x = -1, int y = -1); | |
7c78e7c7 | 81 | |
01b2eeec KB |
82 | // Generic file load dialog |
83 | char* WXDLLEXPORT wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); | |
7c78e7c7 | 84 | |
01b2eeec KB |
85 | // Generic file save dialog |
86 | char* WXDLLEXPORT wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); | |
7c78e7c7 RR |
87 | |
88 | #endif | |
01b2eeec | 89 | // _WX_FILEDLG_H_ |