]> git.saurik.com Git - wxWidgets.git/commitdiff
don't use hidden windows as implicit dialog parents neither
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Oct 2001 00:40:32 +0000 (00:40 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Oct 2001 00:40:32 +0000 (00:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dialog.cpp
src/msw/textctrl.cpp
src/msw/toplevel.cpp

index 3fbad08474679d2979b7d8b31c477daffa3d5ab2..620a3de16ae80ebb2f6768b5f7f6784e6604b211 100644 (file)
@@ -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
                 }
             }
 
index 1ec178c99f522b72c84f286ac9bdaaf7add96575..4fdcde3e8332d4c46197c3a7e693c8ba193b4e82 100644 (file)
@@ -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)
     {
index 8874a8d15634d733962f2ff6cd165d40cc518733..4d4dbf1e17709276db5c48d5cf17aa44e1d9d6c8 100644 (file)
@@ -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;
         }