Jump to content
Sign in to follow this  
Tripredacus

Checkbox rendering issue on certain displays

Recommended Posts

Tripredacus

I have run into a situation where a set of programs are not showing controls properly on a certain display.

The particulars are that the "top" parameter of GUICtrlCreateCheckbox needs to be increased on this display, because otherwise the objects are too close together. On other GUI panels this happens, radio buttons, etc, they are not spaced evenly as would be expected, since I am specifying values, it should respect that.

This particular GUI will read an INI file and generate checkboxes for the amount of items in the INI:

For $i = 1 To $Sections[0]
    $SectionContents = IniReadSection($source, $Sections[$i])
    $topPart = (60 + ($i * 15))
    $Radio[$i] = GUICtrlCreateCheckbox($Sections[$i], 80, $topPart, 300, 17)

It is expected that it should appear with a spacing similar to this (old image):

NnGiJWk.jpg

Which it does (albeit in a Windows 10 UI get-up) on every other sytem I work with. BUT this one system is showing something different. A sideby side of the initial look, and the with a box checked and a mouse hovering (which makes the ctrl labels shift over/under each other). OH and the mouse cursor looks bigger than usual...

r83REFg.jpgQsK283P.jpg

I can increase the value I am multiplying by, say 25 instead of 15 and it will look properly on this one display, BUT then it spaces things out too much on everything else. Are the pixels wrong on this display? Is there some other way I should be making GUIs on Windows 10 based systems?

I will note that I've seen this happen before, but it went uncorrected. The system I am seeing this on is a Clevo N850EJ. Specs are as follows:

15.6” IPS Full HD (1920x1080) Matte Display
Switchable GPU by Microsoft Hybrid Graphics - NVIDIA GeForce GTX 1050 GPU / Intel UHD Graphics

The OS I am running on is Windows PE 10 x64. Can't tell which video device is driving the display, both are detected and both are using the MS driver.

Let me know if anyone has an idea of why this happens, or ways people have fixed it, etc. Thanks!

Share this post


Link to post
Share on other sites
BrewManNH

Do you use display zoom on the computer it looks bad on?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
AutoBert

Just test the DPI of the monitor:

$iAppDPI = RegRead('HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics', 'AppliedDPI')
ConsoleWrite($iAppDPI&@CRLF)

and calculate the position of your controls. 

  • Thanks 1

Share this post


Link to post
Share on other sites
Tripredacus

It is showing me 144 for AppliedDPI, How can I use this information?

Setting the process DPI aware, or using these GDI functions have no effect.

https://www.autoitscript.com/forum/topic/166479-writing-dpi-awareness-app-workaround/

@BrewManNH This is in Windows PE, so a lot of normal things may not be viable. For example, there is no real way to make display changes because you can't reload explorer... also there is no explorer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×