X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/903506828b7d042350eae97b5014a63ffca17ef5..f538710f0b798b21365fd614ba531055b225b115:/src/generic/dirctrlg.cpp diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index c0016cef79..ab27ea3426 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -317,8 +317,10 @@ static const char * icon8_xpm[] = { #if defined(__DOS__) -static bool wxIsDriveAvailable(const wxString dirName) +bool wxIsDriveAvailable(const wxString& dirName) { + // FIXME_MGL - this method leads to hang up under Watcom for some reason +#ifndef __WATCOMC__ if ( dirName.Len() == 3 && dirName[1u] == wxT(':') ) { wxString dirNameLower(dirName.Lower()); @@ -329,6 +331,7 @@ static bool wxIsDriveAvailable(const wxString dirName) wxPathExists(dirNameLower)); } else +#endif return TRUE; } @@ -363,7 +366,7 @@ int setdrive(int drive) #endif // !GNUWIN32 } -static bool wxIsDriveAvailable(const wxString dirName) +bool wxIsDriveAvailable(const wxString& dirName) { #ifdef __WIN32__ UINT errorMode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); @@ -404,7 +407,7 @@ static int LINKAGEMODE wxDirCtrlStringCompareFunction(const void *first, const v { wxString *strFirst = (wxString *)first; wxString *strSecond = (wxString *)second; - + return strFirst->CmpNoCase(*strSecond); } @@ -451,7 +454,7 @@ bool wxDirItemData::HasSubDirs() const return dir.HasSubDirs(); } -bool wxDirItemData::HasFiles(const wxString& spec) const +bool wxDirItemData::HasFiles(const wxString& WXUNUSED(spec)) const { if (m_path.IsEmpty()) return FALSE; @@ -572,6 +575,16 @@ void wxGenericDirCtrl::Init() m_filterListCtrl = NULL; } +void wxGenericDirCtrl::ShowHidden( bool show ) +{ + m_showHidden = show; + + wxString path = GetPath(); + m_treeCtrl->Collapse(m_treeCtrl->GetRootItem()); + m_treeCtrl->Expand(m_treeCtrl->GetRootItem()); + SetPath(path); +} + void wxGenericDirCtrl::AddSection(const wxString& path, const wxString& name, int imageId) { wxDirItemData *dir_item = new wxDirItemData(path,name,TRUE); @@ -806,7 +819,9 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId) if (d.IsOpened()) { - if (d.GetFirst(& eachFilename, wxEmptyString, wxDIR_DIRS | wxDIR_HIDDEN)) + int style = wxDIR_DIRS; + if (m_showHidden) style |= wxDIR_HIDDEN; + if (d.GetFirst(& eachFilename, wxEmptyString, style)) { do {