]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/filedlg.h
Compile improvemnts for strict compilers and the like
[wxWidgets.git] / include / wx / gtk / 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 char *wxFileSelectorPromptStr;
25 extern const char *wxFileSelectorDefaultWildcardStr;
26
27 class wxFileDialog: public wxDialog
28 {
29
30 DECLARE_DYNAMIC_CLASS(wxFileDialog)
31
32 friend void gtk_filedialog_ok_callback( GtkWidget *widget, gpointer data );
33
34 public:
35
36 wxFileDialog() {};
37
38 wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
39 const wxString& defaultDir = "", const wxString& defaultFile = "",
40 const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
41 long style = 0, const wxPoint& pos = wxDefaultPosition);
42
43 inline void SetMessage(const wxString& message) { m_message = message; }
44 inline void SetPath(const wxString& path) { m_path = path; }
45 inline void SetDirectory(const wxString& dir) { m_dir = dir; }
46 inline void SetFilename(const wxString& name) { m_fileName = name; }
47 inline void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
48 inline void SetStyle(long style) { m_dialogStyle = style; }
49 inline void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
50
51 inline wxString GetMessage(void) const { return m_message; }
52 inline wxString GetPath(void) const { return m_path; }
53 inline wxString GetDirectory(void) const { return m_dir; }
54 inline wxString GetFilename(void) const { return m_fileName; }
55 inline wxString GetWildcard(void) const { return m_wildCard; }
56 inline long GetStyle(void) const { return m_dialogStyle; }
57 inline int GetFilterIndex(void) const { return m_filterIndex ; }
58
59 int ShowModal(void);
60
61 protected:
62
63 wxString m_message;
64 long m_dialogStyle;
65 wxWindow * m_parent;
66 wxString m_dir;
67 wxString m_path; // Full path
68 wxString m_fileName;
69 wxString m_wildCard;
70 int m_filterIndex;
71 };
72
73 #define wxOPEN 1
74 #define wxSAVE 2
75 #define wxOVERWRITE_PROMPT 4
76 #define wxHIDE_READONLY 8
77 #define wxFILE_MUST_EXIST 16
78
79 // File selector - backward compatibility
80
81 char* wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = (const char *) NULL,
82 const char *default_filename = (const char *) NULL, const char *default_extension = (const char *) NULL,
83 const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
84 wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1);
85
86 char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name = (const char *) NULL,
87 wxWindow *parent = (wxWindow *) NULL);
88
89 char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name = (const char *) NULL,
90 wxWindow *parent = (wxWindow *) NULL);
91
92
93
94 #endif
95 // __GTKFILEDLGH__