]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dirdlg.h
fix aui crash related to SF bug 1531361
[wxWidgets.git] / include / wx / dirdlg.h
CommitLineData
99d80019
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/dirdlg.h
3// Purpose: wxDirDialog base class
4// Author: Robert Roebling
5// Modified by:
6// Created:
7// Copyright: (c) Robert Roebling
8// RCS-ID: $Id$
9// Licence: wxWindows Licence
10/////////////////////////////////////////////////////////////////////////////
11
34138703
JS
12#ifndef _WX_DIRDLG_H_BASE_
13#define _WX_DIRDLG_H_BASE_
c801d85f 14
1e6feb95
VZ
15#if wxUSE_DIRDLG
16
48013bb0
GD
17#include "wx/dialog.h"
18
1044a386
JS
19// ----------------------------------------------------------------------------
20// constants
21// ----------------------------------------------------------------------------
22
63ec432b
MR
23extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogNameStr[];
24extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogDefaultFolderStr[];
25extern WXDLLEXPORT_DATA(const wxChar) wxDirSelectorPromptStr[];
26
ff3e84ff 27#define wxDD_CHANGE_DIR 0x0100
347f5baa
VZ
28#define wxDD_DIR_MUST_EXIST 0x0200
29
30// deprecated, on by default now, use wxDD_DIR_MUST_EXIST to disable it
31#define wxDD_NEW_DIR_BUTTON 0
1044a386 32
30dfe2ff 33#ifdef __WXWINCE__
ff3e84ff 34 #define wxDD_DEFAULT_STYLE wxDEFAULT_DIALOG_STYLE
30dfe2ff 35#else
ff3e84ff 36 #define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
30dfe2ff 37#endif
e78d4a23 38
b50747ea
RR
39//-------------------------------------------------------------------------
40// wxDirDialogBase
41//-------------------------------------------------------------------------
e78d4a23
VZ
42
43class WXDLLEXPORT wxDirDialogBase : public wxDialog
44{
45public:
141d782d 46 wxDirDialogBase() {}
e78d4a23 47 wxDirDialogBase(wxWindow *parent,
b50747ea 48 const wxString& title = wxDirSelectorPromptStr,
e78d4a23
VZ
49 const wxString& defaultPath = wxEmptyString,
50 long style = wxDD_DEFAULT_STYLE,
51 const wxPoint& pos = wxDefaultPosition,
52 const wxSize& sz = wxDefaultSize,
b50747ea 53 const wxString& name = wxDirDialogNameStr)
141d782d
VZ
54 {
55 Create(parent, title, defaultPath, style, pos, sz, name);
56 }
e78d4a23 57
b50747ea 58 virtual ~wxDirDialogBase() {}
e78d4a23 59
141d782d
VZ
60
61 bool Create(wxWindow *parent,
62 const wxString& title = wxDirSelectorPromptStr,
63 const wxString& defaultPath = wxEmptyString,
64 long style = wxDD_DEFAULT_STYLE,
65 const wxPoint& pos = wxDefaultPosition,
66 const wxSize& sz = wxDefaultSize,
67 const wxString& name = wxDirDialogNameStr)
68 {
69 if (!wxDialog::Create(parent, wxID_ANY, title, pos, sz, style, name))
70 return false;
71 m_path = defaultPath;
72 m_message = title;
73 return true;
74 }
75
76
b50747ea
RR
77 virtual void SetMessage(const wxString& message) { m_message = message; }
78 virtual void SetPath(const wxString& path) { m_path = path; }
b50747ea
RR
79
80 virtual wxString GetMessage() const { return m_message; }
81 virtual wxString GetPath() const { return m_path; }
b50747ea
RR
82
83protected:
84 wxString m_message;
85 wxString m_path;
e78d4a23
VZ
86};
87
e78d4a23 88
ba7463d8 89// Universal and non-port related switches with need for generic implementation
51f5e282 90#if defined(__WXUNIVERSAL__)
51f5e282
WS
91 #include "wx/generic/dirdlgg.h"
92 #define wxDirDialog wxGenericDirDialog
51f5e282
WS
93#elif defined(__WXMSW__) && (defined(__SALFORDC__) || \
94 !wxUSE_OLE || \
95 (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
4a70a30b 96 #include "wx/generic/dirdlgg.h"
ba7463d8 97 #define wxDirDialog wxGenericDirDialog
bcfced36 98#elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
ff3e84ff 99 #include "wx/generic/dirdlgg.h" // MS PocketPC or MS Smartphone
9b141468 100 #define wxDirDialog wxGenericDirDialog
ba7463d8 101#elif defined(__WXMSW__)
ff3e84ff
VZ
102 #include "wx/msw/dirdlg.h" // Native MSW
103#elif defined(__WXGTK24__)
104 #include "wx/gtk/dirdlg.h" // Native GTK for gtk2.4
b50747ea 105#elif defined(__WXGTK__)
d7313bdc
JJ
106 #include "wx/generic/dirdlgg.h"
107 #define wxDirDialog wxGenericDirDialog
34138703 108#elif defined(__WXMAC__)
ff3e84ff 109 #include "wx/mac/dirdlg.h" // Native Mac
937f314d 110#elif defined(__WXCOCOA__)
ff3e84ff 111 #include "wx/cocoa/dirdlg.h" // Native Cocoa
ba7463d8 112#elif defined(__WXMOTIF__) || \
ba7463d8
WS
113 defined(__WXX11__) || \
114 defined(__WXMGL__) || \
115 defined(__WXCOCOA__) || \
116 defined(__WXPM__)
ff3e84ff 117 #include "wx/generic/dirdlgg.h" // Other ports use generic implementation
e78d4a23
VZ
118 #define wxDirDialog wxGenericDirDialog
119#endif
120
10eb1f1e
VZ
121// ----------------------------------------------------------------------------
122// common ::wxDirSelector() function
123// ----------------------------------------------------------------------------
124
10eb1f1e
VZ
125WXDLLEXPORT wxString
126wxDirSelector(const wxString& message = wxDirSelectorPromptStr,
127 const wxString& defaultPath = wxEmptyString,
e78d4a23 128 long style = wxDD_DEFAULT_STYLE,
10eb1f1e
VZ
129 const wxPoint& pos = wxDefaultPosition,
130 wxWindow *parent = NULL);
131
1e6feb95
VZ
132#endif // wxUSE_DIRDLG
133
c801d85f 134#endif
34138703 135 // _WX_DIRDLG_H_BASE_