Bug 5587

Unable to switch menu and toolbar icons using PNGs during runtime 20 November, 2020

Constantin Bergatt
12 November, 2020
Product: PowerBuilder Category: Controls & UI
Version: 2019 R2 Build: 2353
Classification: Appeon bug Publishing: Public
Priority: P3
Status: Scheduling Reason:
Mark Lee @Appeon 16 November, 2020
#6
Hi Constantin,

Thanks for your reporting this problem and providing the test case.
I can reproduce it on our end and will do further research to figure it out.
We will keep you updated!

BTW, we've found that PB 12.6 doesn't have the same behavior.
And we don't have a feasible workaround for this currently except using GIF files 

Regards,
Mark Lee
Constantin Bergatt 16 November, 2020
#5
Hi Chris,

many thanks for all your efforts!

Please let me know, if I can help you or the team to further investigate this issue.

Regards,
Constantin
Chris Pollach @Appeon 13 November, 2020
#4
Hi Constantin;

  Thank you for the screen capture to further solidify what you are experiencing.

  Unfortunately, I cannot reproduce the issue on my W10 PC's. I reran the test case again this AM as I just upgraded last night to W10 20H2 (build 19042) and the icons are still displaying consistently OK for me.

  I will now transfer this ticket over to the main Support Team to see if they can replicate this issue on one of their PB/W10 test machines.

Regards ... Chris
Constantin Bergatt 13 November, 2020
#3
Screenshot.png (926KB)

Hello Chris,

many thanks for the quick reply!

The described behavior is reproducable on all machines tested so far (some Workstations of colleagues of mine and some test server).

The problem only arises when running the deployed application itself. Starting the application from within the workspace itself, does always work. There are also differing results, when running the deployed application from within the "workspace" folder (where all the relative pathes used within the application and the PBR file are still valid) versus running the deployed application outside of the "workspace" Folder (where all the relative pathes used within the application and PBR files are invalid).

When run from within the "workspace" folder the :
- the PNG icons of the menu items are changed correctly,
- BUT the PNG icons of the toolbar icons do not change at all.
- the GIF Icons do work for menu as well as toolbar items.

When run from outside of the "workspace" Folder and clicking on the respective menu / toolbar item :
- the PNG icons of the menu items are lost, and
- the PNG icons of the toolbar icons do not change at all.
- the GIF Icons do work for menu as well as toolbar items.

I've attached a respective "Screenshot.png" to visualize the problem a little bit more in detail.

Regards,
Constantin
Chris Pollach @Appeon 12 November, 2020
#2
Hi Constantin;

  Thank you for supplying a Test Case PB App for this issue that you are having!

  I was able to run the test app under my PB2019R2 build 2353 but unfortunately, was not able to reproduce any menu or toolbar stability or drawing issues. 

  Note: I am using W10 2004 build 19041 on a real AMD based PC with a high end Radon graphics card.

   Have you tried this test App on various PC's in your organization?

Regards ... Chris
Constantin Bergatt 12 November, 2020
#1
testapp.7z (28KB)

*Phenomenon:
Currently we are in the process of "repainting" all of our icons. During this process we decided to go for an overall usage of PNG files instead of our up-to-now mix of ICO, BMP and GIF files.

But after changing all icons to PNGs we ran into the following issue. Using PNG files for the icons of the menu and toolbar items does work fine. But trying to change the icons of the menu and toolbar items during runtime (running the deployed executable) with other PNGs is not working at all. When trying to do this, two things happen :
1. the icon of the menu item gets lost, and
2. the icon of the toolbar item stays the same as before.

Doing the same thing, but using GIF files is working fine.

*Reproduce Steps:
You can find a respective test application attached to this bug (see testapp.7z).

1. Create a small test application with a very simple window, which does have a menu.
2. Add menu and toolbar item and assign a PNG file as icon for the menu item as well as the toolbar item.
3. On the click event of this item implement a functionality to switch the current icon for the menu item as well as the toolbar item with another PNG file.
4. Deploy the application.
5. Run the deployed application right from the place where they were created and check the initial state of the menu and toolbar items.
Result : The icon of the menu as well as the toolbar item are visible and are looking fine.

6. Click once on the menu item, which should trigger the icon change for the menu as well as the toolbar item.
Result : The icon of the menu item does change correctly due to the availability of the respective resource (PNG) file, whereas the toolbar item does not change at all.
Expected : Both, the icons of the menu as well as toolbar item, will show the new icon correctly.

7. Copy the deployed application, to another folder (in order to invalidate the used relative paths for ressources) and check the initial state of the menu and toolbar items.
Result : Both icons are visible and are looking fine.

8. Click once on the menu item, which should trigger the icon change for the menu as well as the toolbar item.
Result : The menu item does lose its icon, whereas the icon of the toolbar does not change at all.
Expected : Both, the icons of the menu as well as toolbar item, will show the new icon correctly.

Remarks:
OS:
Windows 10
Platform:
All
Database Type:
SAP SQL Anywhere
Database Version:
17.0.10.5913