]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/filedlgg.h
Window management and sizer layout corrections
[wxWidgets.git] / include / wx / generic / filedlgg.h
CommitLineData
8b17ba72
RR
1/////////////////////////////////////////////////////////////////////////////
2// Name: filedlgg.h
3// Purpose: wxFileDialog
4// Author: Robert Roebling
5// Modified by:
6// Created: 8/17/99
7// Copyright: (c) Robert Roebling
8// RCS-ID: $Id$
c8c0e54c 9// Licence: wxWindows licence
8b17ba72
RR
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_FILEDLGG_H_
13#define _WX_FILEDLGG_H_
14
15#ifdef __GNUG__
16#pragma interface "filedlgg.h"
17#endif
18
8b17ba72 19#include "wx/dialog.h"
8b17ba72
RR
20
21//-----------------------------------------------------------------------------
22// data
23//-----------------------------------------------------------------------------
24
25WXDLLEXPORT_DATA(extern const wxChar *)wxFileSelectorPromptStr;
26WXDLLEXPORT_DATA(extern const wxChar *)wxFileSelectorDefaultWildcardStr;
27
28//-----------------------------------------------------------------------------
29// classes
30//-----------------------------------------------------------------------------
31
04dbb646
VZ
32class wxCheckBox;
33class wxChoice;
8b17ba72
RR
34class wxFileData;
35class wxFileCtrl;
36class wxFileDialog;
04dbb646
VZ
37class wxListEvent;
38class wxStaticText;
39class wxTextCtrl;
8b17ba72
RR
40
41//-------------------------------------------------------------------------
42// File selector
43//-------------------------------------------------------------------------
44
45class wxFileDialog: public wxDialog
46{
47public:
48 wxFileDialog() { }
49
50 wxFileDialog(wxWindow *parent,
51 const wxString& message = wxFileSelectorPromptStr,
52 const wxString& defaultDir = "",
53 const wxString& defaultFile = "",
54 const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
55 long style = 0,
56 const wxPoint& pos = wxDefaultPosition);
04dbb646 57 virtual ~wxFileDialog();
8b17ba72
RR
58
59 void SetMessage(const wxString& message) { m_message = message; }
60 void SetPath(const wxString& path);
61 void SetDirectory(const wxString& dir) { m_dir = dir; }
62 void SetFilename(const wxString& name) { m_fileName = name; }
63 void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
64 void SetStyle(long style) { m_dialogStyle = style; }
65 void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
66
67 wxString GetMessage() const { return m_message; }
68 wxString GetPath() const { return m_path; }
69 wxString GetDirectory() const { return m_dir; }
70 wxString GetFilename() const { return m_fileName; }
71 wxString GetWildcard() const { return m_wildCard; }
72 long GetStyle() const { return m_dialogStyle; }
7941ba11 73 int GetFilterIndex() const { return m_filterIndex; }
c61f4f6d 74
7941ba11
RR
75 // for multiple file selection
76 void GetPaths(wxArrayString& paths) const;
77 void GetFilenames(wxArrayString& files) const;
c8c0e54c 78
8b17ba72
RR
79 void OnSelected( wxListEvent &event );
80 void OnActivated( wxListEvent &event );
81 void OnList( wxCommandEvent &event );
82 void OnReport( wxCommandEvent &event );
8b17ba72
RR
83 void OnUp( wxCommandEvent &event );
84 void OnHome( wxCommandEvent &event );
85 void OnListOk( wxCommandEvent &event );
0b855868 86 void OnNew( wxCommandEvent &event );
cae5359f
RR
87 void OnChoice( wxCommandEvent &event );
88 void OnTextEnter( wxCommandEvent &event );
bf9e3e73 89 void OnCheck( wxCommandEvent &event );
c61f4f6d 90
e1811a01 91 void HandleAction( const wxString &fn );
c8c0e54c
VZ
92
93protected:
9c884972
RR
94 wxString m_message;
95 long m_dialogStyle;
96 wxString m_dir;
97 wxString m_path; // Full path
98 wxString m_fileName;
99 wxString m_wildCard;
100 int m_filterIndex;
cefc49fd 101 wxString m_filterExtension;
9c884972
RR
102 wxChoice *m_choice;
103 wxTextCtrl *m_text;
104 wxFileCtrl *m_list;
105 wxCheckBox *m_check;
106 wxStaticText *m_static;
c8c0e54c 107
8b17ba72
RR
108private:
109 DECLARE_DYNAMIC_CLASS(wxFileDialog)
110 DECLARE_EVENT_TABLE()
cefc49fd 111
eaf40b23
VS
112 static long s_lastViewStyle; // list or report?
113 static bool s_lastShowHidden;
8b17ba72
RR
114};
115
8b17ba72
RR
116// File selector - backward compatibility
117WXDLLEXPORT wxString
118wxFileSelector(const wxChar *message = wxFileSelectorPromptStr,
119 const wxChar *default_path = NULL,
120 const wxChar *default_filename = NULL,
121 const wxChar *default_extension = NULL,
122 const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
123 int flags = 0,
124 wxWindow *parent = NULL,
125 int x = -1, int y = -1);
126
127// An extended version of wxFileSelector
128WXDLLEXPORT wxString
129wxFileSelectorEx(const wxChar *message = wxFileSelectorPromptStr,
130 const wxChar *default_path = NULL,
131 const wxChar *default_filename = NULL,
132 int *indexDefaultExtension = NULL,
133 const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
134 int flags = 0,
135 wxWindow *parent = NULL,
136 int x = -1, int y = -1);
137
138// Ask for filename to load
139WXDLLEXPORT wxString
140wxLoadFileSelector(const wxChar *what,
141 const wxChar *extension,
142 const wxChar *default_name = (const wxChar *)NULL,
143 wxWindow *parent = (wxWindow *) NULL);
144
145// Ask for filename to save
146WXDLLEXPORT wxString
147wxSaveFileSelector(const wxChar *what,
148 const wxChar *extension,
149 const wxChar *default_name = (const wxChar *) NULL,
150 wxWindow *parent = (wxWindow *) NULL);
151
152
153
154#endif
155 // _WX_DIRDLGG_H_
156