Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > MarkupLabel Control
  New Posts New Posts RSS Feed - [SOLVED]XAML hypertext underline is sticking
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED]XAML hypertext underline is sticking

 Post Reply Post Reply
Author
Message
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 202
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED]XAML hypertext underline is sticking
    Posted: 10 November 2016 at 9:39am
(moved from this topic)
Thanks a lot Oleksandr ! It's clear now :)
Waiting for your samples updated (next version I presume ?).
Another question : can you explain me why the same XAML code produces these two different results in 16.3 and 17.3 ?



The hypertext underline is sticking to the text in 17.3, the 16.3 result seems a lot more readable...
Thanks.
Back to Top
olebed View Drop Down
Admin Group
Admin Group
Avatar

Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 544
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2016 at 11:55am
There many changes between these versions, try to use other font or its properties.
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 202
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2016 at 12:41pm
I tried but can't find a suitable font... Do you have one ?
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Fredrik View Drop Down
Senior Member
Senior Member


Joined: 22 June 2005
Status: Offline
Points: 130
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fredrik Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2016 at 1:27pm
Originally posted by olebed olebed wrote:

There many changes between these versions, try to use other font or its properties.

... I don't really think the solution here is to use another font. I'd like to continue using Segoe UI in my case... 

Windows 10, Visual Studio 2015, Toolkit Pro 17.0.0 RC
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 202
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2016 at 3:54pm
I agree with you... Any solution ?
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 202
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2016 at 4:55pm
I've tried more than 20 fonts and, for all of them, the underline is stuck to the text...
Oleksandr : can you help me ?
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 202
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2016 at 5:20pm
It seems to be related to GDI+.
See the examples below (note the space aroud the "sender adress" and the fact that the final dot is not positioned correctly when GDI+ is on) :





For my label, ok, I can access the "MarkupContext" object and disable GDI+.
But it seems to be a bug don't you think ?
And, also, for some controls (like taskpanel) I can enable markup but I can't access the markup context object !

Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2016 at 10:13am
Hello Lodep59,

I'm glad to inform you that the issue has been fixed.
As hotfix you can change function as below.

SIZE CXTPMarkupGdiPlusDeviceContext::MeasureString(LPCWSTR lpszText, int nCount) const
{
    SIZE sz = { 0 };

    RectF rc;
    RectF layoutRect(0, 0, 0.0f, 0.0f);

    if (Gdiplus::Ok == m_pGdiPlus->GdipMeasureString(GetGraphics(),
        lpszText, nCount, AccessFont(), &layoutRect,
        m_pGpStringFormat, &rc, 0, 0))
    {
        sz.cx = static_cast<int>(CXTPMathUtils::Round(rc.Width)); //fixed
        sz.cy = static_cast<int>(CXTPMathUtils::Round(rc.Height)); //fixed
    }

    return sz;
}
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.078 seconds.