Workaround for #10040: wxGrid scrolls back to the previous edit position

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@66945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2011-02-17 15:01:48 +00:00
parent 78f59cedf3
commit 8d2f00f251

View File

@@ -8636,6 +8636,11 @@ void wxGrid::ShowCellEditControl()
editor->GetControl()->GetPosition().y );
editor->Show( true, attr );
#ifdef __WXGTK20__
int px, py;
GetViewStart(& px, & py);
#endif
// recalc dimensions in case we need to
// expand the scrolled window to account for editor
CalcDimensions();
@@ -8645,6 +8650,14 @@ void wxGrid::ShowCellEditControl()
editor->DecRef();
attr->DecRef();
#ifdef __WXGTK20__
// On GTK+, erroneous scrolling to the old control
// position can happen when the grid window gets a
// focus event and this is processed by wxScrollHelper.
// This line resets the scroll position.
Scroll(px, py);
#endif
}
}
}