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 // Copyright:   (c) Robert Roebling, Harm van der Heijden, Julian Smart
11 // Licence:     wxWindows licence
12 /////////////////////////////////////////////////////////////////////////////
13 
14 #ifndef _WX_DIRDLGG_H_
15 #define _WX_DIRDLGG_H_
16 
17 class WXDLLIMPEXP_FWD_CORE wxGenericDirCtrl;
18 class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
19 class WXDLLIMPEXP_FWD_CORE wxTreeEvent;
20 
21 // we may be included directly as well as from wx/dirdlg.h (FIXME)
22 extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogNameStr[];
23 extern WXDLLIMPEXP_DATA_CORE(const char) wxDirSelectorPromptStr[];
24 
25 #ifndef wxDD_DEFAULT_STYLE
26 #define wxDD_DEFAULT_STYLE      (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
27 #endif
28 
29 #include "wx/dialog.h"
30 
31 //-----------------------------------------------------------------------------
32 // wxGenericDirDialog
33 //-----------------------------------------------------------------------------
34 
35 class WXDLLIMPEXP_CORE wxGenericDirDialog : public wxDirDialogBase
36 {
37 public:
wxGenericDirDialog()38     wxGenericDirDialog() : wxDirDialogBase() { }
39 
40     wxGenericDirDialog(wxWindow* parent,
41                        const wxString& title = wxASCII_STR(wxDirSelectorPromptStr),
42                        const wxString& defaultPath = wxEmptyString,
43                        long style = wxDD_DEFAULT_STYLE,
44                        const wxPoint& pos = wxDefaultPosition,
45                        const wxSize& sz = wxDefaultSize,//Size(450, 550),
46                        const wxString& name = wxASCII_STR(wxDirDialogNameStr));
47 
48     bool Create(wxWindow* parent,
49                 const wxString& title = wxASCII_STR(wxDirSelectorPromptStr),
50                 const wxString& defaultPath = wxEmptyString,
51                 long style = wxDD_DEFAULT_STYLE,
52                 const wxPoint& pos = wxDefaultPosition,
53                 const wxSize& sz = wxDefaultSize,//Size(450, 550),
54                 const wxString& name = wxASCII_STR(wxDirDialogNameStr));
55 
56     //// Accessors
57     void SetPath(const wxString& path) wxOVERRIDE;
58     wxString GetPath() const wxOVERRIDE;
59 
60     //// Overrides
61     virtual int ShowModal() wxOVERRIDE;
62     virtual void EndModal(int retCode) wxOVERRIDE;
63 
64     // this one is specific to wxGenericDirDialog
GetInputCtrl()65     wxTextCtrl* GetInputCtrl() const { return m_input; }
66 
67 protected:
68     //// Event handlers
69     void OnCloseWindow(wxCloseEvent& event);
70     void OnOK(wxCommandEvent& event);
71     void OnTreeSelected(wxTreeEvent &event);
72     void OnTreeKeyDown(wxTreeEvent &event);
73     void OnNew(wxCommandEvent& event);
74     void OnGoHome(wxCommandEvent& event);
75     void OnShowHidden(wxCommandEvent& event);
76 
77     wxGenericDirCtrl* m_dirCtrl;
78     wxTextCtrl*       m_input;
79 
80     wxDECLARE_EVENT_TABLE();
81     wxDECLARE_DYNAMIC_CLASS(wxGenericDirDialog);
82 };
83 
84 #endif // _WX_DIRDLGG_H_
85