From e96248c48e0a000ef355ef3b0b6aa09b7251a834 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Dec 2006 21:27:52 +0000 Subject: [PATCH] don't use SetWindowStyleFlag() in wxWindowBase::CreateBase() but assign to m_windowStyle directly; this allows SetWindowStyleFlag() in the derived classes to change the styles of the control without worrying about whether it had been already created git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/wincmn.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 3f63607dca..a2f7a42766 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -251,8 +251,12 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, // generate a new id if the user doesn't care about it m_windowId = id == wxID_ANY ? NewControlId() : id; + // don't use SetWindowStyleFlag() here, this function should only be called + // to change the flag after creation as it tries to reflect the changes in + // flags by updating the window dynamically and we don't need this here + m_windowStyle = style; + SetName(name); - SetWindowStyleFlag(style); SetParent(parent); #if wxUSE_VALIDATORS -- 2.45.2