1. Jorge Escobar
  2. PowerBuilder
  3. Saturday, 7 January 2023 16:28 PM UTC

Hello everyone

I am developing an application under UX concepts in order to improve Usability and Accessibility and what I am looking for is that the layer type window changes opacity when a response type window overlaps so that the user's attention is focused only on this area (something like I show in the image).

I have tried playing with the "Transparency" property of the objects contained in the layer type window, but I did not achieve the desired effect.

I would appreciate if you have any ideas or if the Appeon development team considers it for a next version.

Thanks

Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 10 January 2023 21:24 PM UTC
  2. PowerBuilder
  3. # 1

Web pages do this by displaying a partially transparent control over the page before opening the popup. You should be able to do the same in PowerBuilder.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 10 January 2023 15:30 PM UTC
  2. PowerBuilder
  3. # 2

Hi Jorge;

  I have no issues doing this in my STD framework. For example ...

  In the above example, the Zoom window just uses a function that sets the Window's transparency property as follows:

THIS.transparency  =  ai_transparency           // Save setting

No special MS-Windows API's are required. The transparency in the above example is 40% and a solid window is 0%

Tip: Have a look at the "wn_zoom_master" object class in the framework.  HTH

Regards ... Chris

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 9 January 2023 03:55 AM UTC
  2. PowerBuilder
  3. # 3

This evening I was able to throw together a little sample app that makes the window partially transparent and then opaque again (thanks for the URL's you provided, Miguel!) using the GetWindowLongW, SetWindowLongW and SetLayeredWindowAttributes API functions. No manifest is needed, at least on a system running Windows 10.

To perform the bitwise Or and bitwise Not operations, I borrowed the Numerical Service object from the PowerBuilder Foundation Class (PFC) libraries.

Have fun!

Attachments (1)
Comment
  1. Miguel Leeuwe
  2. Monday, 9 January 2023 05:22 AM UTC
Great work John!
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Sunday, 8 January 2023 13:48 PM UTC
  2. PowerBuilder
  3. # 4

John is right,

Do a search https://duckduckgo.com/?q=powerbuilder+transparent+window&atb=v354-1&ia=web and you should find what you need.

Don't forget to change al Hwnd variables in API functions need to be changed to LongPtr data type.

https://www.programmersought.com/article/47565355406/ 

https://github.com/thansuoi113/PowerBuilder-Make-The-Window-Transparent/tree/main/PB105/src 

https://www.rgagnon.com/pbdetails/pb-0210.html 

 

Instead of using windows APIs, you can also use the transparency attributes of Powerbuilder itself, but I think that in that case you will also have to set the transparency of any objects on top of your window:

https://community.appeon.com/index.php/qna/q-a/transparent-windows-in-windows-10 

https://docs.appeon.com/pb2017r3/migrating_pb_apps/ch07s03.html 

regards,

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Saturday, 7 January 2023 21:28 PM UTC
  2. PowerBuilder
  3. # 5

Hi, Jorge - 

I've not done this, but a search of the Windows API indicates this can be accomplished by setting/changing the window style via the SetWindowLong API function and then using the SetWindowLayeredAttributes API function. Here is a link you should examine that includes some C/C++ code snippets:

   https://learn.microsoft.com/en-us/windows/win32/winmsg/using-windows#using-layered-windows

Note the last sentence in this section: "In order to use layered child windows, the application has to declare itself Windows 8-aware in the manifest." I'm not familiar with the use of manifests, so I don't know what OS-awareness level(s) applications created in the latest versions of PB are. All I'm saying that utilizing the API functions listed above may not produce the desired behavior unless a custom manifest accompanies the app.

Best regards, John

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.