wxHyperLinkCtrl is cut off when the font is too large

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
ibrahim
Earned some good credits
Earned some good credits
Posts: 124
Joined: Mon Mar 14, 2022 8:02 am

wxHyperLinkCtrl is cut off when the font is too large

Post by ibrahim »

In wxWidgets 3.1.6. I created the wxHyperLinkCtrl with "wxDefaultSize".

Please post something straightfoward.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxHyperLinkCtrl is cut off when the font is too large

Post by doublemax »

This is far too little information.

Platform?
Hi DPI display? (If under Windows, is scaling > 100% ?)

What's the outer structure of the control? Are you using sizers? Is the outer frame even big enough to display the full text?
Use the source, Luke!
ibrahim
Earned some good credits
Earned some good credits
Posts: 124
Joined: Mon Mar 14, 2022 8:02 am

Re: wxHyperLinkCtrl is cut off when the font is too large

Post by ibrahim »

Platform : Windows

Scaling : 125%

Im not using sizers.

Im using wxDefaultSize, so it should be big enough
ibrahim
Earned some good credits
Earned some good credits
Posts: 124
Joined: Mon Mar 14, 2022 8:02 am

Re: wxHyperLinkCtrl is cut off when the font is too large

Post by ibrahim »

Hmm , without using wxDefaultSize , the wxHyperTextCtrl seems to size properly.

That's weird , why doesn't wxDefaultSize just figure out the right size ??
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxHyperLinkCtrl is cut off when the font is too large

Post by ONEEYEMAN »

Hi,
Because you are NOT using sizers?
We've already been thru this (I think). Start using sizers, which will help you avoid a lot of manual work or reinvent the wheel and do everything by hand.
But in that case - why even bother with wxWidgets?

Thank you.
Last edited by ONEEYEMAN on Thu Jun 30, 2022 12:23 pm, edited 1 time in total.
ibrahim
Earned some good credits
Earned some good credits
Posts: 124
Joined: Mon Mar 14, 2022 8:02 am

Re: wxHyperLinkCtrl is cut off when the font is too large

Post by ibrahim »

I was using sizers before this, but my team/client couldn't live with the unfortunate changes that sizers had an effect on, so I ditched it.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxHyperLinkCtrl is cut off when the font is too large

Post by ONEEYEMAN »

Hi,
Could you please elaborate on those "changes"?

Also, if you client is willing to pay X amount of $$, they will definitely will be able to live with whatever changes you do... :D

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxHyperLinkCtrl is cut off when the font is too large

Post by doublemax »

ibrahim wrote: Thu Jun 30, 2022 12:02 pm Platform : Windows

Scaling : 125%

Im not using sizers.

Im using wxDefaultSize, so it should be big enough
Can you check what happens with 100%? It's still possible that the size calculation of the control is wrong when using a different scaling.

Also please check what happens if you use wxGenericHyperLinkCtrl instead of wxHyperLinkCtrl. You need to include <wx/generic/hyperlink.h> in order to use it.
Use the source, Luke!
ibrahim
Earned some good credits
Earned some good credits
Posts: 124
Joined: Mon Mar 14, 2022 8:02 am

Re: wxHyperLinkCtrl is cut off when the font is too large

Post by ibrahim »

I already figured this out
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxHyperLinkCtrl is cut off when the font is too large

Post by ONEEYEMAN »

Hi,
Can you post the solution?
It might be beneficial for other people...

Thank you.
Post Reply