1. Rajesh Kanna
  2. PowerBuilder
  3. Monday, 19 August 2024 12:05 PM UTC

Hi Team,

Kindly help me to resolve the below challenge.

Assume - UI screen is opened state.

When change the scale value percentage (150 to 125% or any) in display setting, window is getting resized and it has some empty space at right side of the window. In such case, if we widen the window, contents are not scaling properly.

I'm using n_resizeattrib, n_resize_service, n_dwresizeattrib and n_dwresize_service.

 

Below script added in window's open event:

//register objects to be resized
//inv_resize.of_register(tab_1, inv_resize.scaleright)
inv_resize.of_register(tab_1, inv_resize.scalerightbottom)
//inv_resize.of_register(tab_1.tabpage_1, inv_resize.scaleright)
inv_resize.of_register(tab_1.tabpage_1, inv_resize.scalerightbottom)
inv_resize.of_register(tab_1.tabpage_1.ddlb_status, inv_resize.scaleright)
//inv_resize.of_register(tab_1.tabpage_1.dw_select, inv_resize.scaleright)
inv_resize.of_register(tab_1.tabpage_1.dw_select, inv_resize.scalerightbottom)
inv_resize.of_register(tab_1.tabpage_2, inv_resize.scaleright)
inv_resize.of_register(tab_1.tabpage_2.dw_header, inv_resize.scaleright)
inv_resize.of_register(tab_1.tabpage_2.tab_2, inv_resize.scaleright)
inv_resize.of_register(tab_1.tabpage_2.tab_2.tabpage_audit, inv_resize.scaleright)
inv_resize.of_register(tab_1.tabpage_2.tab_2.tabpage_audit.dw_audit, inv_resize.scaleright)
inv_resize.of_register(tab_1.tabpage_2.tab_2.tabpage_detail, inv_resize.scaleright)
inv_resize.of_register(tab_1.tabpage_2.tab_2.tabpage_detail.dw_detail, inv_resize.scaleright)
inv_resize.of_register(tab_1.tabpage_2.tab_2.tabpage_document, inv_resize.scaleright)
inv_resize.of_register(tab_1.tabpage_2.tab_2.tabpage_document.r_1, inv_resize.scaleright)

 

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 21 August 2024 14:25 PM UTC
  2. PowerBuilder
  3. # Permalink
My suggestion was and still is: Provide a small example application that uses the Window and DW resize service objects extracted from the PFC that you were originally using, that exhibits the problem behavior in order to properly troubleshoot the issue instead of making major changes in an attempt to find something that may work. My offer to help diagnose in my free/off time stands (for now), but if you don't wish to make use of the offer, just say so and I'll move on.
Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 22 August 2024 04:29 AM UTC
  2. PowerBuilder
  3. # 1

Your example app does not utilize the PFC-based resize service objects as derived by Kevin Ridley - It instead utilizes what appears to be an Appeon-developed resize user object, which I am completely unfamiliar with.

In light of this unexpected change, I've opted to provide you with a second PBL that contains PFC-based resize service objects for Windows and DataWindows in the attached zip file, which should be functionally very close to what Kevin makes available. These are objects I previously had available to me. An ancestor DW control that contains the necessary hooks to use the DW resize service and a simple main window are also included.

The only change I made in your original PBL was to replace the existing code in the Application object's Open event with code that instead opens the window that I've included.

When the window resizes, the Close button moves and the DW resizes appropriately. The DW resize service has been set up to alter the width of the "desc" column to correspond to the DW control's width.

Resizing works properly if screen resolution is changed up and/or down while the example app is running. The example app is not DPI Aware, nor does it need to be.

Best regards, John

Attachments (1)
Comment
  1. Rajesh Kanna
  2. Thursday, 22 August 2024 05:37 AM UTC
Thank You John!, I shall apply the code of PFC resize and verify it. Again Thank you for your time and helping on this.
  1. Helpful
There are no comments made yet.
Rajesh Kanna Accepted Answer Pending Moderation
  1. Wednesday, 21 August 2024 16:24 PM UTC
  2. PowerBuilder
  3. # 2

Hi John,

I have uploaded an example application in zipped file. could you please find it and share your comments?

Thank you for time.

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 21 August 2024 14:25 PM UTC
  2. PowerBuilder
  3. # 3
My suggestion was and still is: Provide a small example application that uses the Window and DW resize service objects extracted from the PFC that you were originally using, that exhibits the problem behavior in order to properly troubleshoot the issue instead of making major changes in an attempt to find something that may work. My offer to help diagnose in my free/off time stands (for now), but if you don't wish to make use of the offer, just say so and I'll move on.
Comment
There are no comments made yet.
Rajesh Kanna Accepted Answer Pending Moderation
  1. Wednesday, 21 August 2024 12:59 PM UTC
  2. PowerBuilder
  3. # 4

Hi Team,

 

I added zipped file of sample application created in PB2022 R3 buid 3356.

 

I'm using user object 'eon_appeon_resize' to auto resize window & DW when change the scale value / resolution in display setting.

 

but UI screen doesn't resize properly. it provides empty space at right side of the screen

 

Kindly share your suggestion on this.

 

Thanks

Attachments (1)
Comment
  1. Rajesh Kanna
  2. Wednesday, 21 August 2024 14:16 PM UTC
Hi John,



I attached one Zip file which has sample application created with 'eon_appeon_resize'.

i request you to review the application and help me to find solution for the DW doesn't resize. Thanks
  1. Helpful
  1. Rajesh Kanna
  2. Wednesday, 21 August 2024 14:25 PM UTC
In eon_appeon_resize object, of_resize (aw_window,ai_newwidth, ai_newheight, ab_recursion)

i did code walkthrough and observed that DW is not loaded in aw_window.control[] array. But in sample application i'm able to view DW as one of the controls.
  1. Helpful
There are no comments made yet.
Rajesh Kanna Accepted Answer Pending Moderation
  1. Monday, 19 August 2024 14:32 PM UTC
  2. PowerBuilder
  3. # 5

Thank You John! for sharing the detail information about DPI Awareness application. I will go through link which you have shared.

To answer your questions:

Are DW contents resizing properly when DPI resolution is NOT changed?

Yes, DW contents are resizing properly when DPI resolution is NOT changed.

 

 

 

Comment
  1. John Fauss
  2. Tuesday, 20 August 2024 20:00 PM UTC
Yes, I believe that would allow a PB app to become DPI Aware, but only if it is called prior to the first HWND being used (i.e., before the first window is opened). However, if I'm understanding the Windows DPI documentation correctly, the PB app's window(s) would also need to respond to the WM_DPICHANGED (decimal 736) Windows message and resize themselves accordingly, which PB windows do not currently do.
  1. Helpful 1
  1. Roland Smith
  2. Tuesday, 20 August 2024 20:21 PM UTC
  1. Helpful
  1. Rajesh Kanna
  2. Wednesday, 21 August 2024 11:17 AM UTC
Hi John and Ronald,



Thank You! for sharing the detail. i will check and apply the changes. Thanks.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 19 August 2024 14:23 PM UTC
  2. PowerBuilder
  3. # 6

Hi, Rajesh -

Are window and DW contents currently resizing properly if the DPI resolution is not changed?

All PB apps are currently considered to be DPI Unaware, so Windows will appear to change the size of visual controls (windows, command buttons, etc.) in response to changes in DPI resolution, but this is not a resize operation... it is better thought of as a zoom in/out effect. When DPI resolution is queried by a DPI Unaware app, the Windows OS will always respond that resolution is 96 dots/inch (DPI), or 100%. This is explained here:

    https://learn.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows

Because a PB app is DPI Unaware, it does not receive any notification from Windows when DPI resolution is changed.

I know from your other, earlier post that you are using the Resize services (one for windows/controls and the other for DataWindow contents) that Kevin Ridley has kindly extracted from the PowerBuilder Foundation Class (PFC) framework. In the code you have posted, I can see where you are registering the various visual controls within a window with the window Resize service, but there is no use that I can see of the DataWindow resize service being used - and the contents of a DW will not resize without first enabling the separate and different DW resize service and registering the DWObjects within the DW.

I have used the PFC's window resize service extensively, and I've verified that it resizes windows and registered visual controls within a window correctly when DPI is changed - simply because there is no change in the DPI as far as the app is concerned since the app is DPI Unaware. I have never used the DW resize service in the PFC, so I have not tested it.

To summarize: DWObjects within a DW may not be resizing because the DW resize service may not have been enabled and configured. Are DW contents resizing properly when DPI resolution is NOT changed?

The PB Roadmap indicates that DPI Awareness for applications will be added in the next version.

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.