From: Vadim Zeitlin Date: Sat, 17 Nov 2007 15:12:13 +0000 (+0000) Subject: forward SetFocus() to the directory tree (replaces patch 1831210) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/905e090500ab0e80bb22508a04f8c77e37748e52 forward SetFocus() to the directory tree (replaces patch 1831210) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/dirctrlg.h b/include/wx/generic/dirctrlg.h index 452db329f1..00eef8c991 100644 --- a/include/wx/generic/dirctrlg.h +++ b/include/wx/generic/dirctrlg.h @@ -166,6 +166,10 @@ public: // Collapse the entire tree virtual void CollapseTree(); + + // overridden base class methods + virtual void SetFocus(); + protected: virtual void ExpandRoot(); virtual void ExpandDir(wxTreeItemId parentId); diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 0164ddfc7b..5e35d0ff4c 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -664,6 +664,13 @@ void wxGenericDirCtrl::SetupSections() AddSection(paths[n], names[n], icons[n]); } +void wxGenericDirCtrl::SetFocus() +{ + // we don't need focus ourselves, give it to the tree so that the user + // could navigate it + m_treeCtrl->SetFocus(); +} + void wxGenericDirCtrl::OnBeginEditItem(wxTreeEvent &event) { // don't rename the main entry "Sections"