From f8e96589d96e88c002ae9a73eb7327ef46eb3fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 29 Mar 2014 13:06:40 +0000 Subject: [PATCH] Don't emit wxEVT_TEXT in wxMSW's wxTextCtrl::SetFont(). Native text control sends EN_CHANGE when the font changes, producing a wxEVT_TEXT event as if the user changed the value. This is not the case, so supress the event. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/textctrl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index b7f25530c6..8e2a25a633 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -2520,6 +2520,11 @@ bool wxTextCtrl::SetForegroundColour(const wxColour& colour) bool wxTextCtrl::SetFont(const wxFont& font) { + // Native text control sends EN_CHANGE when the font changes, producing + // a wxEVT_TEXT event as if the user changed the value. This is not + // the case, so supress the event. + wxEventBlocker block(this, wxEVT_TEXT); + if ( !wxTextCtrlBase::SetFont(font) ) return false;