]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/nonownedwnd.cpp
adjust the toolbar tools bitmap size to fit the biggest bitmap used under wxOSX too...
[wxWidgets.git] / src / osx / carbon / nonownedwnd.cpp
index 4587682f13d3f01a2cd5d166c05747908830296f..da850b200dc650fcbe80ecf984da880081695808 100644 (file)
@@ -99,12 +99,18 @@ bool wxNonOwnedWindowCarbonImpl::SetBackgroundColour(const wxColour& col )
     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 ) ;
-        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;
 }
@@ -1181,7 +1187,7 @@ void wxNonOwnedWindowCarbonImpl::Create(
     const wxPoint& pos,
     const wxSize& size,
     long style, long extraStyle, 
-    const wxString& name )
+    const wxString& WXUNUSED(name) )
 {
 
     OSStatus err = noErr ;
@@ -1640,9 +1646,9 @@ void wxNonOwnedWindowCarbonImpl::ScreenToWindow( int *x, int *y )
     HIViewFindByID( HIViewGetRoot( m_macWindow ), kHIViewWindowContentID , &contentView) ;
     HIPointConvert( &p, kHICoordSpace72DPIGlobal, NULL, kHICoordSpaceView, contentView );
     if ( x )
-        *x = p.x;
+        *x = (int)p.x;
     if ( y )
-        *y = p.y;
+        *y = (int)p.y;
 }
 
 void wxNonOwnedWindowCarbonImpl::WindowToScreen( int *x, int *y )
@@ -1653,9 +1659,9 @@ void wxNonOwnedWindowCarbonImpl::WindowToScreen( int *x, int *y )
     HIViewFindByID( HIViewGetRoot( m_macWindow ), kHIViewWindowContentID , &contentView) ;
     HIPointConvert( &p, kHICoordSpaceView, contentView, kHICoordSpace72DPIGlobal, NULL );
     if ( x )
-        *x = p.x;
+        *x = (int)p.x;
     if ( y )
-        *y = p.y;
+        *y = (int)p.y;
 }
 
 wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,