]> git.saurik.com Git - wxWidgets.git/blob - include/wx/dirdlg.h
int -> unsigned int in wxListBox docs.
[wxWidgets.git] / include / wx / dirdlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/dirdlg.h
3 // Purpose: wxDirDialog base class
4 // Author: Robert Roebling
5 // Modified by:
6 // Created:
7 // Copyright: (c) Robert Roebling
8 // RCS-ID: $Id$
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DIRDLG_H_BASE_
13 #define _WX_DIRDLG_H_BASE_
14
15 #if wxUSE_DIRDLG
16
17 #include "wx/dialog.h"
18
19 // ----------------------------------------------------------------------------
20 // constants
21 // ----------------------------------------------------------------------------
22
23 extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogNameStr[];
24 extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogDefaultFolderStr[];
25 extern WXDLLEXPORT_DATA(const wxChar) wxDirSelectorPromptStr[];
26
27
28 #ifdef __WXWINCE__
29 #define wxDD_DEFAULT_STYLE \
30 (wxDEFAULT_DIALOG_STYLE | wxDD_NEW_DIR_BUTTON)
31 #else
32 #define wxDD_DEFAULT_STYLE \
33 (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON)
34 #endif
35
36 //-------------------------------------------------------------------------
37 // wxDirDialogBase
38 //-------------------------------------------------------------------------
39
40 class WXDLLEXPORT wxDirDialogBase : public wxDialog
41 {
42 public:
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) {}
51 wxDirDialogBase() {}
52
53 virtual ~wxDirDialogBase() {}
54
55 virtual void SetMessage(const wxString& message) { m_message = message; }
56 virtual void SetPath(const wxString& path) { m_path = path; }
57 virtual void SetStyle(long style) { SetWindowStyle(style); }
58
59 virtual wxString GetMessage() const { return m_message; }
60 virtual wxString GetPath() const { return m_path; }
61 virtual long GetStyle() const { return GetWindowStyle(); }
62
63 protected:
64 wxString m_message;
65 wxString m_path;
66 };
67
68
69 // Universal and non-port related switches with need for generic implementation
70 #if defined(__WXMSW__) && (defined(__WXUNIVERSAL__) || \
71 defined(__SALFORDC__) || \
72 !wxUSE_OLE || \
73 (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
74
75 #include "wx/generic/dirdlgg.h"
76 #define wxDirDialog wxGenericDirDialog
77
78 // MS PocketPC or MS Smartphone
79 #elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
80
81 #include "wx/generic/dirdlgg.h"
82 #define wxDirDialog wxGenericDirDialog
83
84 // Native MSW
85 #elif defined(__WXMSW__)
86
87 #include "wx/msw/dirdlg.h"
88
89 // Native GTK
90 #elif defined(__WXGTK__)
91
92 #include "wx/gtk/dirdlg.h"
93 #define wxDirDialog wxDirDialogGTK
94
95 // Native Mac
96 #elif defined(__WXMAC__)
97
98 #include "wx/mac/dirdlg.h"
99
100 // Native Cocoa
101 #elif defined(__WXCOCOA__)
102
103 #include "wx/cocoa/dirdlg.h"
104
105 // Other ports use generic implementation
106 #elif defined(__WXMOTIF__) || \
107 defined(__WXX11__) || \
108 defined(__WXMGL__) || \
109 defined(__WXCOCOA__) || \
110 defined(__WXPM__)
111
112 #include "wx/generic/dirdlgg.h"
113 #define wxDirDialog wxGenericDirDialog
114
115 #endif
116
117 // ----------------------------------------------------------------------------
118 // common ::wxDirSelector() function
119 // ----------------------------------------------------------------------------
120
121 WXDLLEXPORT wxString
122 wxDirSelector(const wxString& message = wxDirSelectorPromptStr,
123 const wxString& defaultPath = wxEmptyString,
124 long style = wxDD_DEFAULT_STYLE,
125 const wxPoint& pos = wxDefaultPosition,
126 wxWindow *parent = NULL);
127
128 #endif // wxUSE_DIRDLG
129
130 #endif
131 // _WX_DIRDLG_H_BASE_