wxDirDialog now has the same ctor under all platforms and also uses the
[wxWidgets.git] / include / wx / generic / dirdlgg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dirdlgg.h
3 // Purpose: wxGenericDirCtrl class
4 // Builds on wxDirCtrl class written by Robert Roebling for the
5 // wxFile application, modified by Harm van der Heijden.
6 // Further modified for Windows.
7 // Author: Robert Roebling, Harm van der Heijden, Julian Smart et al
8 // Modified by:
9 // Created: 21/3/2000
10 // RCS-ID: $Id$
11 // Copyright: (c) Robert Roebling, Harm van der Heijden, Julian Smart
12 // Licence: wxWindows licence
13 /////////////////////////////////////////////////////////////////////////////
14
15 #ifndef _WX_DIRDLGG_H_
16 #define _WX_DIRDLGG_H_
17
18 #ifdef __GNUG__
19 #pragma interface "dirdlgg.h"
20 #endif
21
22 class WXDLLEXPORT wxGenericDirCtrl;
23 class WXDLLEXPORT wxTextCtrl;
24 class WXDLLEXPORT wxTreeEvent;
25
26 //-----------------------------------------------------------------------------
27 // wxGenericDirDialog
28 //-----------------------------------------------------------------------------
29
30 class WXDLLEXPORT wxGenericDirDialog: public wxDialog
31 {
32 public:
33 wxGenericDirDialog() : wxDialog() { }
34
35 wxGenericDirDialog(wxWindow* parent,
36 const wxString& title = wxDirSelectorPromptStr,
37 const wxString& defaultPath = wxEmptyString,
38 long style = wxDD_DEFAULT_STYLE,
39 const wxPoint& pos = wxDefaultPosition,
40 const wxSize& sz = wxSize(450, 550),
41 const wxString& name = wxDirDialogNameStr);
42
43 //// Accessors
44 inline void SetMessage(const wxString& message) { m_message = message; }
45 void SetPath(const wxString& path);
46 inline void SetStyle(long style) { m_dialogStyle = style; }
47
48 inline wxString GetMessage(void) const { return m_message; }
49 wxString GetPath(void) const;
50 inline long GetStyle(void) const { return m_dialogStyle; }
51
52 wxTextCtrl* GetInputCtrl() const { return m_input; }
53
54 //// Overrides
55 int ShowModal();
56
57 protected:
58 //// Event handlers
59 void OnCloseWindow(wxCloseEvent& event);
60 void OnOK(wxCommandEvent& event);
61 void OnTreeSelected(wxTreeEvent &event);
62 void OnTreeKeyDown(wxTreeEvent &event);
63 void OnNew(wxCommandEvent& event);
64 void OnGoHome(wxCommandEvent& event);
65 void OnShowHidden(wxCommandEvent& event);
66
67 wxString m_message;
68 long m_dialogStyle;
69 wxString m_path;
70 wxGenericDirCtrl* m_dirCtrl;
71 wxTextCtrl* m_input;
72
73 DECLARE_EVENT_TABLE()
74 };
75
76 #endif // _WX_DIRDLGG_H_