dirdlgg.h 3.1 KB

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