X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ca65c0440a7163e4e37e48b1c4329709d722db47..a24de76b33ff8c30343d322ba9031527f0ba060f:/src/generic/dirctrlg.cpp diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 0a129d1b0a..a91cf2608d 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -20,10 +20,9 @@ #pragma hdrstop #endif -#if wxUSE_DIRDLG +#if wxUSE_DIRDLG || wxUSE_FILEDLG #include "wx/generic/dirctrlg.h" - #include "wx/module.h" #include "wx/utils.h" #include "wx/button.h" @@ -243,7 +242,7 @@ size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayI !CFStringGetCString(cfstr, cstr, CFStringGetLength(cfstr) + 1, kCFStringEncodingMacRoman)) { - CFRelease( cstr ); + CFRelease( cfstr ); continue; } wxString name( cstr , wxConvLocal ); @@ -396,6 +395,11 @@ bool wxIsDriveAvailable(const wxString& dirName) } #endif // __WINDOWS__ || __OS2__ +#endif // wxUSE_DIRDLG || wxUSE_FILEDLG + + + +#if wxUSE_DIRDLG // Function which is called by quick sort. We want to override the default wxArrayString behaviour, // and sort regardless of case. @@ -570,7 +574,8 @@ bool wxGenericDirCtrl::Create(wxWindow *parent, else filterStyle |= wxBORDER_SUNKEN; - m_treeCtrl = new wxTreeCtrl(this, wxID_TREECTRL, pos, size, treeStyle); + m_treeCtrl = new wxTreeCtrl(this, wxID_TREECTRL, + wxPoint(0,0), GetClientSize(), treeStyle); if (!filter.IsEmpty() && (style & wxDIRCTRL_SHOW_FILTERS)) m_filterListCtrl = new wxDirFilterListCtrl(this, wxID_FILTERLISTCTRL, wxDefaultPosition, wxDefaultSize, filterStyle); @@ -1132,7 +1137,7 @@ void wxGenericDirCtrl::SetFilter(const wxString& filter) bool wxGenericDirCtrl::ExtractWildcard(const wxString& filterStr, int n, wxString& filter, wxString& description) { wxArrayString filters, descriptions; - int count = wxParseWildcard(filterStr, filters, descriptions); + int count = wxParseCommonDialogsFilter(filterStr, descriptions, filters); if (count > 0 && n < count) { filter = filters[n]; @@ -1149,7 +1154,7 @@ bool wxGenericDirCtrl::ExtractWildcard(const wxString& filterStr, int n, wxStrin // filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpg" int wxGenericDirCtrl::ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions) { - return wxParseWildcard(filterStr, descriptions, filters ); + return wxParseCommonDialogsFilter(filterStr, descriptions, filters ); } #endif // WXWIN_COMPATIBILITY_2_4 @@ -1261,7 +1266,7 @@ void wxDirFilterListCtrl::FillFilterList(const wxString& filter, int defaultFilt { Clear(); wxArrayString descriptions, filters; - size_t n = (size_t) wxParseWildcard(filter, filters, descriptions); + size_t n = (size_t) wxParseCommonDialogsFilter(filter, filters, descriptions); if (n > 0 && defaultFilter < (int) n) { @@ -1270,7 +1275,9 @@ void wxDirFilterListCtrl::FillFilterList(const wxString& filter, int defaultFilt SetSelection(defaultFilter); } } +#endif // wxUSE_DIRDLG +#if wxUSE_DIRDLG || wxUSE_FILEDLG // ---------------------------------------------------------------------------- // wxFileIconsTable icons @@ -1719,4 +1726,4 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) #endif // wxUSE_MIMETYPE/!wxUSE_MIMETYPE } -#endif // wxUSE_DIRDLG +#endif // wxUSE_DIRDLG || wxUSE_FILEDLG