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
11 // Copyright: (c) Robert Roebling, Harm van der Heijden, Julian Smart
12 // Licence: wxWindows licence
13 /////////////////////////////////////////////////////////////////////////////
15 #ifndef _WX_DIRDLGG_H_
16 #define _WX_DIRDLGG_H_
18 class WXDLLEXPORT wxGenericDirCtrl
;
19 class WXDLLEXPORT wxTextCtrl
;
20 class WXDLLEXPORT wxTreeEvent
;
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 #ifndef wxDD_DEFAULT_STYLE
28 #define wxDD_DEFAULT_STYLE \
29 (wxDEFAULT_DIALOG_STYLE | wxDD_NEW_DIR_BUTTON)
31 #define wxDD_DEFAULT_STYLE \
32 (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON)
36 #include "wx/dialog.h"
38 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
42 class WXDLLEXPORT wxGenericDirDialog
: public wxDialog
45 wxGenericDirDialog() : wxDialog() { }
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
= wxSize(450, 550),
53 const wxString
& name
= wxDirDialogNameStr
);
56 void SetMessage(const wxString
& message
) { m_message
= message
; }
57 void SetPath(const wxString
& path
);
58 void SetStyle(long style
) { m_dialogStyle
= style
; }
60 wxString
GetMessage() const { return m_message
; }
61 wxString
GetPath() const;
62 long GetStyle() const { return m_dialogStyle
; }
65 virtual int ShowModal();
67 // this one is specific to wxGenericDirDialog
68 wxTextCtrl
* GetInputCtrl() const { return m_input
; }
72 void OnCloseWindow(wxCloseEvent
& event
);
73 void OnOK(wxCommandEvent
& event
);
74 void OnTreeSelected(wxTreeEvent
&event
);
75 void OnTreeKeyDown(wxTreeEvent
&event
);
76 void OnNew(wxCommandEvent
& event
);
77 void OnGoHome(wxCommandEvent
& event
);
78 void OnShowHidden(wxCommandEvent
& event
);
83 wxGenericDirCtrl
* m_dirCtrl
;
87 DECLARE_DYNAMIC_CLASS(wxGenericDirDialog
)
90 #endif // _WX_DIRDLGG_H_