wxMessageBox off the main thread lost result code.
[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 // 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 #ifdef __WXWINCE__
27 #define wxDD_DEFAULT_STYLE wxDEFAULT_DIALOG_STYLE
28 #else
29 #define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
30 #endif
31 #endif
32
33 #include "wx/dialog.h"
34
35 //-----------------------------------------------------------------------------
36 // wxGenericDirDialog
37 //-----------------------------------------------------------------------------
38
39 class WXDLLIMPEXP_CORE wxGenericDirDialog : public wxDirDialogBase
40 {
41 public:
42 wxGenericDirDialog() : wxDirDialogBase() { }
43
44 wxGenericDirDialog(wxWindow* parent,
45 const wxString& title = wxDirSelectorPromptStr,
46 const wxString& defaultPath = wxEmptyString,
47 long style = wxDD_DEFAULT_STYLE,
48 const wxPoint& pos = wxDefaultPosition,
49 const wxSize& sz = wxDefaultSize,//Size(450, 550),
50 const wxString& name = wxDirDialogNameStr);
51
52 bool Create(wxWindow* parent,
53 const wxString& title = wxDirSelectorPromptStr,
54 const wxString& defaultPath = wxEmptyString,
55 long style = wxDD_DEFAULT_STYLE,
56 const wxPoint& pos = wxDefaultPosition,
57 const wxSize& sz = wxDefaultSize,//Size(450, 550),
58 const wxString& name = wxDirDialogNameStr);
59
60 //// Accessors
61 void SetPath(const wxString& path);
62 wxString GetPath() const;
63
64 //// Overrides
65 virtual int ShowModal();
66 virtual void EndModal(int retCode);
67
68 // this one is specific to wxGenericDirDialog
69 wxTextCtrl* GetInputCtrl() const { return m_input; }
70
71 protected:
72 //// Event handlers
73 void OnCloseWindow(wxCloseEvent& event);
74 void OnOK(wxCommandEvent& event);
75 void OnTreeSelected(wxTreeEvent &event);
76 void OnTreeKeyDown(wxTreeEvent &event);
77 void OnNew(wxCommandEvent& event);
78 void OnGoHome(wxCommandEvent& event);
79 void OnShowHidden(wxCommandEvent& event);
80
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_