]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/dirdlgg.h
non-pch universal build fix: combo.h should not include combobox.h
[wxWidgets.git] / include / wx / generic / dirdlgg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/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 class WXDLLEXPORT wxGenericDirCtrl;
19 class WXDLLEXPORT wxTextCtrl;
20 class WXDLLEXPORT wxTreeEvent;
21
22 // we may be included directly as well as from wx/dirdlg.h (FIXME)
23 extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogNameStr[];
24 extern WXDLLEXPORT_DATA(const wxChar) wxDirSelectorPromptStr[];
25
26 #ifndef wxDD_DEFAULT_STYLE
27 #ifdef __WXWINCE__
28 #define wxDD_DEFAULT_STYLE \
29 (wxDEFAULT_DIALOG_STYLE | wxDD_NEW_DIR_BUTTON)
30 #else
31 #define wxDD_DEFAULT_STYLE \
32 (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON)
33 #endif
34 #endif
35
36 #include "wx/dialog.h"
37
38 //-----------------------------------------------------------------------------
39 // wxGenericDirDialog
40 //-----------------------------------------------------------------------------
41
42 class WXDLLEXPORT wxGenericDirDialog : public wxDirDialogBase
43 {
44 public:
45 wxGenericDirDialog() : wxDirDialogBase() { }
46
47 wxGenericDirDialog(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,//Size(450, 550),
53 const wxString& name = wxDirDialogNameStr);
54
55 bool Create(wxWindow* parent,
56 const wxString& title = wxDirSelectorPromptStr,
57 const wxString& defaultPath = wxEmptyString,
58 long style = wxDD_DEFAULT_STYLE,
59 const wxPoint& pos = wxDefaultPosition,
60 const wxSize& sz = wxDefaultSize,//Size(450, 550),
61 const wxString& name = wxDirDialogNameStr);
62
63 //// Accessors
64 void SetPath(const wxString& path);
65 wxString GetPath() const;
66
67 //// Overrides
68 virtual int ShowModal();
69 virtual void EndModal(int retCode);
70
71 // this one is specific to wxGenericDirDialog
72 wxTextCtrl* GetInputCtrl() const { return m_input; }
73
74 protected:
75 //// Event handlers
76 void OnCloseWindow(wxCloseEvent& event);
77 void OnOK(wxCommandEvent& event);
78 void OnTreeSelected(wxTreeEvent &event);
79 void OnTreeKeyDown(wxTreeEvent &event);
80 void OnNew(wxCommandEvent& event);
81 void OnGoHome(wxCommandEvent& event);
82 void OnShowHidden(wxCommandEvent& event);
83
84 wxGenericDirCtrl* m_dirCtrl;
85 wxTextCtrl* m_input;
86
87 DECLARE_EVENT_TABLE()
88 DECLARE_DYNAMIC_CLASS(wxGenericDirDialog)
89 };
90
91 #endif // _WX_DIRDLGG_H_