X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e90c1d2a19361551eb07778280f22be3e759cf64..236a9de39afa090fdee3cf91cb5364ceca69e3f8:/src/generic/dirdlgg.cpp diff --git a/src/generic/dirdlgg.cpp b/src/generic/dirdlgg.cpp index 826703e3f7..ba118204be 100644 --- a/src/generic/dirdlgg.cpp +++ b/src/generic/dirdlgg.cpp @@ -50,6 +50,7 @@ #undef GetFirstChild #endif +#ifndef __WXMSW__ /* XPM */ static char * icon1_xpm[] = { /* width height ncolors chars_per_pixel */ @@ -108,6 +109,8 @@ static char * icon2_xpm[] = { " ", " "}; +#endif // !wxMSW + static const int ID_DIRCTRL = 1000; static const int ID_TEXTCTRL = 1001; static const int ID_OK = 1002; @@ -143,7 +146,7 @@ void wxDirItemData::SetNewDirName( wxString path ) bool wxDirItemData::HasSubDirs() { - wxString search = m_path + "/*"; + wxString search = m_path + wxT("/*"); wxLogNull log; wxString path = wxFindFirstFile( search, wxDIR ); return (bool)(!path.IsNull()); @@ -198,17 +201,17 @@ void wxDirCtrl::SetupSections() m_names.Clear(); #ifdef __WXMSW__ // better than nothing - ADD_SECTION(T("c:\\"), _("My Harddisk") ) + ADD_SECTION(wxT("c:\\"), _("My Harddisk") ) #else - ADD_SECTION(T("/"), _("The Computer") ) + ADD_SECTION(wxT("/"), _("The Computer") ) wxGetHomeDir(&home); ADD_SECTION(home, _("My Home") ) - ADD_SECTION(T("/mnt"), _("Mounted Devices") ) - ADD_SECTION(T("/usr"), _("User") ) - ADD_SECTION(T("/usr/local"), _("User Local") ) - ADD_SECTION(T("/var"), _("Variables") ) - ADD_SECTION(T("/etc"), _("Etcetera") ) - ADD_SECTION(T("/tmp"), _("Temporary") ) + ADD_SECTION(wxT("/mnt"), _("Mounted Devices") ) + ADD_SECTION(wxT("/usr"), _("User") ) + ADD_SECTION(wxT("/usr/local"), _("User Local") ) + ADD_SECTION(wxT("/var"), _("Variables") ) + ADD_SECTION(wxT("/etc"), _("Etcetera") ) + ADD_SECTION(wxT("/tmp"), _("Temporary") ) #endif } #undef ADD_SECTION @@ -222,11 +225,12 @@ void wxDirCtrl::CreateItems(const wxTreeItemId &parent) for (unsigned int i=0; im_hasSubDirs) SetItemHasChildren(id); } @@ -254,7 +258,7 @@ void wxDirCtrl::OnEndEditItem(wxTreeEvent &event) if ((event.GetLabel().IsEmpty()) || (event.GetLabel() == _(".")) || (event.GetLabel() == _("..")) || - (event.GetLabel().First( T("/") ) != wxNOT_FOUND)) + (event.GetLabel().First( wxT("/") ) != wxNOT_FOUND)) { wxMessageDialog dialog(this, _("Illegal directory name."), _("Error"), wxOK | wxICON_ERROR ); dialog.ShowModal(); @@ -267,7 +271,7 @@ void wxDirCtrl::OnEndEditItem(wxTreeEvent &event) wxASSERT( data ); wxString new_name( wxPathOnly( data->m_path ) ); - new_name += T("/"); + new_name += wxT("/"); new_name += event.GetLabel(); wxLogNull log; @@ -310,7 +314,11 @@ void wxDirCtrl::OnExpandItem(wxTreeEvent &event) m_paths.Clear(); m_names.Clear(); +#ifdef __WXMSW__ + search = data->m_path + "\\*.*"; +#else search = data->m_path + "/*"; +#endif for (path = wxFindFirstFile( search, wxDIR ); !path.IsNull(); path=wxFindNextFile() ) { @@ -352,11 +360,7 @@ void wxDirCtrl::OnCollapseItem(wxTreeEvent &event ) //----------------------------------------------------------------------------- -#if !USE_SHARED_LIBRARY -IMPLEMENT_CLASS(wxDirDialog, wxDialog) -#else IMPLEMENT_DYNAMIC_CLASS( wxDirDialog, wxDialog ) -#endif BEGIN_EVENT_TABLE( wxDirDialog, wxDialog ) EVT_TREE_KEY_DOWN (ID_DIRCTRL, wxDirDialog::OnTreeKeyDown) @@ -502,22 +506,22 @@ void wxDirDialog::OnNew( wxCommandEvent& WXUNUSED(event) ) wxDirItemData *data = (wxDirItemData*)m_dir->GetItemData( parent ); wxASSERT( data ); - wxString new_name( T("NewName") ); + wxString new_name( wxT("NewName") ); wxString path( data->m_path ); - path += T("/"); + path += wxT("/"); path += new_name; if (wxFileExists(path)) { // try NewName0, NewName1 etc. int i = 0; do { - new_name = T("NewName"); + new_name = wxT("NewName"); wxString num; - num.Printf( "%d", i ); + num.Printf( wxT("%d"), i ); new_name += num; path = data->m_path; - path += T("/"); + path += wxT("/"); path += new_name; i++; } while (wxFileExists(path));