]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/control.cpp
Allow wxSTC to have scrollbars
[wxWidgets.git] / src / mac / control.cpp
index e1f7d4dd474553ffc46f89ce3a29c6ce856bc49c..6570c1303bca0af2695fd3539e4bc967c49af35e 100644 (file)
@@ -60,6 +60,34 @@ 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 +343,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);