]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dirdlgg.cpp
split wxUSE_MDI from wxUSE_MDI_ARCHITECTURE (which is wxUSE_MDI + wxUSE_DOCVIEW)
[wxWidgets.git] / src / generic / dirdlgg.cpp
index d74c7aadc07595ddae6e05b36f3298b1bbb42e90..9adf9232db5cca377c861129cd21d631ff273dc0 100644 (file)
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dirdlgg.h"
 #endif
 
 #pragma implementation "dirdlgg.h"
 #endif
 
@@ -36,7 +36,7 @@
 #endif
 
 #include "wx/statline.h"
 #endif
 
 #include "wx/statline.h"
-#include "wx/generic/dirctrlg.h"
+#include "wx/dirctrl.h"
 #include "wx/generic/dirdlgg.h"
 #include "wx/artprov.h"
 #include "wx/bmpbuttn.h"
 #include "wx/generic/dirdlgg.h"
 #include "wx/artprov.h"
 #include "wx/bmpbuttn.h"
@@ -45,6 +45,8 @@
 // wxGenericDirDialog
 //-----------------------------------------------------------------------------
 
 // wxGenericDirDialog
 //-----------------------------------------------------------------------------
 
+IMPLEMENT_DYNAMIC_CLASS(wxGenericDirDialog, wxDialog)
+
 static const int ID_DIRCTRL = 1000;
 static const int ID_TEXTCTRL = 1001;
 static const int ID_OK = 1002;
 static const int ID_DIRCTRL = 1000;
 static const int ID_TEXTCTRL = 1001;
 static const int ID_OK = 1002;
@@ -250,14 +252,14 @@ void wxGenericDirDialog::OnShowHidden( wxCommandEvent& event )
     if (!m_dirCtrl)
         return;
 
     if (!m_dirCtrl)
         return;
 
-    m_dirCtrl->ShowHidden( event.GetInt() );
+    m_dirCtrl->ShowHidden( event.GetInt() != 0 );
 }
 
 void wxGenericDirDialog::OnNew( wxCommandEvent& WXUNUSED(event) )
 {
     wxTreeItemId id = m_dirCtrl->GetTreeCtrl()->GetSelection();
     if ((id == m_dirCtrl->GetTreeCtrl()->GetRootItem()) ||
 }
 
 void wxGenericDirDialog::OnNew( wxCommandEvent& WXUNUSED(event) )
 {
     wxTreeItemId id = m_dirCtrl->GetTreeCtrl()->GetSelection();
     if ((id == m_dirCtrl->GetTreeCtrl()->GetRootItem()) ||
-        (m_dirCtrl->GetTreeCtrl()->GetParent(id) == m_dirCtrl->GetTreeCtrl()->GetRootItem()))
+        (m_dirCtrl->GetTreeCtrl()->GetItemParent(id) == m_dirCtrl->GetTreeCtrl()->GetRootItem()))
     {
         wxMessageDialog msg(this, _("You cannot add a new directory to this section."),
                             _("Create directory"), wxOK | wxICON_INFORMATION );
     {
         wxMessageDialog msg(this, _("You cannot add a new directory to this section."),
                             _("Create directory"), wxOK | wxICON_INFORMATION );
@@ -265,13 +267,13 @@ void wxGenericDirDialog::OnNew( wxCommandEvent& WXUNUSED(event) )
         return;
     }
 
         return;
     }
 
-    wxTreeItemId parent = id ; // m_dirCtrl->GetTreeCtrl()->GetParent( id );
+    wxTreeItemId parent = id ; // m_dirCtrl->GetTreeCtrl()->GetItemParent( id );
     wxDirItemData *data = (wxDirItemData*)m_dirCtrl->GetTreeCtrl()->GetItemData( parent );
     wxASSERT( data );
 
     wxString new_name( _("NewName") );
     wxString path( data->m_path );
     wxDirItemData *data = (wxDirItemData*)m_dirCtrl->GetTreeCtrl()->GetItemData( parent );
     wxASSERT( data );
 
     wxString new_name( _("NewName") );
     wxString path( data->m_path );
-    if (path.Last() != wxFILE_SEP_PATH)
+    if (!wxEndsWithPathSeparator(path))
         path += wxFILE_SEP_PATH;
     path += new_name;
     if (wxFileExists(path))
         path += wxFILE_SEP_PATH;
     path += new_name;
     if (wxFileExists(path))
@@ -285,7 +287,7 @@ void wxGenericDirDialog::OnNew( wxCommandEvent& WXUNUSED(event) )
             new_name += num;
 
             path = data->m_path;
             new_name += num;
 
             path = data->m_path;
-            if (path.Last() != wxFILE_SEP_PATH)
+            if (!wxEndsWithPathSeparator(path))
                 path += wxFILE_SEP_PATH;
             path += new_name;
             i++;
                 path += wxFILE_SEP_PATH;
             path += new_name;
             i++;