X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2cf30aa1c330e5f2f7954c3938a58a1a95f221e..1bda83992364d46ff77228a849808eb546fbfaa5:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 780b1f89e7..5b2730bc62 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -484,9 +484,19 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, valueWin = value; } + // suppress events sent during control creation: we're called either from + // the ctor and then we shouldn't generate any events for compatibility + // with the other ports, or from SetWindowStyleFlag() and then we shouldn't + // generate the events because our text doesn't really change, the fact + // that we (sometimes) need to recreate the control is just an + // implementation detail + m_updatesCount = -2; + if ( !MSWCreateControl(windowClass.wx_str(), msStyle, pos, size, valueWin) ) return false; + m_updatesCount = -1; + #if wxUSE_RICHEDIT if (IsRich()) { @@ -1912,7 +1922,7 @@ WXLRESULT wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara else // !editable { // NB: use "=", not "|=" as the base class version returns - // the same flags is this state as usual (i.e. + // the same flags in the disabled state as usual (i.e. // including DLGC_WANTMESSAGE). This is strange (how // does it work in the native Win32 apps?) but for now // live with it.