Toolbar Icons and DPI Aware 3.1.x Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Toolbar Icons and DPI Aware 3.1.x

Post 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
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Toolbar Icons and DPI Aware 3.1.x

Post 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?
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Toolbar Icons and DPI Aware 3.1.x

Post 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.
Attachments
routes.png
routes.png (774 Bytes) Viewed 3083 times
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Toolbar Icons and DPI Aware 3.1.x

Post 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);
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Toolbar Icons and DPI Aware 3.1.x

Post 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);
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Toolbar Icons and DPI Aware 3.1.x

Post by rocrail »

The

Code: Select all

wxSystemOptions::SetOption("msw.remap", 2);
did not help either.
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Toolbar Icons and DPI Aware 3.1.x

Post 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?
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Toolbar Icons and DPI Aware 3.1.x

Post 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"


Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Toolbar Icons and DPI Aware 3.1.x

Post 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
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Toolbar Icons and DPI Aware 3.1.x

Post 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.
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Toolbar Icons and DPI Aware 3.1.x

Post 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.
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Toolbar Icons and DPI Aware 3.1.x

Post by rocrail »

Hi,

I checked it, and the DPIAwareness is at the moment not needed.
So I removed it from the manifest files.
Best regards,
Rob.
https://wiki.rocrail.net
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Toolbar Icons and DPI Aware 3.1.x

Post 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>
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Toolbar Icons and DPI Aware 3.1.x

Post by rocrail »

Hi,

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