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
43 wxDirDialogBase(wxWindow
*parent
,
44 const wxString
& title
= wxDirSelectorPromptStr
,
45 const wxString
& defaultPath
= wxEmptyString
,
46 long style
= wxDD_DEFAULT_STYLE
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& sz
= wxDefaultSize
,
49 const wxString
& name
= wxDirDialogNameStr
)
50 : wxDialog(parent
, wxID_ANY
, title
, pos
, sz
, style
, name
)
55 virtual ~wxDirDialogBase() {}
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
); }
61 virtual wxString
GetMessage() const { return m_message
; }
62 virtual wxString
GetPath() const { return m_path
; }
63 virtual long GetStyle() const { return GetWindowStyle(); }
71 // Universal and non-port related switches with need for generic implementation
72 #if defined(__WXMSW__) && (defined(__WXUNIVERSAL__) || \
73 defined(__SALFORDC__) || \
75 (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
77 #include "wx/generic/dirdlgg.h"
78 #define wxDirDialog wxGenericDirDialog
80 // MS PocketPC or MS Smartphone
81 #elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
83 #include "wx/generic/dirdlgg.h"
84 #define wxDirDialog wxGenericDirDialog
87 #elif defined(__WXMSW__)
89 #include "wx/msw/dirdlg.h"
91 // Native GTK for gtk2.x and generic for gtk1.x
92 #elif defined(__WXGTK__)
94 #if defined( __WXGTK20__ )
95 #include "wx/gtk/dirdlg.h"
96 #define wxDirDialog wxDirDialogGTK
98 #include "wx/generic/dirdlgg.h"
99 #define wxDirDialog wxGenericDirDialog
103 #elif defined(__WXMAC__)
105 #include "wx/mac/dirdlg.h"
108 #elif defined(__WXCOCOA__)
110 #include "wx/cocoa/dirdlg.h"
112 // Other ports use generic implementation
113 #elif defined(__WXMOTIF__) || \
114 defined(__WXX11__) || \
115 defined(__WXMGL__) || \
116 defined(__WXCOCOA__) || \
119 #include "wx/generic/dirdlgg.h"
120 #define wxDirDialog wxGenericDirDialog
124 // ----------------------------------------------------------------------------
125 // common ::wxDirSelector() function
126 // ----------------------------------------------------------------------------
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_