From 86f1458257289bc8f7d8ca4a5870ec9f5fc5a57e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Oct 2001 00:40:32 +0000 Subject: [PATCH] don't use hidden windows as implicit dialog parents neither git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dialog.cpp | 12 ------------ src/msw/textctrl.cpp | 2 ++ src/msw/toplevel.cpp | 5 +++-- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index 3fbad08474..620a3de16a 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -322,18 +322,6 @@ bool wxDialog::Show(bool show) { // use it m_parent = parent; - - // VZ: to make dialog behave properly we should reparent - // the dialog for Windows as well - unfortunately, - // following the docs for SetParent() results in this - // code which plainly doesn't work -#if 0 - long dwStyle = ::GetWindowLong(GetHwnd(), GWL_STYLE); - dwStyle &= ~WS_POPUP; - dwStyle |= WS_CHILD; - ::SetWindowLong(GetHwnd(), GWL_STYLE, dwStyle); - ::SetParent(GetHwnd(), GetHwndOf(parent)); -#endif // 0 } } diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 1ec178c99f..4fdcde3e83 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -300,6 +300,8 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, if ( !MSWCreateControl(windowClass, msStyle, pos, size, value) ) return FALSE; + SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW)); + #if wxUSE_RICHEDIT if (m_isRich) { diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 8874a8d156..4d4dbf1e17 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -193,8 +193,9 @@ bool wxTopLevelWindowMSW::CreateDialog(const wxChar *dlgTemplate, { parent = wxTheApp->GetTopWindow(); - // but don't use the window which is about to be destroyed as parent - if ( parent->IsBeingDeleted() ) + // but don't use the window which is currently hidden as then the + // dialog would be hidden as well + if ( parent && !parent->IsShown() ) { parent = NULL; } -- 2.45.2