From: Robert Roebling Date: Tue, 21 Oct 2008 19:10:25 +0000 (+0000) Subject: Correct TAB handling for generic wxDataViewCtrl X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/788432e343179a27d010265de03085d44a85e64e Correct TAB handling for generic wxDataViewCtrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index de5b225581..a10ee6606b 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -444,6 +444,8 @@ public: virtual void Expand( const wxDataViewItem & item ); virtual void Collapse( const wxDataViewItem & item ); + + virtual void SetFocus(); protected: virtual int GetSelections( wxArrayInt & sel ) const; diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 61a9457001..76306c3eb9 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -153,6 +153,8 @@ public: virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL); virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } + + virtual bool AcceptsFocusFromKeyboard() const { return false; } protected: virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); @@ -3630,7 +3632,7 @@ void wxDataViewMainWindow::DestroyTree() void wxDataViewMainWindow::OnChar( wxKeyEvent &event ) { - if ( HandleAsNavigationKey(event) ) + if ( GetParent()->HandleAsNavigationKey(event) ) return; // no item -> nothing to do @@ -4177,6 +4179,12 @@ void wxDataViewCtrl::OnSize( wxSizeEvent &WXUNUSED(event) ) AdjustScrollbars(); } +void wxDataViewCtrl::SetFocus() +{ + if (m_clientArea) + m_clientArea->SetFocus(); +} + bool wxDataViewCtrl::AssociateModel( wxDataViewModel *model ) { if (!wxDataViewCtrlBase::AssociateModel( model ))