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_DIR_MUST_EXIST 0x0080
28 #define wxDD_CHANGE_DIR 0x0100
31 #define wxDD_DEFAULT_STYLE wxDEFAULT_DIALOG_STYLE
33 #define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
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__)
88 #include "wx/generic/dirdlgg.h"
89 #define wxDirDialog wxGenericDirDialog
90 #elif defined(__WXMSW__) && (defined(__SALFORDC__) || \
92 (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
93 #include "wx/generic/dirdlgg.h"
94 #define wxDirDialog wxGenericDirDialog
95 #elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
96 #include "wx/generic/dirdlgg.h" // MS PocketPC or MS Smartphone
97 #define wxDirDialog wxGenericDirDialog
98 #elif defined(__WXMSW__)
99 #include "wx/msw/dirdlg.h" // Native MSW
100 #elif defined(__WXGTK24__)
101 #include "wx/gtk/dirdlg.h" // Native GTK for gtk2.4
102 #elif defined(__WXGTK__)
103 #include "wx/generic/dirdlgg.h"
104 #define wxDirDialog wxGenericDirDialog
105 #elif defined(__WXMAC__)
106 #include "wx/mac/dirdlg.h" // Native Mac
107 #elif defined(__WXCOCOA__)
108 #include "wx/cocoa/dirdlg.h" // Native Cocoa
109 #elif defined(__WXMOTIF__) || \
110 defined(__WXX11__) || \
111 defined(__WXMGL__) || \
112 defined(__WXCOCOA__) || \
114 #include "wx/generic/dirdlgg.h" // Other ports use generic implementation
115 #define wxDirDialog wxGenericDirDialog
118 // ----------------------------------------------------------------------------
119 // common ::wxDirSelector() function
120 // ----------------------------------------------------------------------------
123 wxDirSelector(const wxString
& message
= wxDirSelectorPromptStr
,
124 const wxString
& defaultPath
= wxEmptyString
,
125 long style
= wxDD_DEFAULT_STYLE
,
126 const wxPoint
& pos
= wxDefaultPosition
,
127 wxWindow
*parent
= NULL
);
129 #endif // wxUSE_DIRDLG
132 // _WX_DIRDLG_H_BASE_