1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDirDialog base class
4 // Author: Robert Roebling
7 // Copyright: (c) Robert Roebling
8 // Licence: wxWindows Licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_DIRDLG_H_BASE_
12 #define _WX_DIRDLG_H_BASE_
16 #include "wx/dialog.h"
18 // ----------------------------------------------------------------------------
20 // ----------------------------------------------------------------------------
22 extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogNameStr
[];
23 extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogDefaultFolderStr
[];
24 extern WXDLLIMPEXP_DATA_CORE(const char) wxDirSelectorPromptStr
[];
26 #define wxDD_CHANGE_DIR 0x0100
27 #define wxDD_DIR_MUST_EXIST 0x0200
29 // deprecated, on by default now, use wxDD_DIR_MUST_EXIST to disable it
30 #define wxDD_NEW_DIR_BUTTON 0
33 #define wxDD_DEFAULT_STYLE wxDEFAULT_DIALOG_STYLE
35 #define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
38 //-------------------------------------------------------------------------
40 //-------------------------------------------------------------------------
42 class WXDLLIMPEXP_CORE wxDirDialogBase
: public wxDialog
46 wxDirDialogBase(wxWindow
*parent
,
47 const wxString
& title
= wxDirSelectorPromptStr
,
48 const wxString
& defaultPath
= wxEmptyString
,
49 long style
= wxDD_DEFAULT_STYLE
,
50 const wxPoint
& pos
= wxDefaultPosition
,
51 const wxSize
& sz
= wxDefaultSize
,
52 const wxString
& name
= wxDirDialogNameStr
)
54 Create(parent
, title
, defaultPath
, style
, pos
, sz
, name
);
57 virtual ~wxDirDialogBase() {}
60 bool Create(wxWindow
*parent
,
61 const wxString
& title
= wxDirSelectorPromptStr
,
62 const wxString
& defaultPath
= wxEmptyString
,
63 long style
= wxDD_DEFAULT_STYLE
,
64 const wxPoint
& pos
= wxDefaultPosition
,
65 const wxSize
& sz
= wxDefaultSize
,
66 const wxString
& name
= wxDirDialogNameStr
)
68 if (!wxDialog::Create(parent
, wxID_ANY
, title
, pos
, sz
, style
, name
))
75 #if WXWIN_COMPATIBILITY_2_6
77 wxDEPRECATED( long GetStyle() const );
78 wxDEPRECATED( void SetStyle(long style
) );
80 #endif // WXWIN_COMPATIBILITY_2_6
82 virtual void SetMessage(const wxString
& message
) { m_message
= message
; }
83 virtual void SetPath(const wxString
& path
) { m_path
= path
; }
85 virtual wxString
GetMessage() const { return m_message
; }
86 virtual wxString
GetPath() const { return m_path
; }
94 // Universal and non-port related switches with need for generic implementation
95 #if defined(__WXUNIVERSAL__)
96 #include "wx/generic/dirdlgg.h"
97 #define wxDirDialog wxGenericDirDialog
98 #elif defined(__WXMSW__) && (!wxUSE_OLE || \
99 (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
100 #include "wx/generic/dirdlgg.h"
101 #define wxDirDialog wxGenericDirDialog
102 #elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
103 #include "wx/generic/dirdlgg.h" // MS PocketPC or MS Smartphone
104 #define wxDirDialog wxGenericDirDialog
105 #elif defined(__WXMSW__)
106 #include "wx/msw/dirdlg.h" // Native MSW
107 #elif defined(__WXGTK20__)
108 #include "wx/gtk/dirdlg.h" // Native GTK for gtk2.4
109 #elif defined(__WXGTK__)
110 #include "wx/generic/dirdlgg.h"
111 #define wxDirDialog wxGenericDirDialog
112 #elif defined(__WXMAC__)
113 #include "wx/osx/dirdlg.h" // Native Mac
114 #elif defined(__WXCOCOA__)
115 #include "wx/cocoa/dirdlg.h" // Native Cocoa
116 #elif defined(__WXMOTIF__) || \
117 defined(__WXX11__) || \
118 defined(__WXCOCOA__) || \
120 #include "wx/generic/dirdlgg.h" // Other ports use generic implementation
121 #define wxDirDialog wxGenericDirDialog
124 // ----------------------------------------------------------------------------
125 // common ::wxDirSelector() function
126 // ----------------------------------------------------------------------------
128 WXDLLIMPEXP_CORE wxString
129 wxDirSelector(const wxString
& message
= wxDirSelectorPromptStr
,
130 const wxString
& defaultPath
= wxEmptyString
,
131 long style
= wxDD_DEFAULT_STYLE
,
132 const wxPoint
& pos
= wxDefaultPosition
,
133 wxWindow
*parent
= NULL
);
135 #endif // wxUSE_DIRDLG
138 // _WX_DIRDLG_H_BASE_