Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » Potential QTF minor bug or misunderstanding
Potential QTF minor bug or misunderstanding [message #51592] Thu, 18 April 2019 15:35 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
Using a RichTextCtrl with Margins and a very specific qtf causes the size calculations to ignore a word that is moved from one line to the other.

Application attached. Press the button.

Here is the interesting bit.

The QTF ends in "}}]". This causes the problem.

Using "}}\n]" still has the problem.

Using a space, "}} ]" works.

Is this a bug or did I misunderstand spacing rules in QTF?

Edit: adding the space, "}} ]" causes other qtfs that displayed properly before to be larger.

This can be reproduced by deleting "descending" from the qtf.
  • Attachment: testqtf.zip
    (Size: 1.44KB, Downloaded 6 times)

[Updated on: Thu, 18 April 2019 15:42]

Report message to a moderator

Re: Potential QTF minor bug or misunderstanding [message #51593 is a reply to message #51592] Thu, 18 April 2019 15:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11864
Registered: November 2005
Ultimate Member
cbpporter wrote on Thu, 18 April 2019 15:35
Using a RichTextCtrl with Margins and a very specific qtf causes the size calculations to ignore a word that is moved from one line to the other.

Application attached. Press the button.

Here is the interesting bit.

The QTF ends in "}}]". This causes the problem.

Using "}}\n]" still has the problem.

Using a space, "}} ]" works.

Is this a bug or did I misunderstand spacing rules in QTF?

Edit: adding the space, "}} ]" causes other qtfs that displayed properly before to be larger.

This can be reproduced by deleting "descending" from the qtf.


Works for me, but I suspect that is just by chance (my font size and my display etc...)

Can you post screenshot?

Mirek
Re: Potential QTF minor bug or misunderstanding [message #51594 is a reply to message #51593] Thu, 18 April 2019 15:52 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
Added cleaner example, without some wrong and redundant calculations (yey, found an ancient bug).

And screenshot. The larger you make the margin, the worse it gets: more is cut off.

I have 150% zoom on my desktop, but I'm also using some hacks to turn Win10 zoom into Win8 zoom. That's why screenshots are blurry.

The key to the issue is having the line of text break in two I believe, so that might work without changing zoom.

Edit: the new cleaner example no longer depends on the use of space in QTF, looks like a margin issue.
  • Attachment: qtf.png
    (Size: 9.18KB, Downloaded 45 times)
  • Attachment: testqtf.zip
    (Size: 1.38KB, Downloaded 7 times)

[Updated on: Thu, 18 April 2019 15:55]

Report message to a moderator

Re: Potential QTF minor bug or misunderstanding [message #51644 is a reply to message #51594] Tue, 23 April 2019 09:28 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
I added Ctrl::NoLayoutZoom() in main but still doesn't help.

It looks to be a margin issue, combined with the hidden scroll bar. If I enable scrollbar, the size is good. But it is my expectation that for at least small popups, margin should add on to the calculated size in both dimensions. Is it a wrong expectation?

The issue still looks like it only happens when the last word in the qtf, "indices" doesn't fit on the last line and is moved to a new line due to left justified text.

index.php?t=getfile&id=5821&private=0
  • Attachment: qtf2.png
    (Size: 17.15KB, Downloaded 80 times)

[Updated on: Tue, 23 April 2019 09:32]

Report message to a moderator

Re: Potential QTF minor bug or misunderstanding [message #51693 is a reply to message #51644] Fri, 26 April 2019 11:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11864
Registered: November 2005
Ultimate Member
Well, Margin is not accounted for in GetHeight, that is the root of problems.

I guess for your particular case, the metrics methods are sort of missing. However, if you look into ide AssistEditor::SyncAnnotationPopup() there is complete solution, you just need to account for margins...

Mirek
Re: Potential QTF minor bug or misunderstanding [message #51726 is a reply to message #51693] Fri, 03 May 2019 10:52 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
mirek wrote on Fri, 26 April 2019 12:04
Well, Margin is not accounted for in GetHeight, that is the root of problems.

I guess for your particular case, the metrics methods are sort of missing. However, if you look into ide AssistEditor::SyncAnnotationPopup() there is complete solution, you just need to account for margins...

Mirek

Thanks! For now I added (Zx(margin) + 1) * 2 to both height and width. Probably not perfect but improved.
Previous Topic: RawRichText - is it possible to have a fixed width RichTable column?
Next Topic: uword table and ctrl+a (bug)
Goto Forum:
  


Current Time: Sun May 26 13:03:40 CEST 2019

Total time taken to generate the page: 0.00848 seconds