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
This commit is contained in:
Václav Slavík
2014-03-29 13:06:40 +00:00
parent dab101876e
commit f8e96589d9

View File

@@ -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;