X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1dd85cc3d6b86bb56c640d3989563dd24c6893bd..bf60426831535738b1b784629f08e9dd00bf9ecc:/src/mac/carbon/dc.cpp diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index 1d19d743cd..b0e3183298 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -1379,6 +1379,21 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) { Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ; + if ( m_backgroundMode != wxTRANSPARENT ) + { + Point bounds={0,0} ; + Rect background = frame ; + SInt16 baseline ; + ::GetThemeTextDimensions( mString, + kThemeCurrentPortFont, + kThemeStateActive, + false, + &bounds, + &baseline ); + background.right = background.left + bounds.h ; + background.bottom = background.top + bounds.v ; + ::EraseRect( &background ) ; + } ::DrawThemeTextBox( mString, kThemeCurrentPortFont, kThemeStateActive, @@ -1405,6 +1420,21 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) { Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; CFStringRef mString = CFStringCreateWithCString( NULL , text + laststop , kCFStringEncodingMacRoman ) ; + if ( m_backgroundMode != wxTRANSPARENT ) + { + Point bounds={0,0} ; + Rect background = frame ; + SInt16 baseline ; + ::GetThemeTextDimensions( mString, + kThemeCurrentPortFont, + kThemeStateActive, + false, + &bounds, + &baseline ); + background.right = background.left + bounds.h ; + background.bottom = background.top + bounds.v ; + ::EraseRect( &background ) ; + } ::DrawThemeTextBox( mString, kThemeCurrentPortFont, kThemeStateActive,