X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b0a7c092cdee3f94cbfdaed6e55719916ccd8c1..b1f50e652c0e105c0ed8ab627be837c45f7a1a00:/src/generic/dirctrlg.cpp?ds=sidebyside diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 0193c7e016..4b8b766b8c 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -73,16 +73,17 @@ #endif -#ifdef __OS2__ - -#define INCL_BASE -#include -#ifndef __EMX__ -#include -#endif -#include -#include -extern bool wxIsDriveAvailable(const wxString& dirName); +#if defined(__OS2__) || defined(__DOS__) + #ifdef __OS2__ + #define INCL_BASE + #include + #ifndef __EMX__ + #include + #endif + #include + #include + #endif + extern bool wxIsDriveAvailable(const wxString& dirName); #endif // __OS2__ #if defined(__WXMAC__) @@ -511,6 +512,7 @@ wxBEGIN_PROPERTIES_TABLE(wxGenericDirCtrl) wxPROPERTY( DefaultPath , wxString , SetDefaultPath , GetDefaultPath , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) wxPROPERTY( Filter , wxString , SetFilter , GetFilter ,, 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) wxPROPERTY( DefaultFilter , int , SetFilterIndex, GetFilterIndex,, 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) + wxPROPERTY_FLAGS( WindowStyle, wxGenericDirCtrlStyle, long, SetWindowStyleFlag, GetWindowStyleFlag, , 0, wxT("Helpstring"), wxT("group") ) wxEND_PROPERTIES_TABLE() wxBEGIN_HANDLERS_TABLE(wxGenericDirCtrl) @@ -834,16 +836,24 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId) { int style = wxDIR_FILES; if (m_showHidden) style |= wxDIR_HIDDEN; - if (d.GetFirst(& eachFilename, m_currentFilterStr, style)) + // Process each filter (ex: "JPEG Files (*.jpg;*.jpeg)|*.jpg;*.jpeg") + wxStringTokenizer strTok; + wxString curFilter; + strTok.SetString(m_currentFilterStr,wxT(";")); + while(strTok.HasMoreTokens()) { - do + curFilter = strTok.GetNextToken(); + if (d.GetFirst(& eachFilename, m_currentFilterStr, style)) { - if ((eachFilename != wxT(".")) && (eachFilename != wxT(".."))) + do { - filenames.Add(eachFilename); + if ((eachFilename != wxT(".")) && (eachFilename != wxT(".."))) + { + filenames.Add(eachFilename); + } } + while (d.GetNext(& eachFilename)); } - while (d.GetNext(& eachFilename)); } } filenames.Sort(wxDirCtrlStringCompareFunction); @@ -1633,9 +1643,13 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) wxIconLocation iconLoc; wxIcon ic; - if ( ft && ft->GetIcon(&iconLoc) ) + { - ic = wxIcon(iconLoc); + wxLogNull logNull; + if ( ft && ft->GetIcon(&iconLoc) ) + { + ic = wxIcon(iconLoc); + } } delete ft; @@ -1650,6 +1664,13 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) wxBitmap bmp; bmp.CopyFromIcon(ic); + if ( !bmp.Ok() ) + { + int newid = file; + m_HashTable->Put(extension, new wxFileIconEntry(newid)); + return newid; + } + int id = m_smallImageList->GetImageCount(); if ((bmp.GetWidth() == 16) && (bmp.GetHeight() == 16)) m_smallImageList->Add(bmp);