void FixedHyperlink::Initialize()
{ // saves the old pointer
m_aOldPointer = GetPointer(); // changes the font
vcl::Font aFont = GetControlFont( ); // to underline
aFont.SetUnderline( LINESTYLE_SINGLE );
SetControlFont( aFont ); // changes the color to link color
SetControlForeground( Application::GetSettings().GetStyleSettings().GetLinkColor() ); // calculates text len
m_nTextLen = GetOutDev()->GetCtrlTextWidth( GetText() );
void FixedHyperlink::MouseMove( const MouseEvent& rMEvt )
{ // changes the pointer if the control is enabled and the mouse is over the text. if ( !rMEvt.IsLeaveWindow() && IsEnabled() && ImplIsOverText(GetPointerPosPixel()) )
SetPointer( PointerStyle::RefHand ); else
SetPointer( m_aOldPointer );
}
void FixedHyperlink::MouseButtonUp( const MouseEvent& )
{ // calls the link if the control is enabled and the mouse is over the text. if ( IsEnabled() && ImplIsOverText(GetPointerPosPixel()) )
ImplCallEventListenersAndHandler( VclEventId::ButtonClick, [this] () { m_aClickHdl.Call(*this); } );
}
IMPL_LINK(FixedHyperlink, HandleClick, FixedHyperlink&, rHyperlink, void)
{ if ( rHyperlink.m_sURL.isEmpty() ) // Nothing to do, when the URL is empty return;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.