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
[];
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 WXDLLEXPORT 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
))
77 virtual void SetMessage(const wxString
& message
) { m_message
= message
; }
78 virtual void SetPath(const wxString
& path
) { m_path
= path
; }
80 virtual wxString
GetMessage() const { return m_message
; }
81 virtual wxString
GetPath() const { return m_path
; }
89 // Universal and non-port related switches with need for generic implementation
90 #if defined(__WXUNIVERSAL__)
91 #include "wx/generic/dirdlgg.h"
92 #define wxDirDialog wxGenericDirDialog
93 #elif defined(__WXMSW__) && (defined(__SALFORDC__) || \
95 (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
96 #include "wx/generic/dirdlgg.h"
97 #define wxDirDialog wxGenericDirDialog
98 #elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
99 #include "wx/generic/dirdlgg.h" // MS PocketPC or MS Smartphone
100 #define wxDirDialog wxGenericDirDialog
101 #elif defined(__WXMSW__)
102 #include "wx/msw/dirdlg.h" // Native MSW
103 #elif defined(__WXGTK24__)
104 #include "wx/gtk/dirdlg.h" // Native GTK for gtk2.4
105 #elif defined(__WXGTK__)
106 #include "wx/generic/dirdlgg.h"
107 #define wxDirDialog wxGenericDirDialog
108 #elif defined(__WXMAC__)
109 #include "wx/mac/dirdlg.h" // Native Mac
110 #elif defined(__WXCOCOA__)
111 #include "wx/cocoa/dirdlg.h" // Native Cocoa
112 #elif defined(__WXMOTIF__) || \
113 defined(__WXX11__) || \
114 defined(__WXMGL__) || \
115 defined(__WXCOCOA__) || \
117 #include "wx/generic/dirdlgg.h" // Other ports use generic implementation
118 #define wxDirDialog wxGenericDirDialog
121 // ----------------------------------------------------------------------------
122 // common ::wxDirSelector() function
123 // ----------------------------------------------------------------------------
126 wxDirSelector(const wxString
& message
= wxDirSelectorPromptStr
,
127 const wxString
& defaultPath
= wxEmptyString
,
128 long style
= wxDD_DEFAULT_STYLE
,
129 const wxPoint
& pos
= wxDefaultPosition
,
130 wxWindow
*parent
= NULL
);
132 #endif // wxUSE_DIRDLG
135 // _WX_DIRDLG_H_BASE_