X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/574c939ef1c1b835a8bc65c0fe724548fa04ec49..6cc687bfee071b5328f9e48d1708795287006bb7:/src/generic/dirctrlg.cpp diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index c56008620e..dddbbad587 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -505,7 +505,19 @@ bool wxGenericDirCtrl::Create(wxWindow *parent, Init(); - long treeStyle = wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS | wxTR_HIDE_ROOT; + long treeStyle = wxTR_HAS_BUTTONS; +#ifdef __WXMSW__ + // VS: Do **NOT** remove this style, ever. MSW native wxTreeCtrl::EditLabel doesn't + // work without this style and we need it to be able to create new directories. + // Generic wxTreeCtrl can do it even w/o wxTR_EDIT_LABELS, so we only add it + // in case of wxMSW (as it is arguably better to not have the style enabled) + treeStyle |= wxTR_EDIT_LABELS; +#endif +#ifndef __WXMSW__ + // FIXME, doesn't work for some reason + treeStyle |= wxTR_HIDE_ROOT; +#endif + if ((style & wxDIRCTRL_3D_INTERNAL) == 0) treeStyle |= wxNO_BORDER; @@ -579,7 +591,10 @@ void wxGenericDirCtrl::ShowHidden( bool show ) { m_showHidden = show; - // reparse FIXME + 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) @@ -1176,6 +1191,14 @@ void wxGenericDirCtrl::DoResize() wxSize filterSz ; if (m_filterListCtrl) { +#ifdef __WXMSW__ + // For some reason, this is required in order for the + // correct control height to always be returned, rather + // than the drop-down list height which is sometimes returned. + wxSize oldSize = m_filterListCtrl->GetSize(); + m_filterListCtrl->SetSize(-1, -1, oldSize.x+10, -1, wxSIZE_USE_EXISTING); + m_filterListCtrl->SetSize(-1, -1, oldSize.x, -1, wxSIZE_USE_EXISTING); +#endif filterSz = m_filterListCtrl->GetSize(); sz.y -= (filterSz.y + verticalSpacing); }