]> git.saurik.com Git - wxWidgets.git/commitdiff
support for arbitrary backgrounds via suppressing the ordinary control background...
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 24 Jun 2002 15:18:58 +0000 (15:18 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 24 Jun 2002 15:18:58 +0000 (15:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15938 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/control.cpp
src/mac/control.cpp

index e1f7d4dd474553ffc46f89ce3a29c6ce856bc49c..b56dee0d186b0f1114d6571817b4063df8ecb024 100644 (file)
@@ -60,6 +60,32 @@ pascal void wxMacLiveScrollbarActionProc( ControlHandle control , ControlPartCod
     }
 }
 
+ControlColorUPP wxMacSetupControlBackgroundUPP = NULL ;
+
+pascal OSStatus wxMacSetupControlBackground( ControlRef iControl , SInt16 iMessage , SInt16 iDepth , Boolean iIsColor )
+{
+       OSStatus status = noErr ;
+       switch( iMessage )
+       {
+               case kControlMsgSetUpBackground :
+               wxControl*  wx = (wxControl*) GetControlReference( iControl ) ;
+               if ( wx != NULL && wx->IsKindOf( CLASSINFO( wxControl ) ) )
+               {
+                       wxDC::MacSetupBackgroundForCurrentPort( wx->MacGetBackgroundBrush() ) ;
+//                             SetThemeBackground( iDepth , iIsColor ) ;
+                       }
+                       else
+                       {
+                               status = paramErr ;
+                       }
+                       break ;
+               default :
+                       status = paramErr ;
+                       break ;
+       }
+       return status ;
+}
 wxControl::wxControl()
 {
     m_macControl = NULL ;
@@ -315,6 +341,11 @@ void wxControl::MacPostControlCreate()
 
     wxAssociateControlWithMacControl( (ControlHandle) m_macControl , this ) ;
 
+       if ( wxMacSetupControlBackgroundUPP == NULL )
+       {
+               wxMacSetupControlBackgroundUPP = NewControlColorUPP( wxMacSetupControlBackground ) ;
+       }
+       SetControlColorProc( (ControlHandle) m_macControl , wxMacSetupControlBackgroundUPP ) ;
  
      // Adjust the controls size and position
      wxPoint pos(m_x, m_y);
index e1f7d4dd474553ffc46f89ce3a29c6ce856bc49c..b56dee0d186b0f1114d6571817b4063df8ecb024 100644 (file)
@@ -60,6 +60,32 @@ pascal void wxMacLiveScrollbarActionProc( ControlHandle control , ControlPartCod
     }
 }
 
+ControlColorUPP wxMacSetupControlBackgroundUPP = NULL ;
+
+pascal OSStatus wxMacSetupControlBackground( ControlRef iControl , SInt16 iMessage , SInt16 iDepth , Boolean iIsColor )
+{
+       OSStatus status = noErr ;
+       switch( iMessage )
+       {
+               case kControlMsgSetUpBackground :
+               wxControl*  wx = (wxControl*) GetControlReference( iControl ) ;
+               if ( wx != NULL && wx->IsKindOf( CLASSINFO( wxControl ) ) )
+               {
+                       wxDC::MacSetupBackgroundForCurrentPort( wx->MacGetBackgroundBrush() ) ;
+//                             SetThemeBackground( iDepth , iIsColor ) ;
+                       }
+                       else
+                       {
+                               status = paramErr ;
+                       }
+                       break ;
+               default :
+                       status = paramErr ;
+                       break ;
+       }
+       return status ;
+}
 wxControl::wxControl()
 {
     m_macControl = NULL ;
@@ -315,6 +341,11 @@ void wxControl::MacPostControlCreate()
 
     wxAssociateControlWithMacControl( (ControlHandle) m_macControl , this ) ;
 
+       if ( wxMacSetupControlBackgroundUPP == NULL )
+       {
+               wxMacSetupControlBackgroundUPP = NewControlColorUPP( wxMacSetupControlBackground ) ;
+       }
+       SetControlColorProc( (ControlHandle) m_macControl , wxMacSetupControlBackgroundUPP ) ;
  
      // Adjust the controls size and position
      wxPoint pos(m_x, m_y);