Page 1 of 1

Toolbar Icons and DPI Aware 3.1.x

Posted: Sat May 25, 2019 3:54 pm
by rocrail
Hi,

the toolbar icons are not OK after switching from 3.0.x to 3.1.x.
The same icons appear to be OK in the menu as you can see on the screen shot.

How to solve this?#
winaware-icons.png

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sat May 25, 2019 5:37 pm
by doublemax
Is this really related to HighDPI, i.e. does it not happen on displays with 100% scaling?

Which formats do the bitmaps have and how do you load them?
It also seems that two of the bitmaps look ok.Is there anything different about them?

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 5:02 am
by rocrail
The scaling is 100% of the screenshot. And the monitor is not high DPI: 1280x800. Win10-64.
The icons are PNG: 24x24.
The Icon, routes, attached looks OK in the menu but not in the toolbar.

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 5:35 am
by rocrail
I will give this note a try:
https://docs.wxwidgets.org/3.0/classwx_tool_bar.html wrote:wxMSW note: Note that under wxMSW toolbar paints tools to reflect system-wide colours. If you use more than 16 colours in your tool bitmaps, you may wish to suppress this behaviour, otherwise system colours in your bitmaps will inadvertently be mapped to system colours. To do this, set the msw.remap system option before creating the toolbar:

wxSystemOptions::SetOption("msw.remap", 0);

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 6:37 am
by rocrail
That did not help; No improvement...
It seems that 3.1.x cannot handle transparency in the toolbar icons.
Any tips?

I also will try
wxSystemOptions::SetOption("msw.remap", 2);

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 6:52 am
by rocrail
The

Code: Select all

wxSystemOptions::SetOption("msw.remap", 2);
did not help either.

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 7:24 am
by doublemax
The problem seems to be manifest related, too.
https://groups.google.com/d/msg/wx-user ... tHhs48AAAJ

What's the complete content of your manifest now?

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 7:47 am
by rocrail
The complete manifest:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0' xmlns:asmv3='urn:schemas-microsoft-com:asm.v3'>
  <asmv3:application>
    <asmv3:windowsSettings>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>
The rc file:

Code: Select all

#define wxUSE_NO_MANIFEST 1
#include "wx/msw/wx.rc"
wxDEFAULT_FRAME ICON "xpm/rocrail.ico"
#ifdef ISOLATION_AWARE_ENABLED
#define wxMANIFEST_ID 2
#else
#define wxMANIFEST_ID 1
#endif
wxMANIFEST_ID 24 "rocview.manifest"



Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 8:41 am
by rocrail
I changed the manifest into 3 CPU dependent files and includes them accordantly wx.rc.
The amd64 looks like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0' xmlns:asmv3='urn:schemas-microsoft-com:asm.v3'>
  <assemblyIdentity version="0.64.1.0" processorArchitecture="amd64" name="Controls" type="win32"/>
  <description>wxWindows application</description>
  <asmv3:application>
    <asmv3:windowsSettings>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness>
    </asmv3:windowsSettings>
  </asmv3:application>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df" language="*"/>
    </dependentAssembly>
  </dependency>
</assembly>
Now the toolbar is OK again... :roll:
3.1.png

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 10:16 am
by doublemax
The missing ""Microsoft.Windows.Common-Controls"" part was probably responsible for the icon problem.

And as mentioned before, i would remove the "permonitor" part, because wxWidgets doesn't support that yet.

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 11:53 am
by rocrail
doublemax wrote: Sun May 26, 2019 10:16 am And as mentioned before, i would remove the "permonitor" part, because wxWidgets doesn't support that yet.
if I leave that out the App is no longer DPI Aware and is scaled. Even if wxWidgets does not support this option, it is still needed to get the app DPI Aware under Windows 10.

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 1:20 pm
by rocrail
Hi,

I checked it, and the DPIAwareness is at the moment not needed.
So I removed it from the manifest files.

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 3:35 pm
by PB
rocrail wrote: Sun May 26, 2019 1:20 pm I checked it, and the DPIAwareness is at the moment not needed.
What does it mean? Do you actually have a high-DPI setup? I do and as a user I find applications not supporting high DPI basically unusable: you can choose between them being rather unpleasantly blurry or their text/bitmaps being too small to be usable. In a well-behaved wxWidgets application, adding a high DPI support may not be time consuming.

</rant>

Re: Toolbar Icons and DPI Aware 3.1.x

Posted: Sun May 26, 2019 4:17 pm
by rocrail
Hi,

no, my application is not 100% HDI ready.
Just check:
https://wiki.rocrail.net/rocrail-snapshot/