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
))
76 #if WXWIN_COMPATIBILITY_2_6
78 wxDEPRECATED( long GetStyle() const );
79 wxDEPRECATED( void SetStyle(long style
) );
81 #endif // WXWIN_COMPATIBILITY_2_6
83 virtual void SetMessage(const wxString
& message
) { m_message
= message
; }
84 virtual void SetPath(const wxString
& path
) { m_path
= path
; }
86 virtual wxString
GetMessage() const { return m_message
; }
87 virtual wxString
GetPath() const { return m_path
; }
95 // Universal and non-port related switches with need for generic implementation
96 #if defined(__WXUNIVERSAL__)
97 #include "wx/generic/dirdlgg.h"
98 #define wxDirDialog wxGenericDirDialog
99 #elif defined(__WXMSW__) && (defined(__SALFORDC__) || \
101 (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
102 #include "wx/generic/dirdlgg.h"
103 #define wxDirDialog wxGenericDirDialog
104 #elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
105 #include "wx/generic/dirdlgg.h" // MS PocketPC or MS Smartphone
106 #define wxDirDialog wxGenericDirDialog
107 #elif defined(__WXMSW__)
108 #include "wx/msw/dirdlg.h" // Native MSW
109 #elif defined(__WXGTK20__)
110 #include "wx/gtk/dirdlg.h" // Native GTK for gtk2.4
111 #elif defined(__WXGTK__)
112 #include "wx/generic/dirdlgg.h"
113 #define wxDirDialog wxGenericDirDialog
114 #elif defined(__WXMAC__)
115 #include "wx/mac/dirdlg.h" // Native Mac
116 #elif defined(__WXCOCOA__)
117 #include "wx/cocoa/dirdlg.h" // Native Cocoa
118 #elif defined(__WXMOTIF__) || \
119 defined(__WXX11__) || \
120 defined(__WXMGL__) || \
121 defined(__WXCOCOA__) || \
123 #include "wx/generic/dirdlgg.h" // Other ports use generic implementation
124 #define wxDirDialog wxGenericDirDialog
127 // ----------------------------------------------------------------------------
128 // common ::wxDirSelector() function
129 // ----------------------------------------------------------------------------
132 wxDirSelector(const wxString
& message
= wxDirSelectorPromptStr
,
133 const wxString
& defaultPath
= wxEmptyString
,
134 long style
= wxDD_DEFAULT_STYLE
,
135 const wxPoint
& pos
= wxDefaultPosition
,
136 wxWindow
*parent
= NULL
);
138 #endif // wxUSE_DIRDLG
141 // _WX_DIRDLG_H_BASE_