X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aaa37c0d232074ca87df16f7c1f9ce21a18979b5..921d0fb1953c384c3f5066dabc19f0f7e4fb1da7:/src/generic/filedlgg.cpp diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index c76bb9c2c6..8b13841962 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -244,6 +244,7 @@ void wxFileData::SetNewName( const wxString &name, const wxString &fname ) void wxFileData::MakeItem( wxListItem &item ) { item.m_text = m_name; + item.ClearAttributes(); if (IsExe()) item.SetTextColour(*wxRED); if (IsDir()) item.SetTextColour(*wxBLUE); item.m_image = IsDir() ? 0 : -1; @@ -575,7 +576,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, m_dialogStyle = style; if ((m_dialogStyle & wxMULTIPLE ) && !(m_dialogStyle & wxOPEN)) - m_dialogStyle &= ~wxMULTIPLE; + m_dialogStyle |= wxOPEN; m_dir = defaultDir; if (m_dir.IsEmpty()) @@ -900,6 +901,12 @@ void wxFileDialog::SetPath( const wxString& path ) void wxFileDialog::GetPaths( wxArrayString& paths ) const { paths.Empty(); + if (m_list->GetSelectedItemCount() == 0) + { + paths.Add( GetPath() ); + return; + } + paths.Alloc( m_list->GetSelectedItemCount() ); wxString dir; @@ -921,6 +928,11 @@ void wxFileDialog::GetPaths( wxArrayString& paths ) const void wxFileDialog::GetFilenames(wxArrayString& files) const { files.Empty(); + if (m_list->GetSelectedItemCount() == 0) + { + files.Add( GetFilename() ); + return; + } files.Alloc( m_list->GetSelectedItemCount() ); wxListItem item;