X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/788e118f21f73a77c8813caa535a157621ab8fa9..3109d1986881ca784e0c444d60282db139d92bf1:/src/mac/carbon/window.cpp diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index b793d62377..6f21c231bb 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -505,14 +505,10 @@ pascal OSStatus wxMacSetupControlBackground( ControlRef iControl , SInt16 iMessa wxWindow* wx = (wxWindow*) wxFindControlFromMacControl( iControl ) ; if ( wx != NULL ) { - /* const wxBrush &brush = wx->MacGetBackgroundBrush() ; if ( brush.Ok() ) { - wxDC::MacSetupBackgroundForCurrentPort( brush ) ; - */ - // this clipping is only needed for non HIView RgnHandle clip = NewRgn() ; int x = 0 , y = 0; @@ -524,7 +520,6 @@ pascal OSStatus wxMacSetupControlBackground( ControlRef iControl , SInt16 iMessa DisposeRgn( clip ) ; status = noErr ; - /* } else if ( wx->MacIsUserPane() ) { @@ -532,7 +527,6 @@ pascal OSStatus wxMacSetupControlBackground( ControlRef iControl , SInt16 iMessa // setup of our parent ourselves status = SetUpControlBackground( (ControlRef) wx->GetParent()->GetHandle() , iDepth , iIsColor ) ; } - */ } } break ; @@ -781,7 +775,7 @@ void wxWindowMac::MacPostControlCreate(const wxPoint& pos, const wxSize& size) #if !TARGET_API_MAC_OSX // eventually we can fix some clipping issues be reactivating this hook //if ( m_macIsUserPane ) - // SetControlColorProc( *m_peer , wxMacSetupControlBackgroundUPP ) ; + // SetControlColorProc( m_peer->GetControlRef() , wxMacSetupControlBackgroundUPP ) ; #endif m_peer->SetTitle( wxStripMenuCodes(m_label) ) ; @@ -1825,8 +1819,9 @@ bool wxWindowMac::MacIsReallyShown() { // only under OSX the visibility of the TLW is taken into account #if TARGET_API_MAC_OSX - return m_peer->IsVisible(); -#else + if ( m_peer && m_peer->Ok() ) + return m_peer->IsVisible(); +#endif wxWindow* win = this ; while( win->IsShown() ) { @@ -1839,7 +1834,6 @@ bool wxWindowMac::MacIsReallyShown() } ; return false ; -#endif } bool wxWindowMac::MacIsReallyEnabled() @@ -2040,11 +2034,13 @@ void wxWindowMac::WarpPointer (int x_pos, int y_pos) void wxWindowMac::OnEraseBackground(wxEraseEvent& event) { +#if TARGET_API_MAC_OSX if ( m_macBackgroundBrush.Ok() == false || m_macBackgroundBrush.GetStyle() == wxTRANSPARENT ) { event.Skip() ; } else +#endif event.GetDC()->Clear() ; } @@ -2125,9 +2121,6 @@ void wxWindowMac::MacPaintBorders( int left , int top ) int major,minor; wxGetOsVersion( &major, &minor ); - RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ; - RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ; - RGBColor darkShadow = { 0x0000, 0x0000 , 0x0000 } ; RGBColor lightShadow = { 0x4444, 0x4444 , 0x4444 } ; // OS X has lighter border edges than classic: @@ -2154,6 +2147,9 @@ void wxWindowMac::MacPaintBorders( int left , int top ) InsetRect( &rect , border , border ); DrawThemeEditTextFrame(&rect,IsEnabled() ? kThemeStateActive : kThemeStateInactive) ; #else + RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ; + RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ; + bool sunken = HasFlag( wxSUNKEN_BORDER ) ; RGBForeColor( &face ); MoveTo( left + 0 , top + h - 2 );