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 WXDLLEXPORT_DATA(const wxChar
) wxDirDialogNameStr
[];
24 extern WXDLLEXPORT_DATA(const wxChar
) wxDirDialogDefaultFolderStr
[];
25 extern WXDLLEXPORT_DATA(const wxChar
) wxDirSelectorPromptStr
[];
29 #define wxDD_DEFAULT_STYLE \
30 (wxDEFAULT_DIALOG_STYLE | wxDD_NEW_DIR_BUTTON)
32 #define wxDD_DEFAULT_STYLE \
33 (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON)
36 //-------------------------------------------------------------------------
38 //-------------------------------------------------------------------------
40 class WXDLLEXPORT wxDirDialogBase
: public wxDialog
44 wxDirDialogBase(wxWindow
*parent
,
45 const wxString
& title
= wxDirSelectorPromptStr
,
46 const wxString
& defaultPath
= wxEmptyString
,
47 long style
= wxDD_DEFAULT_STYLE
,
48 const wxPoint
& pos
= wxDefaultPosition
,
49 const wxSize
& sz
= wxDefaultSize
,
50 const wxString
& name
= wxDirDialogNameStr
)
52 Create(parent
, title
, defaultPath
, style
, pos
, sz
, name
);
55 virtual ~wxDirDialogBase() {}
58 bool Create(wxWindow
*parent
,
59 const wxString
& title
= wxDirSelectorPromptStr
,
60 const wxString
& defaultPath
= wxEmptyString
,
61 long style
= wxDD_DEFAULT_STYLE
,
62 const wxPoint
& pos
= wxDefaultPosition
,
63 const wxSize
& sz
= wxDefaultSize
,
64 const wxString
& name
= wxDirDialogNameStr
)
66 if (!wxDialog::Create(parent
, wxID_ANY
, title
, pos
, sz
, style
, name
))
74 virtual void SetMessage(const wxString
& message
) { m_message
= message
; }
75 virtual void SetPath(const wxString
& path
) { m_path
= path
; }
77 virtual wxString
GetMessage() const { return m_message
; }
78 virtual wxString
GetPath() const { return m_path
; }
86 // Universal and non-port related switches with need for generic implementation
87 #if defined(__WXUNIVERSAL__)
89 #include "wx/generic/dirdlgg.h"
90 #define wxDirDialog wxGenericDirDialog
92 #elif defined(__WXMSW__) && (defined(__SALFORDC__) || \
94 (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
96 #include "wx/generic/dirdlgg.h"
97 #define wxDirDialog wxGenericDirDialog
99 // MS PocketPC or MS Smartphone
100 #elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
102 #include "wx/generic/dirdlgg.h"
103 #define wxDirDialog wxGenericDirDialog
106 #elif defined(__WXMSW__)
108 #include "wx/msw/dirdlg.h"
110 // Native GTK for gtk2.x and generic for gtk1.x
111 #elif defined(__WXGTK__)
113 #if defined( __WXGTK20__ )
114 #include "wx/gtk/dirdlg.h"
115 #define wxDirDialog wxDirDialogGTK
117 #include "wx/generic/dirdlgg.h"
118 #define wxDirDialog wxGenericDirDialog
122 #elif defined(__WXMAC__)
124 #include "wx/mac/dirdlg.h"
127 #elif defined(__WXCOCOA__)
129 #include "wx/cocoa/dirdlg.h"
131 // Other ports use generic implementation
132 #elif defined(__WXMOTIF__) || \
133 defined(__WXX11__) || \
134 defined(__WXMGL__) || \
135 defined(__WXCOCOA__) || \
138 #include "wx/generic/dirdlgg.h"
139 #define wxDirDialog wxGenericDirDialog
143 // ----------------------------------------------------------------------------
144 // common ::wxDirSelector() function
145 // ----------------------------------------------------------------------------
148 wxDirSelector(const wxString
& message
= wxDirSelectorPromptStr
,
149 const wxString
& defaultPath
= wxEmptyString
,
150 long style
= wxDD_DEFAULT_STYLE
,
151 const wxPoint
& pos
= wxDefaultPosition
,
152 wxWindow
*parent
= NULL
);
154 #endif // wxUSE_DIRDLG
157 // _WX_DIRDLG_H_BASE_