X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d7a15103f7307a27c35a0c1cad095cda50d64aea..3e7fb41b4bf5836a5571321619cfaaedf6844361:/include/wx/generic/dirdlgg.h diff --git a/include/wx/generic/dirdlgg.h b/include/wx/generic/dirdlgg.h index 23b5997987..7fd5768b02 100644 --- a/include/wx/generic/dirdlgg.h +++ b/include/wx/generic/dirdlgg.h @@ -5,6 +5,7 @@ // Modified by: // Created: 12/12/98 // Copyright: (c) Harm van der Heijden and Robert Roebling +// RCS-ID: $Id$ // Licence: wxWindows licence // // Notes: wxDirDialog class written by Harm van der Heijden, @@ -54,23 +55,41 @@ #pragma interface "dirdlgg.h" #endif +#include "wx/defs.h" + +#if wxUSE_DIRDLG + #include "wx/dialog.h" -//#include "wx/checkbox.h" +#include "wx/checkbox.h" #include "wx/treectrl.h" -WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr; +//----------------------------------------------------------------------------- +// data +//----------------------------------------------------------------------------- + +WXDLLEXPORT_DATA(extern const wxChar*) wxFileSelectorPromptStr; +WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogDefaultFolderStr; + +//----------------------------------------------------------------------------- +// classes +//----------------------------------------------------------------------------- + +class wxDirItemData; +class wxDirCtrl; +class wxDirDialog; //----------------------------------------------------------------------------- // wxDirItemData //----------------------------------------------------------------------------- -class wxDirItemData : public wxTreeItemData +class WXDLLEXPORT wxDirItemData : public wxTreeItemData { public: wxDirItemData(wxString& path, wxString& name); ~wxDirItemData(); bool HasSubDirs(); - wxString *m_path, *m_name; + void SetNewDirName( wxString path ); + wxString m_path, m_name; bool m_isHidden; bool m_hasSubDirs; }; @@ -79,29 +98,33 @@ public: // wxDirCtrl //----------------------------------------------------------------------------- -class wxDirCtrl: public wxTreeCtrl +class WXDLLEXPORT wxDirCtrl: public wxTreeCtrl { - DECLARE_DYNAMIC_CLASS(wxDirCtrl) - - public: - bool m_showHidden; +public: + bool m_showHidden; wxTreeItemId m_rootId; - wxDirCtrl(void); + wxDirCtrl(); wxDirCtrl(wxWindow *parent, const wxWindowID id = -1, - const wxString &dir = "/", + const wxString &dir = wxDirDialogDefaultFolderStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const long style = wxTR_HAS_BUTTONS, - const wxString& name = "wxTreeCtrl" ); - void OnExpandItem( const wxTreeEvent &event ); - void OnCollapseItem( const wxTreeEvent &event ); + const wxString& name = wxTreeCtrlNameStr ); void ShowHidden( const bool yesno ); - DECLARE_EVENT_TABLE() - protected: + void OnExpandItem(wxTreeEvent &event ); + void OnCollapseItem(wxTreeEvent &event ); + void OnBeginEditItem(wxTreeEvent &event ); + void OnEndEditItem(wxTreeEvent &event ); + +protected: void CreateItems(const wxTreeItemId &parent); - void SetupSections(void); + void SetupSections(); wxArrayString m_paths, m_names; + +private: + DECLARE_EVENT_TABLE() + DECLARE_DYNAMIC_CLASS(wxDirCtrl) }; //----------------------------------------------------------------------------- @@ -110,11 +133,10 @@ class wxDirCtrl: public wxTreeCtrl class WXDLLEXPORT wxDirDialog: public wxDialog { - DECLARE_DYNAMIC_CLASS(wxDirDialog) - public: +public: wxDirDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr, - const wxString& defaultPath = "", + const wxString& defaultPath = wxEmptyString, long style = 0, const wxPoint& pos = wxDefaultPosition); inline void SetMessage(const wxString& message) { m_message = message; } inline void SetPath(const wxString& path) { m_path = path; } @@ -127,27 +149,29 @@ class WXDLLEXPORT wxDirDialog: public wxDialog int ShowModal(); void OnTreeSelected( wxTreeEvent &event ); - void OnTreeKeyDown( wxKeyEvent &event ); - void OnSize(wxSizeEvent& event); + void OnTreeKeyDown( wxTreeEvent &event ); void OnOK(wxCommandEvent& event); void OnCancel(wxCommandEvent& event); void OnNew(wxCommandEvent& event); // void OnCheck(wxCommandEvent& event); - DECLARE_EVENT_TABLE() - protected: +protected: // implementation - wxString m_message; - long m_dialogStyle; - wxWindow * m_parent; - wxString m_path; - wxDirCtrl *m_dir; - wxTextCtrl *m_input; - // wxCheckBox *m_check; - wxButton *m_ok, *m_cancel, *m_new; - void doSize(); + wxString m_message; + long m_dialogStyle; + wxString m_path; + wxDirCtrl *m_dir; + wxTextCtrl *m_input; + wxCheckBox *m_check; // not yet used + wxButton *m_ok, *m_cancel, *m_new; + +private: + DECLARE_EVENT_TABLE() + DECLARE_DYNAMIC_CLASS(wxDirDialog) }; +#endif + #endif // _WX_DIRDLGG_H_