Print Page | Close Window

[solved] v17 BUG Text clipped MarkUp

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=22832
Printed Date: 05 October 2024 at 1:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved] v17 BUG Text clipped MarkUp
Posted By: MacW
Subject: [solved] v17 BUG Text clipped MarkUp
Date Posted: 09 January 2016 at 1:29pm
Hi,

congrats to the new release. Surely a lot of work was put into that.

Unfortunately, after installing the final version, it tool only 5 seconds to find the first bug:

I use task dialogs with XAML markup. In the new version, text is clipped in the middle of the sentence, the Verify check boxes are clpped in the middle of the sentence etc. I cannot ship my software with this bug, please respond swiftly.

The text clipped is:

<TextBlock TextWrapping='Wrap'>Reset only the options in this dialog.</TextBlock>

while the text

<TextBlock TextWrapping='Wrap'>Reset the options in this dialog and also all custom data settings I made for individual file formats.</TextBlock>

is displayed correctly. See:



The text in the upper row should read "Reset the options in this dialog."

Here is an example with a clipped Verify check box: It should read "Don't show this message again".

This problem is new to version 17.




The screen shots were taken on a standard 4K monitor with 3940 pixels horizontal resolution at 150% font-size scaling (Windows) and 144 DPI.

Please advice, I need to ship on Tuesday.




Replies:
Posted By: MacW
Date Posted: 10 January 2016 at 10:39am
Maybe this is related to clipped text in Task Dialogs (see my other post).

Version 17 clips text output in tool tips. The width is apparently calculated correct, but the text is clipped somewhere in the middle:



Please advice soonest.

Windows 10 64-bit. 4K monitor with 3940 pixel and 144 DPI.


Posted By: MacW
Date Posted: 12 January 2016 at 9:20am
I have found out that this seems to be related to how you manage DPI awareness in your toolkit.

The CXTPDpi::Init() method gets called very early, by some static variables you fill.

You call GetDC(NULL) and calculate the screen DPI as 96.
But the monitor is actually using 144 DPI.

After I figured that, I placed a call to

XTPDpiHelper()->Invalidate();

in the constructor of CMainFrame. This causes the method

CXTPDpi::Init()

to be called again. And this time, the DC returned by GetDC(NULL) returns the correct 144 DPI. Seems to be a side-effect of XTP or MFC initialization.

This solves the problem with the clipped "Verify" texts in Task dialogs, but not the other problems.
The problem with the clipped text in tooltips is also not affected by this change.

I had so far no feedback on these issues.
I'm already preparing plan B, going back to XTP version 16. Too many issues with the 17 release, sorry.



Posted By: iamgtd
Date Posted: 02 February 2016 at 5:23am
Since the update to V 17.0 the xaml caption of a backstagebutton is truncated. That means from a text with several words the last word isn't shown. If one character is added to the last word, the caption will be shown correctly. Not every text is concerned, we using on other backstagebuttons shorter and also longer captions without this problem.

I have created a sample which shows this behaviour. The labels above the buttons shows the text for the caption. You can see that on Test1 and Test3 the captions are truncated. On buttons 3 and 4 all letters are replaced by numbers.



uploads/4998/TestCodejockBackstageButton.zip" rel="nofollow - uploads/4998/TestCodejockBackstageButton.zip


-------------
---------

OS: Win 10 64 bit

Codejock Version 22.1 ActiveX

MS Visual Studio 2022 - C#

---------


Posted By: iamgtd
Date Posted: 19 April 2016 at 3:39am
The issue with truncated caption on backstagebuttons isn't fixed with v17.2


-------------
---------

OS: Win 10 64 bit

Codejock Version 22.1 ActiveX

MS Visual Studio 2022 - C#

---------


Posted By: olebed
Date Posted: 19 April 2016 at 5:14am
Hello iamgtd,
Your sample is very helpful, but I can't find reason and solution yet.
I found svn revision where bug was introduced, but  that was branch merging with a lot of changes in markup.


Posted By: MacW
Date Posted: 23 April 2016 at 3:16am
Just installed version 17.2.0.
This problem is not fixed.

The  task dialog still renders only

"Reset only the options in this"

when using

<TextBlock TextWrapping='Wrap'>Reset only the options in this dialog.</TextBlock>

as the source.


Monitor with 144 DPI setting, Windows 10.



Posted By: agontarenko
Date Posted: 23 May 2016 at 2:42am
Hello All,

I'm glad to inform you that the issue has been fixed. The fix will be available in the next beta or final release.

as hot fix you can change method CXTPMarkupGdiPlusDeviceContext::MeasureString  in file Source/Markup/DeviceContext/XTPMarkupGdiPlusDeviceContext.cpp.
Just delete ceil() calls
  sz.cx = static_cast<int>(rc.Width);
  sz.cy = static_cast<int>(rc.Height);
Regards,
Artem Gontarenko


Posted By: MacW
Date Posted: 03 June 2016 at 2:45am
Hi, Artem

I've made the patch, re-compiled XTP and the problem is gone.

Good job! Thank you very much. Smile



Posted By: Marlon
Date Posted: 12 June 2016 at 12:55pm
Originally posted by agontarenko agontarenko wrote:

Hello All,

I'm glad to inform you that the issue has been fixed. The fix will be available in the next beta or final release.
When it will be release?


-------------
Marlon



Product: Xtreme SuitePro (ActiveX) version 17.2.0

     Platform: Windows 10(64bit)
     Language: Access 2007 (VBA)



Posted By: agontarenko
Date Posted: 13 June 2016 at 10:09am
Probably sometime mid July


Posted By: Marlon
Date Posted: 13 June 2016 at 3:25pm
Thanks

-------------
Marlon



Product: Xtreme SuitePro (ActiveX) version 17.2.0

     Platform: Windows 10(64bit)
     Language: Access 2007 (VBA)




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net