appearance box drawing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1377,12 +1377,15 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("wxDC::DoDrawRotatedText Invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("wxDC::DoDrawRotatedText Invalid window dc") );
|
||||||
|
|
||||||
if (angle == 0.0)
|
if (angle == 0.0 )
|
||||||
{
|
{
|
||||||
DrawText(str, x, y);
|
DrawText(str, x, y);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( str.Length() == 0 )
|
||||||
|
return ;
|
||||||
|
|
||||||
wxMacPortSetter helper(this) ;
|
wxMacPortSetter helper(this) ;
|
||||||
MacInstallFont() ;
|
MacInstallFont() ;
|
||||||
|
|
||||||
@@ -1428,14 +1431,17 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
|
|||||||
&chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
|
&chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
|
||||||
wxASSERT_MSG( status == noErr , "couldn't create the layout of the rotated text" );
|
wxASSERT_MSG( status == noErr , "couldn't create the layout of the rotated text" );
|
||||||
|
|
||||||
Fixed atsuAngle = IntToFixed( angle ) ;
|
if ( abs(angle) > 0 )
|
||||||
ByteCount angleSize = sizeof(Fixed) ;
|
{
|
||||||
ATSUAttributeTag rotationTag = kATSULineRotationTag ;
|
Fixed atsuAngle = IntToFixed( angle ) ;
|
||||||
ATSUAttributeValuePtr angleValue = &atsuAngle ;
|
ByteCount angleSize = sizeof(Fixed) ;
|
||||||
status = ::ATSUSetLayoutControls(atsuLayout , 1 , &rotationTag , &angleSize , &angleValue ) ;
|
ATSUAttributeTag rotationTag = kATSULineRotationTag ;
|
||||||
|
ATSUAttributeValuePtr angleValue = &atsuAngle ;
|
||||||
|
status = ::ATSUSetLayoutControls(atsuLayout , 1 , &rotationTag , &angleSize , &angleValue ) ;
|
||||||
|
}
|
||||||
|
|
||||||
status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
|
status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
|
||||||
IntToFixed(XLOG2DEVMAC(x) ) , IntToFixed(YLOG2DEVMAC(y) ) );
|
IntToFixed(XLOG2DEVMAC(x) ) , IntToFixed(YLOG2DEVMAC(y) ) );
|
||||||
wxASSERT_MSG( status == noErr , "couldn't draw the rotated text" );
|
wxASSERT_MSG( status == noErr , "couldn't draw the rotated text" );
|
||||||
Rect rect ;
|
Rect rect ;
|
||||||
status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
|
status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
|
||||||
@@ -1450,12 +1456,14 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC"));
|
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC"));
|
||||||
wxMacPortSetter helper(this) ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx = XLOG2DEVMAC(x);
|
long xx = XLOG2DEVMAC(x);
|
||||||
long yy = YLOG2DEVMAC(y);
|
long yy = YLOG2DEVMAC(y);
|
||||||
|
|
||||||
|
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
|
||||||
|
|
||||||
MacInstallFont() ;
|
MacInstallFont() ;
|
||||||
if ( 0 )
|
if ( 0 )
|
||||||
@@ -1468,7 +1476,9 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
|||||||
FontInfo fi ;
|
FontInfo fi ;
|
||||||
::GetFontInfo( &fi ) ;
|
::GetFontInfo( &fi ) ;
|
||||||
|
|
||||||
yy += fi.ascent ;
|
if ( !useDrawThemeText )
|
||||||
|
yy += fi.ascent ;
|
||||||
|
|
||||||
::MoveTo( xx , yy );
|
::MoveTo( xx , yy );
|
||||||
if ( m_backgroundMode == wxTRANSPARENT )
|
if ( m_backgroundMode == wxTRANSPARENT )
|
||||||
{
|
{
|
||||||
@@ -1499,19 +1509,54 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
|||||||
int i = 0 ;
|
int i = 0 ;
|
||||||
int line = 0 ;
|
int line = 0 ;
|
||||||
|
|
||||||
while( i < length )
|
{
|
||||||
{
|
|
||||||
if( text[i] == 13 || text[i] == 10)
|
while( i < length )
|
||||||
{
|
{
|
||||||
::DrawText( text , laststop , i - laststop ) ;
|
if( text[i] == 13 || text[i] == 10)
|
||||||
line++ ;
|
{
|
||||||
::MoveTo( xx , yy + line*(fi.descent + fi.ascent + fi.leading) );
|
if ( useDrawThemeText )
|
||||||
laststop = i+1 ;
|
{
|
||||||
}
|
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ;
|
||||||
i++ ;
|
CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
|
||||||
|
::DrawThemeTextBox( mString,
|
||||||
|
kThemeCurrentPortFont,
|
||||||
|
kThemeStateActive,
|
||||||
|
true,
|
||||||
|
&frame,
|
||||||
|
teJustLeft,
|
||||||
|
nil );
|
||||||
|
CFRelease( mString ) ;
|
||||||
|
line++ ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::DrawText( text , laststop , i - laststop ) ;
|
||||||
|
line++ ;
|
||||||
|
::MoveTo( xx , yy + line*(fi.descent + fi.ascent + fi.leading) );
|
||||||
|
}
|
||||||
|
laststop = i+1 ;
|
||||||
|
}
|
||||||
|
i++ ;
|
||||||
|
}
|
||||||
|
if ( useDrawThemeText )
|
||||||
|
{
|
||||||
|
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ;
|
||||||
|
CFStringRef mString = CFStringCreateWithCString( NULL , text + laststop , kCFStringEncodingMacRoman ) ;
|
||||||
|
::DrawThemeTextBox( mString,
|
||||||
|
kThemeCurrentPortFont,
|
||||||
|
kThemeStateActive,
|
||||||
|
true,
|
||||||
|
&frame,
|
||||||
|
teJustLeft,
|
||||||
|
nil );
|
||||||
|
CFRelease( mString ) ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::DrawText( text , laststop , i - laststop ) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
::DrawText( text , laststop , i - laststop ) ;
|
|
||||||
::TextMode( srcOr ) ;
|
::TextMode( srcOr ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1635,7 +1680,7 @@ void wxDC::Clear(void)
|
|||||||
{
|
{
|
||||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||||
wxMacPortSetter helper(this) ;
|
wxMacPortSetter helper(this) ;
|
||||||
Rect rect = { -32000 , -32000 , 32000 , 32000 } ;
|
Rect rect = { -31000 , -31000 , 31000 , 31000 } ;
|
||||||
|
|
||||||
if (m_backgroundBrush.GetStyle() != wxTRANSPARENT)
|
if (m_backgroundBrush.GetStyle() != wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
@@ -1653,6 +1698,8 @@ void wxDC::MacInstallFont() const
|
|||||||
// return ;
|
// return ;
|
||||||
Pattern blackColor ;
|
Pattern blackColor ;
|
||||||
|
|
||||||
|
MacSetupBackgroundForCurrentPort(m_backgroundBrush) ;
|
||||||
|
|
||||||
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
|
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
|
||||||
|
|
||||||
if ( font )
|
if ( font )
|
||||||
@@ -1672,12 +1719,16 @@ void wxDC::MacInstallFont() const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
short fontnum ;
|
FontFamilyID fontId ;
|
||||||
|
Str255 fontName ;
|
||||||
GetFNum( "\pGeneva" , &fontnum ) ;
|
SInt16 fontSize ;
|
||||||
::TextFont( fontnum ) ;
|
Style fontStyle ;
|
||||||
::TextSize( short(m_scaleY * 10) ) ;
|
GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ;
|
||||||
::TextFace( 0 ) ;
|
GetFNum( fontName, &fontId );
|
||||||
|
|
||||||
|
::TextFont( fontId ) ;
|
||||||
|
::TextSize( short(m_scaleY * fontSize) ) ;
|
||||||
|
::TextFace( fontStyle ) ;
|
||||||
|
|
||||||
// todo reset after spacing changes - or store the current spacing somewhere
|
// todo reset after spacing changes - or store the current spacing somewhere
|
||||||
|
|
||||||
@@ -1747,37 +1798,48 @@ void wxDC::MacInstallFont() const
|
|||||||
{
|
{
|
||||||
kATSUFontTag ,
|
kATSUFontTag ,
|
||||||
kATSUSizeTag ,
|
kATSUSizeTag ,
|
||||||
kATSUColorTag ,
|
// kATSUColorTag ,
|
||||||
|
kATSUBaselineClassTag ,
|
||||||
|
kATSUVerticalCharacterTag,
|
||||||
|
|
||||||
kATSUQDBoldfaceTag ,
|
kATSUQDBoldfaceTag ,
|
||||||
kATSUQDItalicTag ,
|
kATSUQDItalicTag ,
|
||||||
kATSUQDUnderlineTag ,
|
kATSUQDUnderlineTag ,
|
||||||
kATSUQDCondensedTag ,
|
kATSUQDCondensedTag ,
|
||||||
kATSUQDExtendedTag ,
|
kATSUQDExtendedTag ,
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ByteCount atsuSizes[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] =
|
ByteCount atsuSizes[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] =
|
||||||
{
|
{
|
||||||
sizeof( ATSUFontID ) ,
|
sizeof( ATSUFontID ) ,
|
||||||
sizeof( Fixed ) ,
|
sizeof( Fixed ) ,
|
||||||
sizeof( RGBColor ) ,
|
// sizeof( RGBColor ) ,
|
||||||
|
sizeof( BslnBaselineClass ) ,
|
||||||
|
sizeof( ATSUVerticalCharacterType),
|
||||||
|
|
||||||
sizeof( Boolean ) ,
|
sizeof( Boolean ) ,
|
||||||
sizeof( Boolean ) ,
|
sizeof( Boolean ) ,
|
||||||
sizeof( Boolean ) ,
|
sizeof( Boolean ) ,
|
||||||
sizeof( Boolean ) ,
|
sizeof( Boolean ) ,
|
||||||
sizeof( Boolean ) ,
|
sizeof( Boolean ) ,
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Boolean kTrue = true ;
|
Boolean kTrue = true ;
|
||||||
Boolean kFalse = false ;
|
Boolean kFalse = false ;
|
||||||
|
BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ;
|
||||||
|
|
||||||
|
ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal;
|
||||||
|
|
||||||
ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] =
|
ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] =
|
||||||
{
|
{
|
||||||
&atsuFont ,
|
&atsuFont ,
|
||||||
&atsuSize ,
|
&atsuSize ,
|
||||||
&MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) ,
|
// &MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) ,
|
||||||
|
&kBaselineDefault ,
|
||||||
|
&kHorizontal,
|
||||||
|
|
||||||
(qdStyle & bold) ? &kTrue : &kFalse ,
|
(qdStyle & bold) ? &kTrue : &kFalse ,
|
||||||
(qdStyle & italic) ? &kTrue : &kFalse ,
|
(qdStyle & italic) ? &kTrue : &kFalse ,
|
||||||
(qdStyle & underline) ? &kTrue : &kFalse ,
|
(qdStyle & underline) ? &kTrue : &kFalse ,
|
||||||
|
132
src/mac/dc.cpp
132
src/mac/dc.cpp
@@ -1377,12 +1377,15 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("wxDC::DoDrawRotatedText Invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("wxDC::DoDrawRotatedText Invalid window dc") );
|
||||||
|
|
||||||
if (angle == 0.0)
|
if (angle == 0.0 )
|
||||||
{
|
{
|
||||||
DrawText(str, x, y);
|
DrawText(str, x, y);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( str.Length() == 0 )
|
||||||
|
return ;
|
||||||
|
|
||||||
wxMacPortSetter helper(this) ;
|
wxMacPortSetter helper(this) ;
|
||||||
MacInstallFont() ;
|
MacInstallFont() ;
|
||||||
|
|
||||||
@@ -1428,14 +1431,17 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
|
|||||||
&chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
|
&chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
|
||||||
wxASSERT_MSG( status == noErr , "couldn't create the layout of the rotated text" );
|
wxASSERT_MSG( status == noErr , "couldn't create the layout of the rotated text" );
|
||||||
|
|
||||||
Fixed atsuAngle = IntToFixed( angle ) ;
|
if ( abs(angle) > 0 )
|
||||||
ByteCount angleSize = sizeof(Fixed) ;
|
{
|
||||||
ATSUAttributeTag rotationTag = kATSULineRotationTag ;
|
Fixed atsuAngle = IntToFixed( angle ) ;
|
||||||
ATSUAttributeValuePtr angleValue = &atsuAngle ;
|
ByteCount angleSize = sizeof(Fixed) ;
|
||||||
status = ::ATSUSetLayoutControls(atsuLayout , 1 , &rotationTag , &angleSize , &angleValue ) ;
|
ATSUAttributeTag rotationTag = kATSULineRotationTag ;
|
||||||
|
ATSUAttributeValuePtr angleValue = &atsuAngle ;
|
||||||
|
status = ::ATSUSetLayoutControls(atsuLayout , 1 , &rotationTag , &angleSize , &angleValue ) ;
|
||||||
|
}
|
||||||
|
|
||||||
status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
|
status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
|
||||||
IntToFixed(XLOG2DEVMAC(x) ) , IntToFixed(YLOG2DEVMAC(y) ) );
|
IntToFixed(XLOG2DEVMAC(x) ) , IntToFixed(YLOG2DEVMAC(y) ) );
|
||||||
wxASSERT_MSG( status == noErr , "couldn't draw the rotated text" );
|
wxASSERT_MSG( status == noErr , "couldn't draw the rotated text" );
|
||||||
Rect rect ;
|
Rect rect ;
|
||||||
status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
|
status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
|
||||||
@@ -1450,12 +1456,14 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC"));
|
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC"));
|
||||||
wxMacPortSetter helper(this) ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx = XLOG2DEVMAC(x);
|
long xx = XLOG2DEVMAC(x);
|
||||||
long yy = YLOG2DEVMAC(y);
|
long yy = YLOG2DEVMAC(y);
|
||||||
|
|
||||||
|
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
|
||||||
|
|
||||||
MacInstallFont() ;
|
MacInstallFont() ;
|
||||||
if ( 0 )
|
if ( 0 )
|
||||||
@@ -1468,7 +1476,9 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
|||||||
FontInfo fi ;
|
FontInfo fi ;
|
||||||
::GetFontInfo( &fi ) ;
|
::GetFontInfo( &fi ) ;
|
||||||
|
|
||||||
yy += fi.ascent ;
|
if ( !useDrawThemeText )
|
||||||
|
yy += fi.ascent ;
|
||||||
|
|
||||||
::MoveTo( xx , yy );
|
::MoveTo( xx , yy );
|
||||||
if ( m_backgroundMode == wxTRANSPARENT )
|
if ( m_backgroundMode == wxTRANSPARENT )
|
||||||
{
|
{
|
||||||
@@ -1499,19 +1509,54 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
|||||||
int i = 0 ;
|
int i = 0 ;
|
||||||
int line = 0 ;
|
int line = 0 ;
|
||||||
|
|
||||||
while( i < length )
|
{
|
||||||
{
|
|
||||||
if( text[i] == 13 || text[i] == 10)
|
while( i < length )
|
||||||
{
|
{
|
||||||
::DrawText( text , laststop , i - laststop ) ;
|
if( text[i] == 13 || text[i] == 10)
|
||||||
line++ ;
|
{
|
||||||
::MoveTo( xx , yy + line*(fi.descent + fi.ascent + fi.leading) );
|
if ( useDrawThemeText )
|
||||||
laststop = i+1 ;
|
{
|
||||||
}
|
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ;
|
||||||
i++ ;
|
CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
|
||||||
|
::DrawThemeTextBox( mString,
|
||||||
|
kThemeCurrentPortFont,
|
||||||
|
kThemeStateActive,
|
||||||
|
true,
|
||||||
|
&frame,
|
||||||
|
teJustLeft,
|
||||||
|
nil );
|
||||||
|
CFRelease( mString ) ;
|
||||||
|
line++ ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::DrawText( text , laststop , i - laststop ) ;
|
||||||
|
line++ ;
|
||||||
|
::MoveTo( xx , yy + line*(fi.descent + fi.ascent + fi.leading) );
|
||||||
|
}
|
||||||
|
laststop = i+1 ;
|
||||||
|
}
|
||||||
|
i++ ;
|
||||||
|
}
|
||||||
|
if ( useDrawThemeText )
|
||||||
|
{
|
||||||
|
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ;
|
||||||
|
CFStringRef mString = CFStringCreateWithCString( NULL , text + laststop , kCFStringEncodingMacRoman ) ;
|
||||||
|
::DrawThemeTextBox( mString,
|
||||||
|
kThemeCurrentPortFont,
|
||||||
|
kThemeStateActive,
|
||||||
|
true,
|
||||||
|
&frame,
|
||||||
|
teJustLeft,
|
||||||
|
nil );
|
||||||
|
CFRelease( mString ) ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::DrawText( text , laststop , i - laststop ) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
::DrawText( text , laststop , i - laststop ) ;
|
|
||||||
::TextMode( srcOr ) ;
|
::TextMode( srcOr ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1635,7 +1680,7 @@ void wxDC::Clear(void)
|
|||||||
{
|
{
|
||||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||||
wxMacPortSetter helper(this) ;
|
wxMacPortSetter helper(this) ;
|
||||||
Rect rect = { -32000 , -32000 , 32000 , 32000 } ;
|
Rect rect = { -31000 , -31000 , 31000 , 31000 } ;
|
||||||
|
|
||||||
if (m_backgroundBrush.GetStyle() != wxTRANSPARENT)
|
if (m_backgroundBrush.GetStyle() != wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
@@ -1653,6 +1698,8 @@ void wxDC::MacInstallFont() const
|
|||||||
// return ;
|
// return ;
|
||||||
Pattern blackColor ;
|
Pattern blackColor ;
|
||||||
|
|
||||||
|
MacSetupBackgroundForCurrentPort(m_backgroundBrush) ;
|
||||||
|
|
||||||
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
|
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
|
||||||
|
|
||||||
if ( font )
|
if ( font )
|
||||||
@@ -1672,12 +1719,16 @@ void wxDC::MacInstallFont() const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
short fontnum ;
|
FontFamilyID fontId ;
|
||||||
|
Str255 fontName ;
|
||||||
GetFNum( "\pGeneva" , &fontnum ) ;
|
SInt16 fontSize ;
|
||||||
::TextFont( fontnum ) ;
|
Style fontStyle ;
|
||||||
::TextSize( short(m_scaleY * 10) ) ;
|
GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ;
|
||||||
::TextFace( 0 ) ;
|
GetFNum( fontName, &fontId );
|
||||||
|
|
||||||
|
::TextFont( fontId ) ;
|
||||||
|
::TextSize( short(m_scaleY * fontSize) ) ;
|
||||||
|
::TextFace( fontStyle ) ;
|
||||||
|
|
||||||
// todo reset after spacing changes - or store the current spacing somewhere
|
// todo reset after spacing changes - or store the current spacing somewhere
|
||||||
|
|
||||||
@@ -1747,37 +1798,48 @@ void wxDC::MacInstallFont() const
|
|||||||
{
|
{
|
||||||
kATSUFontTag ,
|
kATSUFontTag ,
|
||||||
kATSUSizeTag ,
|
kATSUSizeTag ,
|
||||||
kATSUColorTag ,
|
// kATSUColorTag ,
|
||||||
|
kATSUBaselineClassTag ,
|
||||||
|
kATSUVerticalCharacterTag,
|
||||||
|
|
||||||
kATSUQDBoldfaceTag ,
|
kATSUQDBoldfaceTag ,
|
||||||
kATSUQDItalicTag ,
|
kATSUQDItalicTag ,
|
||||||
kATSUQDUnderlineTag ,
|
kATSUQDUnderlineTag ,
|
||||||
kATSUQDCondensedTag ,
|
kATSUQDCondensedTag ,
|
||||||
kATSUQDExtendedTag ,
|
kATSUQDExtendedTag ,
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ByteCount atsuSizes[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] =
|
ByteCount atsuSizes[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] =
|
||||||
{
|
{
|
||||||
sizeof( ATSUFontID ) ,
|
sizeof( ATSUFontID ) ,
|
||||||
sizeof( Fixed ) ,
|
sizeof( Fixed ) ,
|
||||||
sizeof( RGBColor ) ,
|
// sizeof( RGBColor ) ,
|
||||||
|
sizeof( BslnBaselineClass ) ,
|
||||||
|
sizeof( ATSUVerticalCharacterType),
|
||||||
|
|
||||||
sizeof( Boolean ) ,
|
sizeof( Boolean ) ,
|
||||||
sizeof( Boolean ) ,
|
sizeof( Boolean ) ,
|
||||||
sizeof( Boolean ) ,
|
sizeof( Boolean ) ,
|
||||||
sizeof( Boolean ) ,
|
sizeof( Boolean ) ,
|
||||||
sizeof( Boolean ) ,
|
sizeof( Boolean ) ,
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Boolean kTrue = true ;
|
Boolean kTrue = true ;
|
||||||
Boolean kFalse = false ;
|
Boolean kFalse = false ;
|
||||||
|
BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ;
|
||||||
|
|
||||||
|
ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal;
|
||||||
|
|
||||||
ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] =
|
ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] =
|
||||||
{
|
{
|
||||||
&atsuFont ,
|
&atsuFont ,
|
||||||
&atsuSize ,
|
&atsuSize ,
|
||||||
&MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) ,
|
// &MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) ,
|
||||||
|
&kBaselineDefault ,
|
||||||
|
&kHorizontal,
|
||||||
|
|
||||||
(qdStyle & bold) ? &kTrue : &kFalse ,
|
(qdStyle & bold) ? &kTrue : &kFalse ,
|
||||||
(qdStyle & italic) ? &kTrue : &kFalse ,
|
(qdStyle & italic) ? &kTrue : &kFalse ,
|
||||||
(qdStyle & underline) ? &kTrue : &kFalse ,
|
(qdStyle & underline) ? &kTrue : &kFalse ,
|
||||||
|
Reference in New Issue
Block a user