]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/filedlg.h
Resource file updates and setup to configure for generic dirdlg.
[wxWidgets.git] / include / wx / gtk1 / filedlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: filedlg.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10
11 #ifndef __GTKFILEDLGH__
12 #define __GTKFILEDLGH__
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "wx/dialog.h"
19
20 //-------------------------------------------------------------------------
21 // File selector
22 //-------------------------------------------------------------------------
23
24 extern const wxChar *wxFileSelectorPromptStr;
25 extern const wxChar *wxFileSelectorDefaultWildcardStr;
26
27 class wxFileDialog: public wxDialog
28 {
29 public:
30 wxFileDialog() { }
31
32 wxFileDialog(wxWindow *parent,
33 const wxString& message = wxFileSelectorPromptStr,
34 const wxString& defaultDir = "",
35 const wxString& defaultFile = "",
36 const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
37 long style = 0,
38 const wxPoint& pos = wxDefaultPosition);
39
40 void SetMessage(const wxString& message) { m_message = message; }
41 void SetPath(const wxString& path);
42 void SetDirectory(const wxString& dir) { m_dir = dir; }
43 void SetFilename(const wxString& name) { m_fileName = name; }
44 void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
45 void SetStyle(long style) { m_dialogStyle = style; }
46 void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
47
48 wxString GetMessage() const { return m_message; }
49 wxString GetPath() const { return m_path; }
50 wxString GetDirectory() const { return m_dir; }
51 wxString GetFilename() const { return m_fileName; }
52 wxString GetWildcard() const { return m_wildCard; }
53 long GetStyle() const { return m_dialogStyle; }
54 int GetFilterIndex() const { return m_filterIndex ; }
55
56 protected:
57 wxString m_message;
58 long m_dialogStyle;
59 wxWindow * m_parent;
60 wxString m_dir;
61 wxString m_path; // Full path
62 wxString m_fileName;
63 wxString m_wildCard;
64 int m_filterIndex;
65
66 private:
67 DECLARE_DYNAMIC_CLASS(wxFileDialog)
68 };
69
70 #define wxOPEN 1
71 #define wxSAVE 2
72 #define wxOVERWRITE_PROMPT 4
73 #define wxHIDE_READONLY 8
74 #define wxFILE_MUST_EXIST 16
75
76 // File selector - backward compatibility
77 WXDLLEXPORT wxString
78 wxFileSelector(const wxChar *message = wxFileSelectorPromptStr,
79 const wxChar *default_path = NULL,
80 const wxChar *default_filename = NULL,
81 const wxChar *default_extension = NULL,
82 const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
83 int flags = 0,
84 wxWindow *parent = NULL,
85 int x = -1, int y = -1);
86
87 // An extended version of wxFileSelector
88 WXDLLEXPORT wxString
89 wxFileSelectorEx(const wxChar *message = wxFileSelectorPromptStr,
90 const wxChar *default_path = NULL,
91 const wxChar *default_filename = NULL,
92 int *indexDefaultExtension = NULL,
93 const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
94 int flags = 0,
95 wxWindow *parent = NULL,
96 int x = -1, int y = -1);
97
98 // Ask for filename to load
99 WXDLLEXPORT wxString
100 wxLoadFileSelector(const wxChar *what,
101 const wxChar *extension,
102 const wxChar *default_name = (const wxChar *)NULL,
103 wxWindow *parent = (wxWindow *) NULL);
104
105 // Ask for filename to save
106 WXDLLEXPORT wxString
107 wxSaveFileSelector(const wxChar *what,
108 const wxChar *extension,
109 const wxChar *default_name = (const wxChar *) NULL,
110 wxWindow *parent = (wxWindow *) NULL);
111
112 #endif
113 // __GTKFILEDLGH__