]> git.saurik.com Git - wxWidgets.git/commitdiff
fixing border drawing for toplevel controls on dialogs, fixes #10877
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 10 Jun 2009 04:04:09 +0000 (04:04 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 10 Jun 2009 04:04:09 +0000 (04:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/nonownedwnd.cpp
src/osx/nonownedwnd_osx.cpp

index 179f6b49971dbaf333682f0c2da18752febd6b62..cbacef05122a7ec1d0ac9499f3fa416d439da752 100644 (file)
@@ -99,12 +99,18 @@ bool wxNonOwnedWindowCarbonImpl::SetBackgroundColour(const wxColour& col )
     if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDocumentWindowBackground)) )
     {
         SetThemeWindowBackground( (WindowRef) m_macWindow,  kThemeBrushDocumentWindowBackground, false ) ;
     if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDocumentWindowBackground)) )
     {
         SetThemeWindowBackground( (WindowRef) m_macWindow,  kThemeBrushDocumentWindowBackground, false ) ;
-        SetBackgroundStyle(wxBG_STYLE_SYSTEM);
+        m_wxPeer->SetBackgroundStyle(wxBG_STYLE_SYSTEM);
+        // call directly if object is not yet completely constructed
+        if ( m_wxPeer->GetNonOwnedPeer() == NULL )
+            SetBackgroundStyle(wxBG_STYLE_SYSTEM);
     }
     else if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive)) )
     {
         SetThemeWindowBackground( (WindowRef) m_macWindow,  kThemeBrushDialogBackgroundActive, false ) ;
     }
     else if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive)) )
     {
         SetThemeWindowBackground( (WindowRef) m_macWindow,  kThemeBrushDialogBackgroundActive, false ) ;
-        SetBackgroundStyle(wxBG_STYLE_SYSTEM);
+        m_wxPeer->SetBackgroundStyle(wxBG_STYLE_SYSTEM);
+        // call directly if object is not yet completely constructed
+        if ( m_wxPeer->GetNonOwnedPeer() == NULL )
+            SetBackgroundStyle(wxBG_STYLE_SYSTEM);
     }
     return true;
 }
     }
     return true;
 }
index ed53785787c4aa1463acac38b6e36578f6dee365..674c4d9968633dc3f8878df17a73b025b15cb40c 100644 (file)
@@ -346,7 +346,7 @@ bool wxNonOwnedWindow::SetBackgroundStyle(wxBackgroundStyle style)
     if ( !wxWindow::SetBackgroundStyle(style) )
         return false ;
         
     if ( !wxWindow::SetBackgroundStyle(style) )
         return false ;
         
-    return m_nowpeer->SetBackgroundStyle(style);
+    return m_nowpeer ? m_nowpeer->SetBackgroundStyle(style) : true;
 }
 
 void wxNonOwnedWindow::DoMoveWindow(int x, int y, int width, int height)
 }
 
 void wxNonOwnedWindow::DoMoveWindow(int x, int y, int width, int height)