]>
Commit | Line | Data |
---|---|---|
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 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) | |
19 | #pragma interface "dirdlgg.h" | |
20 | #endif | |
21 | ||
22 | class WXDLLEXPORT wxGenericDirCtrl; | |
23 | class WXDLLEXPORT wxTextCtrl; | |
24 | class WXDLLEXPORT wxTreeEvent; | |
25 | ||
26 | // we may be included directly as well as from wx/dirdlg.h (FIXME) | |
27 | WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogNameStr; | |
28 | WXDLLEXPORT_DATA(extern const wxChar*) wxDirSelectorPromptStr; | |
29 | #ifndef wxDD_DEFAULT_STYLE | |
30 | #define wxDD_DEFAULT_STYLE \ | |
31 | (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON) | |
32 | #endif | |
33 | ||
34 | #include "wx/dialog.h" | |
35 | ||
36 | //----------------------------------------------------------------------------- | |
37 | // wxGenericDirDialog | |
38 | //----------------------------------------------------------------------------- | |
39 | ||
40 | class WXDLLEXPORT wxGenericDirDialog : public wxDialog | |
41 | { | |
42 | public: | |
43 | wxGenericDirDialog() : wxDialog() { } | |
44 | ||
45 | wxGenericDirDialog(wxWindow* parent, | |
46 | const wxString& title = wxDirSelectorPromptStr, | |
47 | const wxString& defaultPath = wxEmptyString, | |
48 | long style = wxDD_DEFAULT_STYLE, | |
49 | const wxPoint& pos = wxDefaultPosition, | |
50 | const wxSize& sz = wxSize(450, 550), | |
51 | const wxString& name = wxDirDialogNameStr); | |
52 | ||
53 | //// Accessors | |
54 | void SetMessage(const wxString& message) { m_message = message; } | |
55 | void SetPath(const wxString& path); | |
56 | void SetStyle(long style) { m_dialogStyle = style; } | |
57 | ||
58 | wxString GetMessage() const { return m_message; } | |
59 | wxString GetPath() const; | |
60 | long GetStyle() const { return m_dialogStyle; } | |
61 | ||
62 | //// Overrides | |
63 | virtual int ShowModal(); | |
64 | ||
65 | // this one is specific to wxGenericDirDialog | |
66 | wxTextCtrl* GetInputCtrl() const { return m_input; } | |
67 | ||
68 | protected: | |
69 | //// Event handlers | |
70 | void OnCloseWindow(wxCloseEvent& event); | |
71 | void OnOK(wxCommandEvent& event); | |
72 | void OnTreeSelected(wxTreeEvent &event); | |
73 | void OnTreeKeyDown(wxTreeEvent &event); | |
74 | void OnNew(wxCommandEvent& event); | |
75 | void OnGoHome(wxCommandEvent& event); | |
76 | void OnShowHidden(wxCommandEvent& event); | |
77 | ||
78 | wxString m_message; | |
79 | long m_dialogStyle; | |
80 | wxString m_path; | |
81 | wxGenericDirCtrl* m_dirCtrl; | |
82 | wxTextCtrl* m_input; | |
83 | ||
84 | DECLARE_EVENT_TABLE() | |
85 | DECLARE_DYNAMIC_CLASS(wxGenericDirDialog) | |
86 | }; | |
87 | ||
88 | #endif // _WX_DIRDLGG_H_ |