1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDirDialog base class
4 // Author: Robert Roebling
7 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DIRDLG_H_BASE_
13 #define _WX_DIRDLG_H_BASE_
17 #include "wx/dialog.h"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
23 extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogNameStr
[];
24 extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogDefaultFolderStr
[];
25 extern WXDLLIMPEXP_DATA_CORE(const char) wxDirSelectorPromptStr
[];
27 #define wxDD_CHANGE_DIR 0x0100
28 #define wxDD_DIR_MUST_EXIST 0x0200
30 // deprecated, on by default now, use wxDD_DIR_MUST_EXIST to disable it
31 #define wxDD_NEW_DIR_BUTTON 0
34 #define wxDD_DEFAULT_STYLE wxDEFAULT_DIALOG_STYLE
36 #define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
39 //-------------------------------------------------------------------------
41 //-------------------------------------------------------------------------
43 class WXDLLIMPEXP_CORE wxDirDialogBase
: public wxDialog
47 wxDirDialogBase(wxWindow
*parent
,
48 const wxString
& title
= wxDirSelectorPromptStr
,
49 const wxString
& defaultPath
= wxEmptyString
,
50 long style
= wxDD_DEFAULT_STYLE
,
51 const wxPoint
& pos
= wxDefaultPosition
,
52 const wxSize
& sz
= wxDefaultSize
,
53 const wxString
& name
= wxDirDialogNameStr
)
55 Create(parent
, title
, defaultPath
, style
, pos
, sz
, name
);
58 virtual ~wxDirDialogBase() {}
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
)
69 if (!wxDialog::Create(parent
, wxID_ANY
, title
, pos
, sz
, style
, name
))
76 #if WXWIN_COMPATIBILITY_2_6
78 wxDEPRECATED( long GetStyle() const );
79 wxDEPRECATED( void SetStyle(long style
) );
81 #endif // WXWIN_COMPATIBILITY_2_6
83 virtual void SetMessage(const wxString
& message
) { m_message
= message
; }
84 virtual void SetPath(const wxString
& path
) { m_path
= path
; }
86 virtual wxString
GetMessage() const { return m_message
; }
87 virtual wxString
GetPath() const { return m_path
; }
95 // Universal and non-port related switches with need for generic implementation
96 #if defined(__WXUNIVERSAL__)
97 #include "wx/generic/dirdlgg.h"
98 #define wxDirDialog wxGenericDirDialog
99 #elif defined(__WXMSW__) && (!wxUSE_OLE || \
100 (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
101 #include "wx/generic/dirdlgg.h"
102 #define wxDirDialog wxGenericDirDialog
103 #elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
104 #include "wx/generic/dirdlgg.h" // MS PocketPC or MS Smartphone
105 #define wxDirDialog wxGenericDirDialog
106 #elif defined(__WXMSW__)
107 #include "wx/msw/dirdlg.h" // Native MSW
108 #elif defined(__WXGTK20__)
109 #include "wx/gtk/dirdlg.h" // Native GTK for gtk2.4
110 #elif defined(__WXGTK__)
111 #include "wx/generic/dirdlgg.h"
112 #define wxDirDialog wxGenericDirDialog
113 #elif defined(__WXMAC__)
114 #include "wx/osx/dirdlg.h" // Native Mac
115 #elif defined(__WXCOCOA__)
116 #include "wx/cocoa/dirdlg.h" // Native Cocoa
117 #elif defined(__WXMOTIF__) || \
118 defined(__WXX11__) || \
119 defined(__WXMGL__) || \
120 defined(__WXCOCOA__) || \
121 defined(__WXPALMOS__) || \
123 #include "wx/generic/dirdlgg.h" // Other ports use generic implementation
124 #define wxDirDialog wxGenericDirDialog
127 // ----------------------------------------------------------------------------
128 // common ::wxDirSelector() function
129 // ----------------------------------------------------------------------------
131 WXDLLIMPEXP_CORE wxString
132 wxDirSelector(const wxString
& message
= wxDirSelectorPromptStr
,
133 const wxString
& defaultPath
= wxEmptyString
,
134 long style
= wxDD_DEFAULT_STYLE
,
135 const wxPoint
& pos
= wxDefaultPosition
,
136 wxWindow
*parent
= NULL
);
138 #endif // wxUSE_DIRDLG
141 // _WX_DIRDLG_H_BASE_