Recent

Author Topic: Screen display issue  (Read 7420 times)

Davo

  • Full Member
  • ***
  • Posts: 134
Screen display issue
« on: July 21, 2013, 12:34:26 am »
My recent 32 bit application was developed using Win7 with a screen resolution set to the default 1920 x 1080 pixels and with the text magnification set to the default “Smaller – 100%”. When the same screen resolution is used but the text magnification is reset to “Larger – 150%” the various forms continue to be correctly rendered on the screen. But when the text magnification is reset to “Medium – 125%” the forms are clipped and some embedded text overspills its allotted space on its form. This differential result seems somewhat strange but there is no doubt some rational explanation. And clearly I need to address the issue – not least because Win8 users seem to have different default screen display settings to their Win7 (and earlier) counterparts.

It would be much appreciated if someone could point me in the right direction.

Modification : I should add that screen resolution is not the problem. The application works just fine at resolutions of 1600 x 900 and 1280 x 720 pixels when the text magnification remains at "Smaller - 100%". The problem seems only to appear when the "Medium - 125%" text magnification is used.
« Last Edit: July 30, 2013, 02:54:37 pm by Davo »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Screen display issue
« Reply #1 on: July 21, 2013, 06:18:15 am »
Did you forget to mention your Lazarus version?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Davo

  • Full Member
  • ***
  • Posts: 134
Re: Screen display issue
« Reply #2 on: July 21, 2013, 06:39:06 am »
Lazarus version 0.9.30.4
Date 2012-03-14
FPC Version 2.6.0
SVN Revision 35940
1396-win 32-win 32/win 64

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Screen display issue
« Reply #3 on: July 21, 2013, 07:19:51 am »
Sorry, don't know about the screen issues, but I do know that Laz 0.9.30 is very old and a lot of fixes have gone into Lazarus.

You might try with the latest stable version (Lazarus 1.0.10+FPC2.6.2); if you don't want to replace your current Lazarus, you could install it with a different --pcp (see http://wiki.lazarus.freepascal.org/Multiple_Lazarus)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Davo

  • Full Member
  • ***
  • Posts: 134
Re: Screen display issue
« Reply #4 on: July 22, 2013, 08:37:14 pm »
Thanks BigChimp. I followed your advice and installed the Lazarus 1.0.10 version with FPC2.6.2. A good thing to do in any case.

Unfortunately it has not solved the problem with clipped forms, etc. when the the user sets his text magnification level to 125%.

Not sure where to go from here.

Davo

kpeters58

  • Sr. Member
  • ****
  • Posts: 267
Re: Screen display issue
« Reply #5 on: July 23, 2013, 07:21:37 pm »
I have never heard of the term 'text magnification' - what do you mean by that?

Also, please post some screenshots as it's hard to guess what's going on just by your written description - thanks!
Lazarus 2.0.4/FPC 3.0.4/Win 64

kpeters58

  • Sr. Member
  • ****
  • Posts: 267
Re: Screen display issue
« Reply #6 on: July 24, 2013, 07:23:07 pm »
Guessing from the 125% & 150% settings you have mentioned that you are talking about the DPI settings for your screen(s).

If so, read this Delphi article here:
http://delphi.about.com/od/standards/a/aa030700a.htm

THH,
Kai
Lazarus 2.0.4/FPC 3.0.4/Win 64

garlar27

  • Hero Member
  • *****
  • Posts: 652
Re: Screen display issue
« Reply #7 on: July 24, 2013, 10:58:38 pm »

You need to make your software "DPI Aware" to make it look the same on high DPI resolutions.

Look at this http://wiki.lazarus.freepascal.org/High_DPI

Davo

  • Full Member
  • ***
  • Posts: 134
Re: Screen display issue
« Reply #8 on: July 25, 2013, 03:35:15 am »
Thanks kpeters58 and garlar27. Yes it looks like I need to get to grips with the DPI issue. I need to digest the articles that you mention. It's a bit of a learning curve. I'll post another reply with my results. Thanks again.

Davo

Davo

  • Full Member
  • ***
  • Posts: 134
Re: Screen display issue
« Reply #9 on: July 30, 2013, 02:51:51 pm »
This reply is quite long and is really only of interest if you are developing applications to run under Windows. If that is not the case you may want to pass on to another topic. But if you do develop applications for Windows you may find some use in the following.

The issue that I faced was correctly diagnosed as the need to make my application DPI aware. Using a small test application I followed the instructions set out in the Wiki article “High DPI' and this resulted in an immediate improvement in the display of its two forms across the entire range of DPI settings (96 ppi, 120 ppi and 144 ppi). However, I found that there were some matters that still needed to be addressed :
  • It is no doubt obvious, but it is not explicitly stated in the Wiki article, that the unit uScaleDPI must be declared in the uses clause of each of the application's forms.
  • The autosize property of all forms and all visible components on a form needs to be set to false.
  • If the height of any form is dynamically adjusted at run time, a different height value needs to be specified for each DPI setting.
  • Similarly, if the height of any visible component (for example a panel) is dynamically set at run time, a different height value needs to be specified for each DPI setting.
  • If a form has a main menu, the right side of the rightmost menu item should not extend further to the right on the form than all of the other visible components. If this is not observed the enlarged menu text used at higher DPI settings will cause the menu items to double-bank into two (or more) rows and that will very likely result in some components at the bottom of the form disappearing out of view.
Another matter noticed was what seems to be an annoying bug in Windows. It certainly is present in Windows 7. For all I know it may also be present in other versions of Windows. The bug is that whenever one moves from a larger DPI setting to a smaller one, the font size used for menu items and other text objects is excessively reduced. For example after reducing from 144ppi to 96ppi you may find menu items, etc in your web browser window displayed at font size 6 whereas they should normally be displayed at font size 9. With trial and error I eventually found that the solution to this problem was to use the Personalisation settings accessed from the Windows Control Panel. Selecting either the default Windows theme or your previously saved personal theme reinstates the proper font size.

My thanks again for the very helpful advice received.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Screen display issue
« Reply #10 on: July 30, 2013, 02:54:51 pm »
Thanks for that post Davo!
Quote
It is no doubt obvious, but it is not explicitly stated in the Wiki article, that the unit uScaleDPI must be declared in the uses clause of each of the application's forms.
if the wiki needs improvement, please feel free to do it ;) I for one can always do with spelling out the obvious... better than leaving it out.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018