]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dirdlg.h
allow to specify the value for unknown ids in GetXRCID() (patch 1448981)
[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
1044a386 27
30dfe2ff
JS
28#ifdef __WXWINCE__
29 #define wxDD_DEFAULT_STYLE \
30 (wxDEFAULT_DIALOG_STYLE | wxDD_NEW_DIR_BUTTON)
31#else
32 #define wxDD_DEFAULT_STYLE \
33 (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON)
34#endif
e78d4a23 35
b50747ea
RR
36//-------------------------------------------------------------------------
37// wxDirDialogBase
38//-------------------------------------------------------------------------
e78d4a23
VZ
39
40class WXDLLEXPORT wxDirDialogBase : public wxDialog
41{
42public:
43 wxDirDialogBase(wxWindow *parent,
b50747ea 44 const wxString& title = wxDirSelectorPromptStr,
e78d4a23
VZ
45 const wxString& defaultPath = wxEmptyString,
46 long style = wxDD_DEFAULT_STYLE,
47 const wxPoint& pos = wxDefaultPosition,
48 const wxSize& sz = wxDefaultSize,
b50747ea 49 const wxString& name = wxDirDialogNameStr)
1fb351fa
WS
50 : wxDialog(parent, wxID_ANY, title, pos, sz, style, name)
51 , m_path(defaultPath)
52 {}
b50747ea 53 wxDirDialogBase() {}
e78d4a23 54
b50747ea 55 virtual ~wxDirDialogBase() {}
e78d4a23 56
b50747ea
RR
57 virtual void SetMessage(const wxString& message) { m_message = message; }
58 virtual void SetPath(const wxString& path) { m_path = path; }
59 virtual void SetStyle(long style) { SetWindowStyle(style); }
60
61 virtual wxString GetMessage() const { return m_message; }
62 virtual wxString GetPath() const { return m_path; }
63 virtual long GetStyle() const { return GetWindowStyle(); }
64
65protected:
66 wxString m_message;
67 wxString m_path;
e78d4a23
VZ
68};
69
e78d4a23 70
ba7463d8 71// Universal and non-port related switches with need for generic implementation
51f5e282
WS
72#if defined(__WXUNIVERSAL__)
73
74 #include "wx/generic/dirdlgg.h"
75 #define wxDirDialog wxGenericDirDialog
76
77#elif defined(__WXMSW__) && (defined(__SALFORDC__) || \
78 !wxUSE_OLE || \
79 (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
ba7463d8 80
4a70a30b 81 #include "wx/generic/dirdlgg.h"
ba7463d8 82 #define wxDirDialog wxGenericDirDialog
9b141468 83
bcfced36
JS
84// MS PocketPC or MS Smartphone
85#elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
9b141468
WS
86
87 #include "wx/generic/dirdlgg.h"
88 #define wxDirDialog wxGenericDirDialog
ba7463d8
WS
89
90// Native MSW
91#elif defined(__WXMSW__)
92
93 #include "wx/msw/dirdlg.h"
94
d7313bdc 95// Native GTK for gtk2.x and generic for gtk1.x
b50747ea
RR
96#elif defined(__WXGTK__)
97
d7313bdc 98#if defined( __WXGTK20__ )
b50747ea
RR
99 #include "wx/gtk/dirdlg.h"
100 #define wxDirDialog wxDirDialogGTK
d7313bdc
JJ
101#else
102 #include "wx/generic/dirdlgg.h"
103 #define wxDirDialog wxGenericDirDialog
104#endif
b50747ea 105
ba7463d8 106// Native Mac
34138703 107#elif defined(__WXMAC__)
ba7463d8 108
10eb1f1e 109 #include "wx/mac/dirdlg.h"
c801d85f 110
937f314d
VZ
111// Native Cocoa
112#elif defined(__WXCOCOA__)
113
114 #include "wx/cocoa/dirdlg.h"
115
ba7463d8
WS
116// Other ports use generic implementation
117#elif defined(__WXMOTIF__) || \
ba7463d8
WS
118 defined(__WXX11__) || \
119 defined(__WXMGL__) || \
120 defined(__WXCOCOA__) || \
121 defined(__WXPM__)
122
123 #include "wx/generic/dirdlgg.h"
e78d4a23 124 #define wxDirDialog wxGenericDirDialog
ba7463d8 125
e78d4a23
VZ
126#endif
127
10eb1f1e
VZ
128// ----------------------------------------------------------------------------
129// common ::wxDirSelector() function
130// ----------------------------------------------------------------------------
131
10eb1f1e
VZ
132WXDLLEXPORT wxString
133wxDirSelector(const wxString& message = wxDirSelectorPromptStr,
134 const wxString& defaultPath = wxEmptyString,
e78d4a23 135 long style = wxDD_DEFAULT_STYLE,
10eb1f1e
VZ
136 const wxPoint& pos = wxDefaultPosition,
137 wxWindow *parent = NULL);
138
1e6feb95
VZ
139#endif // wxUSE_DIRDLG
140
c801d85f 141#endif
34138703 142 // _WX_DIRDLG_H_BASE_