Thank you for reporting the problem. It is already fixed. You can download the latest code from our ftp site or update the CExtHyperLinkButton::OnPaintHyperLink()
method in this way:
void CExtHyperLinkButton::OnPaintHyperLink(
CDC & dc,
CRect rcText,
bool bVisited,
bool bEnabled,
bool bDrawFocusRect,
bool bFocus,
bool bHover,
bool bPushed
) const
{
ASSERT_VALID( this );
ASSERT( dc.GetSafeHdc() != NULL );
CExtSafeString strHyperLinkURL = OnQueryHyperLinkURL( true );
if( strHyperLinkURL.IsEmpty() )
return;
CRect rcInitial( rcText );
int nOldBkMode = dc.SetBkMode( TRANSPARENT );
HFONT hFont = OnQueryFont();
if( ! PmBridge_GetPM()->AdjustControlFont(
hFont,
(CObject*)this
)
)
{
LOGFONT _lf;
::memset( &_lf, 0, sizeof(LOGFONT) );
::GetObject( (HGDIOBJ)hFont, sizeof(LOGFONT), (LPVOID) &_lf );
if( m_nButtonType == BS_DEFPUSHBUTTON )
_lf.lfWeight =
(_lf.lfWeight > FW_BOLD)
? _lf.lfWeight
: FW_BOLD;
if( ( bHover /*|| bFocus*/ || bPushed )
&& GetTextUnderline()
)
_lf.lfUnderline = 1;
hFont = ::CreateFontIndirect( &_lf );
}
ASSERT( hFont != NULL );
CFont _fontDestructor;
_fontDestructor.Attach( hFont );
CFont * pFont = CFont::FromHandle( hFont ); CFont * pFontOld = dc.SelectObject( pFont );
COLORREF clrText =
OnQueryHyperLinkTextColor(
bVisited,
bEnabled,
bDrawFocusRect,
bFocus,
bHover,
bPushed
);
COLORREF clrTextOld = dc.SetTextColor( clrText );
INT nTextLength = strHyperLinkURL.GetLength();
CRect rcTextLocation( 0, 0, 0, 0);
rcText.DeflateRect( 2, 2 );
DWORD dwStyle = GetStyle();
bool bMultiline = (dwStyle&BS_MULTILINE) != 0 ? true : false;
INT nAlign = 0;
const UINT __BS_H_MASK = (BS_LEFT|BS_CENTER|BS_RIGHT); const UINT __BS_V_MASK = (BS_TOP|BS_VCENTER|BS_BOTTOM);
if( (dwStyle&__BS_H_MASK) == BS_RIGHT )
nAlign |= CExtPaintManager::__ALIGN_HORIZ_RIGHT;
else if( (dwStyle&__BS_H_MASK) == BS_LEFT )
nAlign |= CExtPaintManager::__ALIGN_HORIZ_LEFT;
else
nAlign |= CExtPaintManager::__ALIGN_HORIZ_CENTER;
if( (dwStyle&__BS_V_MASK) == BS_BOTTOM )
nAlign |= CExtPaintManager::__ALIGN_VERT_BOTTOM;
else if( (dwStyle&__BS_V_MASK) == BS_TOP )
nAlign |= CExtPaintManager::__ALIGN_VERT_TOP;
else
nAlign |= CExtPaintManager::__ALIGN_VERT_CENTER;
UINT nDtMeasureFlags =
DT_LEFT|DT_TOP|DT_CALCRECT;
if( bMultiline )
{
rcTextLocation = rcText;
rcTextLocation.OffsetRect( -rcTextLocation.TopLeft() );
rcTextLocation.bottom = rcTextLocation.top;
nDtMeasureFlags |= DT_WORDBREAK;
}
else
nDtMeasureFlags |= DT_SINGLELINE;
dc.DrawText(
LPCTSTR( strHyperLinkURL ),
nTextLength,
rcTextLocation,
nDtMeasureFlags
);
rcTextLocation.OffsetRect(
rcText.TopLeft() - rcTextLocation.TopLeft()
);
UINT nDtDrawFlags = 0;
if( (nAlign&CExtPaintManager::__ALIGN_HORIZ_MASK) == CExtPaintManager::__ALIGN_HORIZ_RIGHT )
{
nDtDrawFlags |= DT_RIGHT;
rcTextLocation.OffsetRect(
rcText.Width() - rcTextLocation.Width(),
0
);
}
else if( (nAlign&CExtPaintManager::__ALIGN_HORIZ_MASK) == CExtPaintManager::__ALIGN_HORIZ_CENTER )
{
nDtDrawFlags |= DT_CENTER;
rcTextLocation.OffsetRect(
( rcText.Width() - rcTextLocation.Width() ) / 2,
0
);
}
else
nDtDrawFlags |= DT_LEFT;
if( (nAlign&CExtPaintManager::__ALIGN_VERT_MASK) == CExtPaintManager::__ALIGN_VERT_BOTTOM )
{
nDtDrawFlags |= DT_BOTTOM;
rcTextLocation.OffsetRect(
0,
rcText.Height() - rcTextLocation.Height()
);
}
else if( (nAlign&CExtPaintManager::__ALIGN_VERT_MASK) == CExtPaintManager::__ALIGN_VERT_TOP )
{
nDtDrawFlags |= DT_TOP;
}
else
{
nDtDrawFlags |= DT_VCENTER;
rcTextLocation.OffsetRect(
0,
( rcText.Height() - rcTextLocation.Height() ) / 2
);
}
if( bMultiline )
nDtDrawFlags |= DT_WORDBREAK;
else
nDtDrawFlags |= DT_SINGLELINE;
dc.DrawText(
LPCTSTR( strHyperLinkURL ),
nTextLength,
rcTextLocation,
nDtDrawFlags
);
CRect rcFocus( rcTextLocation );
rcFocus.InflateRect( 2, 2, 2, 1 );
dc.SetTextColor( clrTextOld );
dc.SelectObject( pFontOld );
dc.SetBkMode( nOldBkMode );
if( bDrawFocusRect && bFocus )
dc.DrawFocusRect( &rcFocus );
}