]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/dirdlgg.h
1. wxFileDialog patch for multiple selection applied (with some small changes),
[wxWidgets.git] / include / wx / generic / dirdlgg.h
index dbefc430d5afd472516bf333b28db425c387356f..7fd5768b02262fb1911ea81b086ebb3705d646df 100644 (file)
@@ -5,6 +5,7 @@
 // Modified by:
 // Created:     12/12/98
 // Copyright:   (c) Harm van der Heijden and Robert Roebling
 // 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, 
 // Licence:    wxWindows licence
 //
 // Notes:       wxDirDialog class written by Harm van der Heijden, 
 #pragma interface "dirdlgg.h"
 #endif
 
 #pragma interface "dirdlgg.h"
 #endif
 
+#include "wx/defs.h"
+
+#if wxUSE_DIRDLG
+
 #include "wx/dialog.h"
 #include "wx/dialog.h"
-//#include "wx/checkbox.h"
+#include "wx/checkbox.h"
 #include "wx/treectrl.h"
 
 //-----------------------------------------------------------------------------
 // data
 //-----------------------------------------------------------------------------
 
 #include "wx/treectrl.h"
 
 //-----------------------------------------------------------------------------
 // data
 //-----------------------------------------------------------------------------
 
-WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr;
+WXDLLEXPORT_DATA(extern const wxChar*) wxFileSelectorPromptStr;
+WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogDefaultFolderStr;
 
 //-----------------------------------------------------------------------------
 // classes
 
 //-----------------------------------------------------------------------------
 // classes
@@ -72,14 +78,62 @@ class wxDirItemData;
 class wxDirCtrl;
 class wxDirDialog;
 
 class wxDirCtrl;
 class wxDirDialog;
 
+//-----------------------------------------------------------------------------
+// wxDirItemData
+//-----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxDirItemData : public wxTreeItemData
+{
+public:
+  wxDirItemData(wxString& path, wxString& name);
+  ~wxDirItemData();
+  bool HasSubDirs();
+  void SetNewDirName( wxString path );
+  wxString m_path, m_name;
+  bool m_isHidden;
+  bool m_hasSubDirs;
+};
+
+//-----------------------------------------------------------------------------
+// wxDirCtrl
+//-----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxDirCtrl: public wxTreeCtrl
+{
+public:
+    bool           m_showHidden;
+    wxTreeItemId   m_rootId;
+  
+    wxDirCtrl();
+    wxDirCtrl(wxWindow *parent, const wxWindowID id = -1, 
+             const wxString &dir = wxDirDialogDefaultFolderStr,
+             const wxPoint& pos = wxDefaultPosition,
+             const wxSize& size = wxDefaultSize,
+             const long style = wxTR_HAS_BUTTONS,
+             const wxString& name = wxTreeCtrlNameStr );
+    void ShowHidden( const bool yesno );
+    void OnExpandItem(wxTreeEvent &event );
+    void OnCollapseItem(wxTreeEvent &event );
+    void OnBeginEditItem(wxTreeEvent &event );
+    void OnEndEditItem(wxTreeEvent &event );
+    
+protected:
+    void CreateItems(const wxTreeItemId &parent);
+    void SetupSections();
+    wxArrayString m_paths, m_names;
+    
+private:
+    DECLARE_EVENT_TABLE()
+    DECLARE_DYNAMIC_CLASS(wxDirCtrl)
+};
+
 //-----------------------------------------------------------------------------
 // wxDirDialog
 //-----------------------------------------------------------------------------
 
 class WXDLLEXPORT wxDirDialog: public wxDialog
 {
 //-----------------------------------------------------------------------------
 // wxDirDialog
 //-----------------------------------------------------------------------------
 
 class WXDLLEXPORT wxDirDialog: public wxDialog
 {
-  DECLARE_DYNAMIC_CLASS(wxDirDialog)
- public:
+public:
     wxDirDialog(wxWindow *parent, 
                const wxString& message = wxFileSelectorPromptStr,
                const wxString& defaultPath = wxEmptyString,
     wxDirDialog(wxWindow *parent, 
                const wxString& message = wxFileSelectorPromptStr,
                const wxString& defaultPath = wxEmptyString,
@@ -96,26 +150,28 @@ class WXDLLEXPORT wxDirDialog: public wxDialog
 
     void OnTreeSelected( wxTreeEvent &event );
     void OnTreeKeyDown( wxTreeEvent &event );
 
     void OnTreeSelected( wxTreeEvent &event );
     void OnTreeKeyDown( wxTreeEvent &event );
-    void OnSize(wxSizeEvent& event);
     void OnOK(wxCommandEvent& event);
     void OnCancel(wxCommandEvent& event); 
     void OnNew(wxCommandEvent& event);
     // void OnCheck(wxCommandEvent& event);
     void OnOK(wxCommandEvent& event);
     void OnCancel(wxCommandEvent& event); 
     void OnNew(wxCommandEvent& event);
     // void OnCheck(wxCommandEvent& event);
-    DECLARE_EVENT_TABLE()
 
 
- protected:
+protected:
     // implementation
     // 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_
 
 #endif
     // _WX_DIRDLGG_H_