]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/dirdlgg.h
[1231183] 'cleanup: mismatched indentation' and other cleanings.
[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 #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 extern WXDLLEXPORT_DATA(const wxChar*) wxDirDialogNameStr;
28 extern WXDLLEXPORT_DATA(const wxChar*) wxDirSelectorPromptStr;
29 #ifndef wxDD_DEFAULT_STYLE
30
31 #ifdef __WXWINCE__
32 #define wxDD_DEFAULT_STYLE \
33 (wxDEFAULT_DIALOG_STYLE | wxDD_NEW_DIR_BUTTON)
34 #else
35 #define wxDD_DEFAULT_STYLE \
36 (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON)
37 #endif
38 #endif
39
40 #include "wx/dialog.h"
41
42 //-----------------------------------------------------------------------------
43 // wxGenericDirDialog
44 //-----------------------------------------------------------------------------
45
46 class WXDLLEXPORT wxGenericDirDialog : public wxDialog
47 {
48 public:
49 wxGenericDirDialog() : wxDialog() { }
50
51 wxGenericDirDialog(wxWindow* parent,
52 const wxString& title = wxDirSelectorPromptStr,
53 const wxString& defaultPath = wxEmptyString,
54 long style = wxDD_DEFAULT_STYLE,
55 const wxPoint& pos = wxDefaultPosition,
56 const wxSize& sz = wxSize(450, 550),
57 const wxString& name = wxDirDialogNameStr);
58
59 //// Accessors
60 void SetMessage(const wxString& message) { m_message = message; }
61 void SetPath(const wxString& path);
62 void SetStyle(long style) { m_dialogStyle = style; }
63
64 wxString GetMessage() const { return m_message; }
65 wxString GetPath() const;
66 long GetStyle() const { return m_dialogStyle; }
67
68 //// Overrides
69 virtual int ShowModal();
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 wxString m_message;
85 long m_dialogStyle;
86 wxString m_path;
87 wxGenericDirCtrl* m_dirCtrl;
88 wxTextCtrl* m_input;
89
90 DECLARE_EVENT_TABLE()
91 DECLARE_DYNAMIC_CLASS(wxGenericDirDialog)
92 };
93
94 #endif // _WX_DIRDLGG_H_