From: Vadim Zeitlin Date: Sun, 22 Jun 2003 21:56:43 +0000 (+0000) Subject: set selection before setting focus to the control in SetFocusFromKbd() (patch 726361) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1b1ca07a708a2375c3fa6a568c1e29a710d6d56a set selection before setting focus to the control in SetFocusFromKbd() (patch 726361) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index fa2afaca08..45b1156215 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -474,8 +474,6 @@ void wxWindowMSW::SetFocus() void wxWindowMSW::SetFocusFromKbd() { - wxWindowBase::SetFocusFromKbd(); - // when the focus is given to the control with DLGC_HASSETSEL style from // keyboard its contents should be entirely selected: this is what // ::IsDialogMessage() does and so we should do it as well to provide the @@ -484,6 +482,11 @@ void wxWindowMSW::SetFocusFromKbd() { ::SendMessage(GetHwnd(), EM_SETSEL, 0, -1); } + + // do this after (maybe) setting the selection as like this when + // wxEVT_SET_FOCUS handler is called, the selection would have been already + // set correctly -- this may be important + wxWindowBase::SetFocusFromKbd(); } // Get the window with the focus