1. Troy Cowan
  2. PowerBuilder
  3. Friday, 20 January 2023 19:11 PM UTC

Hi 

I want to verify my understanding of the resizing behavior. I'm reverse engineering some code that is using the resize service.

 

I'm opening a window inside a MDI. the window has a number of controls, one if which is registered with scalebottom; the rest are registered with fixedbottom.

When I open the window and resize the app, the scalebottom control grows and shrinks correctly, and the rest move with the bottom correctly. The problem is, when I first open the window, the height of the scalebottom control is much shorter than I want it to be, and much shorter than it looks in the painter in PowerBuilder. 

After playing around, what I *think* is happening is that the resize service determines the delta Y between the bottom of the scalebottom control and the bottom of the window in the painter. Let's say that is 1000.

Then when the window is opened in the MDI, the resize code first attempts to keep the delta Y the same (1000); resizing the control as needed to make that happen. It just so happens that the height of the app (before I grow it) is shorter than the window in the painter. Therefore the scalebottom control has to shrink to keep the delta at 1000. 

Is this how it works?

I realize I may not have explained this well enough, so please ask me any questions you need.  

John Fauss Accepted Answer Pending Moderation
  1. Friday, 20 January 2023 23:06 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Troy -

Three things:

1. Pictures would help us (me, at least) better understand the problem. It's very difficult to discern details with large, expansive, monitor-wide pics, so trimmed pics that focus on the issue are the most helpful. Maybe one showing the window in the Window Painter that calls out the control in question, and another when the window is opened in the app that illustrates the problem?

2. Is the of_SetOrigSize method of the Resize Service object being used in this window? If not, have you tried using it? If used, it must be done prior to any of_Register calls.

3. Where does the following occur in the window's event scripts? of_SetResize(True), of_SetOrigSize(width, height), the various of_Register calls?

Best regards, John

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 20 January 2023 21:26 PM UTC
  2. PowerBuilder
  3. # 2

Hi,

Can you do the following in the Open() event of the window?

// Open event:

// try doing this AFTER or BEFORE your call to of_setResize(TRUE).
// (I'm not sure which will give the best result, so try both option).
this.Resize(this.width, this.height)

Not saying this is going to solve your problem, see if it makes a difference.

regards.

Comment
  1. Miguel Leeuwe
  2. Friday, 20 January 2023 21:35 PM UTC
You said "It just so happens that the height of the app (before I grow it) is shorter than the window in the painter.". What if you open the application Maximized! (Set your window inherited from w_frame to be opened maximized).
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 20 January 2023 19:49 PM UTC
  2. PowerBuilder
  3. # 3

Hi Troy;

Can you tell us ...

  1. PB version & build
  2. Have you updated the PFC =version to match the PB IDE's version?

Regards .. Chris

Comment
  1. Troy Cowan
  2. Friday, 20 January 2023 20:03 PM UTC
No, I haven't tried updating anything. Right now I just want to know what is happening, I'm not saying (yet) that there is anything wrong with anything that needs fixing.
  1. Helpful
There are no comments made yet.
Troy Cowan Accepted Answer Pending Moderation
  1. Friday, 20 January 2023 19:48 PM UTC
  2. PowerBuilder
  3. # 4

I'm using n_resize_service, which seems to have been developed by Sybase originally as part of the PowerBuilder Foundation Class Libraries. 

PowerBuilder version 2021 build 1509

Windows 10 Enterprise

 

 

Comment
  1. Chris Pollach @Appeon
  2. Friday, 20 January 2023 21:44 PM UTC
FWIW: Then this could be an old version of the PFC Resize Service. This code may not be 100% compatible with the newer PB 2021.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 20 January 2023 19:43 PM UTC
  2. PowerBuilder
  3. # 5

Hi,

Powerbuilder doesn't have any resize services of it's own, Are you using PFC classes or something else?

Which version of PB, which version of Windows?

Thanks

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.