]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/filedlgg.h
compilation
[wxWidgets.git] / include / wx / generic / filedlgg.h
CommitLineData
8b17ba72 1/////////////////////////////////////////////////////////////////////////////
d022d364 2// Name: wx/generic/filedlgg.h
23254b13 3// Purpose: wxGenericFileDialog
8b17ba72
RR
4// Author: Robert Roebling
5// Modified by:
6// Created: 8/17/99
7// Copyright: (c) Robert Roebling
8// RCS-ID: $Id$
65571936 9// Licence: wxWindows licence
8b17ba72
RR
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_FILEDLGG_H_
13#define _WX_FILEDLGG_H_
14
23254b13 15#include "wx/listctrl.h"
06cc1fb9 16#include "wx/datetime.h"
8226a054 17#include "wx/filefn.h"
d022d364 18#include "wx/filedlg.h"
0cf3e587 19#include "wx/generic/filectrlg.h"
8b17ba72
RR
20
21//-----------------------------------------------------------------------------
22// classes
23//-----------------------------------------------------------------------------
24
b5dbe15d 25class WXDLLIMPEXP_FWD_CORE wxBitmapButton;
0cf3e587 26class WXDLLIMPEXP_FWD_CORE wxGenericFileCtrl;
b5dbe15d 27class WXDLLIMPEXP_FWD_CORE wxGenericFileDialog;
0cf3e587 28class WXDLLIMPEXP_FWD_CORE wxFileCtrlEvent;
8b17ba72
RR
29
30//-------------------------------------------------------------------------
b600ed13 31// wxGenericFileDialog
8b17ba72
RR
32//-------------------------------------------------------------------------
33
f74172ab 34class WXDLLEXPORT wxGenericFileDialog: public wxFileDialogBase
8b17ba72
RR
35{
36public:
fe6cf128 37 wxGenericFileDialog() : wxFileDialogBase() { Init(); }
8b17ba72 38
23254b13 39 wxGenericFileDialog(wxWindow *parent,
fe6cf128 40 const wxString& message = wxFileSelectorPromptStr,
f74172ab
VZ
41 const wxString& defaultDir = wxEmptyString,
42 const wxString& defaultFile = wxEmptyString,
fe6cf128 43 const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
ff3e84ff 44 long style = wxFD_DEFAULT_STYLE,
fe6cf128 45 const wxPoint& pos = wxDefaultPosition,
ff3e84ff
VZ
46 const wxSize& sz = wxDefaultSize,
47 const wxString& name = wxFileDialogNameStr,
fe6cf128
VZ
48 bool bypassGenericImpl = false );
49
4e1901b7
RR
50 bool Create( wxWindow *parent,
51 const wxString& message = wxFileSelectorPromptStr,
fe6cf128
VZ
52 const wxString& defaultDir = wxEmptyString,
53 const wxString& defaultFile = wxEmptyString,
4e1901b7 54 const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
ff3e84ff 55 long style = wxFD_DEFAULT_STYLE,
fe6cf128 56 const wxPoint& pos = wxDefaultPosition,
ff3e84ff
VZ
57 const wxSize& sz = wxDefaultSize,
58 const wxString& name = wxFileDialogNameStr,
fe6cf128
VZ
59 bool bypassGenericImpl = false );
60
23254b13 61 virtual ~wxGenericFileDialog();
8b17ba72 62
f74172ab
VZ
63 virtual void SetMessage(const wxString& message) { SetTitle(message); }
64 virtual void SetPath(const wxString& path);
65 virtual void SetFilterIndex(int filterIndex);
b4cfe261 66 virtual void SetWildcard(const wxString& wildCard);
c61f4f6d 67
7941ba11 68 // for multiple file selection
f74172ab
VZ
69 virtual void GetPaths(wxArrayString& paths) const;
70 virtual void GetFilenames(wxArrayString& files) const;
c8c0e54c 71
9cedab37
VZ
72 // implementation only from now on
73 // -------------------------------
74
75 virtual int ShowModal();
16dce3b3 76 virtual bool Show( bool show = true );
9cedab37 77
8b17ba72
RR
78 void OnList( wxCommandEvent &event );
79 void OnReport( wxCommandEvent &event );
8b17ba72
RR
80 void OnUp( wxCommandEvent &event );
81 void OnHome( wxCommandEvent &event );
0cf3e587 82 void OnOk( wxCommandEvent &event );
0b855868 83 void OnNew( wxCommandEvent &event );
0cf3e587 84 void OnFileActivated( wxFileCtrlEvent &event);
06cc1fb9
JS
85
86 virtual void UpdateControls();
6b99f53e 87
4e1901b7
RR
88private:
89 // Don't use this implementation at all :-)
90 bool m_bypassGenericImpl;
c8c0e54c
VZ
91
92protected:
2b5f62a0 93
0cf3e587
VZ
94 wxString m_filterExtension;
95 wxGenericFileCtrl *m_filectrl;
96 wxBitmapButton *m_upDirButton;
97 wxBitmapButton *m_newDirButton;
c8c0e54c 98
8b17ba72 99private:
fe6cf128 100 void Init();
23254b13 101 DECLARE_DYNAMIC_CLASS(wxGenericFileDialog)
8b17ba72 102 DECLARE_EVENT_TABLE()
cefc49fd 103
23254b13 104 // these variables are preserved between wxGenericFileDialog calls
9cedab37
VZ
105 static long ms_lastViewStyle; // list or report?
106 static bool ms_lastShowHidden; // did we show hidden files?
8b17ba72
RR
107};
108
b2f0b934 109#ifdef wxHAS_GENERIC_FILEDIALOG
23254b13
JS
110
111class WXDLLEXPORT wxFileDialog: public wxGenericFileDialog
112{
23254b13 113public:
6463b9f5 114 wxFileDialog() {}
23254b13
JS
115
116 wxFileDialog(wxWindow *parent,
117 const wxString& message = wxFileSelectorPromptStr,
ca65c044
WS
118 const wxString& defaultDir = wxEmptyString,
119 const wxString& defaultFile = wxEmptyString,
23254b13
JS
120 const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
121 long style = 0,
6463b9f5
JS
122 const wxPoint& pos = wxDefaultPosition)
123 :wxGenericFileDialog(parent, message, defaultDir, defaultFile, wildCard, style, pos)
124 {
125 }
6b99f53e 126
4e1901b7
RR
127private:
128 DECLARE_DYNAMIC_CLASS(wxFileDialog)
23254b13
JS
129};
130
b2f0b934 131#endif // wxHAS_GENERIC_FILEDIALOG
8b17ba72 132
b600ed13 133#endif // _WX_FILEDLGG_H_