From 63509fb3c424dd69d8f5db35f7ae16950b9a3595 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 16 Aug 2011 20:52:15 +0000 Subject: [PATCH] Implemented non-selection of content when setting focus via the keyboard. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 2 ++ src/msw/window.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 1bfcf05b02..2b53227ba1 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -470,6 +470,8 @@ MSW: - Added wxGCDC(wxEnhMetaFileDC) ctor (Marcin Wojdyr). - Added wxTopLevelWindow::MSWGetSystemMenu(). +- Multiline text controls no longer select all content when gaining focus from + the keyboard. 2.9.2: (released 2011-07-05) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 5e2e43a438..3bdd324931 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3100,6 +3100,13 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, processed = true; } + else if (IsOfStandardClass() && IsKindOf(CLASSINFO(wxTextCtrl)) && ((wxTextCtrl*)this)->IsMultiLine()) + { + rc.result = MSWDefWindowProc(message, wParam, lParam); + // Clear the DLGC_HASSETSEL bit from the return value + rc.result &= ~DLGC_HASSETSEL; + processed = true; + } //else: get the dlg code from the DefWindowProc() break; -- 2.45.2