X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0cd51b2d275da04105d861b64073eef2e3aa3993..6cd4655bee404d94e1f0eb4d880e24668c842dfd:/src/mac/control.cpp diff --git a/src/mac/control.cpp b/src/mac/control.cpp index cc93410764..b56dee0d18 100644 --- a/src/mac/control.cpp +++ b/src/mac/control.cpp @@ -36,7 +36,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow) BEGIN_EVENT_TABLE(wxControl, wxWindow) EVT_MOUSE_EVENTS( wxControl::OnMouseEvent ) - EVT_CHAR( wxControl::OnKeyDown ) +// EVT_CHAR( wxControl::OnKeyDown ) EVT_PAINT( wxControl::OnPaint ) END_EVENT_TABLE() #endif @@ -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 ; @@ -292,7 +318,7 @@ void wxControl::MacPostControlCreate() { // no font } - else if ( IsKindOf( CLASSINFO( wxStaticBox ) ) || IsKindOf( CLASSINFO( wxRadioBox ) ) || IsKindOf( CLASSINFO( wxButton ) ) ) + else if ( !UMAHasAquaLayout() && (IsKindOf( CLASSINFO( wxStaticBox ) ) || IsKindOf( CLASSINFO( wxRadioBox ) ) || IsKindOf( CLASSINFO( wxButton ) ) ) ) { ControlFontStyleRec controlstyle ; controlstyle.flags = kControlUseFontMask ; @@ -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);