]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/control.cpp
don't make wxBitmapButtons same size as all the other buttons
[wxWidgets.git] / src / mac / carbon / control.cpp
index 1c7030c6b86044d3fd0beb617f77528e62d2b75d..1f62d46592cbce6a7308f326925c8a664db66bbf 100644 (file)
@@ -332,6 +332,7 @@ void wxControl::MacPostControlCreate()
      SetSize(pos.x, pos.y, new_size.x, new_size.y);
  
      UMAShowControl( m_macControl ) ;
+     Refresh() ;
 }
 
 void wxControl::MacAdjustControlRect() 
@@ -438,37 +439,8 @@ void wxControl::MacSuperChangedPosition()
 
 void wxControl::MacSuperEnabled( bool enabled ) 
 {
+    Refresh(FALSE) ;
     wxWindow::MacSuperEnabled( enabled ) ;
-/*
-    if ( m_macControl )
-    {
-        if ( UMAHasAppearance() )
-        {
-            if ( !enabled )
-            {
-                ::DeactivateControl( m_macControl ) ; 
-            }
-            else
-            {
-                if ( m_macEnabled )
-                    ::ActivateControl( m_macControl ) ;
-            }
-        }
-        else
-        {
-            if ( !enabled )
-            {
-                ::HiliteControl( m_macControl , 255 ) ;
-            }
-            else
-            {
-                if ( m_macEnabled )
-                    ::HiliteControl( m_macControl , 0 ) ;
-            }
-        }
-    }
-    wxWindow::MacSuperEnabled( enabled ) ;
-*/
 }
 
 void  wxControl::MacSuperShown( bool show ) 
@@ -675,29 +647,8 @@ void wxControl::MacRedrawControl()
             {
                 wxMacDrawingHelper help( win ) ;
                 // the mac control manager always assumes to have the origin at 0,0
-                SetOrigin( 0 , 0 ) ;
-                
-                wxWindow* parent = GetParent() ;
-                while ( parent )
-                {
-                    if( parent->IsTopLevel() )
-                    {
-                    //    ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
-                        break ;
-                    }
-                    
-                    if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) ||  parent->IsKindOf( CLASSINFO( wxTabCtrl ) ))
-                    {
-                        if ( ((wxControl*)parent)->m_macControl )
-                            SetUpControlBackground( ((wxControl*)parent)->m_macControl , -1 , true ) ;
-                        break ;
-                    }
-                    
-                    parent = parent->GetParent() ;
-                } 
-                
+                wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ;
                 UMADrawControl( m_macControl ) ;
-                // ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
             }
         }
     }
@@ -715,37 +666,14 @@ void wxControl::OnPaint(wxPaintEvent& event)
             {
                 wxMacDrawingHelper help( win ) ;
                 // the mac control manager always assumes to have the origin at 0,0
-                SetOrigin( 0 , 0 ) ;
-
-                /*
-                wxWindow* parent = GetParent() ;
-                while ( parent )
-                {
-                    if( parent->IsTopLevel() )
-                    {
-                    //    ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
-                        break ;
-                    }
-                    
-                    if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) ||  parent->IsKindOf( CLASSINFO( wxTabCtrl ) ))
-                    {
-                        if ( ((wxControl*)parent)->m_macControl )
-                            SetUpControlBackground( ((wxControl*)parent)->m_macControl , -1 , true ) ;
-                        break ;
-                    }
-                    
-                    parent = parent->GetParent() ;
-                } 
-                */
-                SetUpControlBackground( m_macControl , -1 , true ) ;
+                wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ;
                 UMADrawControl( m_macControl ) ;
-                // ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
             }
         }
     }
     else
     {
-        // wxWindow::OnPaint( event ) ;
+      event.Skip() ;
     }
 }
 void wxControl::OnEraseBackground(wxEraseEvent& event)