1. Hua Yan
  2. PowerBuilder
  3. Monday, 13 April 2020 15:31 PM UTC

A manually added resize event with event id 'pgm_size' on a Custom Visual object behaviors differently on a window between Powerbuilder 12 and Appoen Powerbuilder 2019R2 beta:

In Powerbuilder 2019R2 Beta: This resize event is triggered even before constructor is executed while Powerbuilder 12 executes Constructor first and then trigger the resize event.

To solve the issuer when I migrated to the latest version I have to add an instant var to prevent the resize event gets triggered before Constructor.

Does anyone else have this issue or solve the issue? Thanks in advance.

Kevin Ridley Accepted Answer Pending Moderation
  1. Monday, 6 July 2020 12:36 PM UTC
  2. PowerBuilder
  3. # 1

FYI I'm planning a session for this year's Elevate 2020 on how to use the PFC resize service standalone without the full PFC where you can just register your userobject with the service.  The service will then manage resizing your object based on the window resizing.  I will be posting code to CodeXchange also.

 

Kevin

Comment
There are no comments made yet.
Peter Klopfer Accepted Answer Pending Moderation
  1. Monday, 6 July 2020 07:05 AM UTC
  2. PowerBuilder
  3. # 2

Hi Chris,

thank you for your valuable advice.

Just one question: If we ignore the pbm_size (resize) event, how could we handle situations when the user is resizing the window by dragging the border? How could we even notice?

Regards,

Peter

 

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 7 July 2020 14:00 PM UTC
Chris Pollach @Appeon

FWIW: You will notice on my STD Framework that all CVUO's have a ue_resize event. This event is cascaded through all descendants (that also includes tab pages). The first ue_resize is a posted event from the Window's resize. Frpm then on, the framework looks at the CVUO's "control" array of embedded UO's and then fires their ue_resize. In turn, that UO could then fire other embedded UO's ue_resize events, and so on, and son on. The end result being that every UO will receive a ue_resize event and can handle that activity in an encapsulated manner. Most importantly knowing that their parent object has already handled their resizing duties.
  1. Helpful
There are no comments made yet.
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Thursday, 23 April 2020 09:59 AM UTC
  2. PowerBuilder
  3. # 3

Hi Hua,

Good news that PowerBuilder 2019 R2 MR version (build 2328) has been officially released. The issue you reported has been fixed in this release. Please download and install it to verify the issue you reported and let us know if any problems.
You can get the installer from our Downloads portal at https://account.appeon.com/download/2019.

We welcome all feedback from you!

Regards,
Ken

Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Friday, 17 April 2020 03:14 AM UTC
  2. PowerBuilder
  3. # 4

This bug should be fixed in an MR that we will release next week.

Comment
  1. Miguel Leeuwe
  2. Friday, 17 April 2020 11:39 AM UTC
Will that include the other fix that was done in pbvm190.dll (don't remember what it was right now)?

  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 17 April 2020 11:41 AM UTC
Oh yes now I remember: that was to fix the application icon not showing on the taksbar

  1. Helpful
  1. Armeen Mazda @Appeon
  2. Friday, 17 April 2020 15:32 PM UTC
Yes, that will be fixed next week too!
  1. Helpful
There are no comments made yet.
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Thursday, 16 April 2020 08:52 AM UTC
  2. PowerBuilder
  3. # 5

Hi Hua,

 

Thanks very much for providing the test case.

We reproduced it on our end and will do further research to figure it out. We will keep you posted on the progress.

 

Regards,

Ken

 

Comment
There are no comments made yet.
Hua Yan Accepted Answer Pending Moderation
  1. Wednesday, 15 April 2020 16:36 PM UTC
  2. PowerBuilder
  3. # 6

Hi Ken

Yes, looks like it may related theme function.

My app is a MDI with a theme and there is a child window with a custom visual object. I manually added a resize event with event ID 'pbm_size' in this custom visual object. When I open the child window from the menu the resize event gets triggered before constructor. But if I rename the theme folder to something else to prevent loading the theme the app triggers the constructor event w/o resize event execution when I open the child window, which is what I expected.

Attached is mini-app in PB2019R2B to simulate the situation above.

The workaround is simple:

1. add an instant var in the custom visual object

2. mark the var in constructor event

3. in resize event check the var to see if the constructor is executed or not. If not do not continue.

Hope explanation above helps you to identify the issue.

 

Regard

Hua Yan

 

 

 

 

Attachments (1)
Comment
There are no comments made yet.
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 15 April 2020 04:08 AM UTC
  2. PowerBuilder
  3. # 7

Hi Hua,

Thanks for providing this issue and for finding out a workaround!

We’d like to further understand the issue you mentioned so that we could better improve the PB products. I tried but still am not able to reproduce this issue. Please try to do the following

  1. Is the Theme functionality enabled in your application? If yes, please disable the Theme and then try and see if the issue persists.
  2. Can you create a small reproducible case about this issue? If yes, please submit a bug at our support ticketing system (https://www.appeon.com/standardsupport/newbug) and also upload this small case when submitting it. Thanks in advance.

Regards,

Ken

Comment
There are no comments made yet.
Hua Yan Accepted Answer Pending Moderation
  1. Monday, 13 April 2020 19:01 PM UTC
  2. PowerBuilder
  3. # 8

Thank you Chris for your quick response.

It is a good design idea to prevent the misbehavior from version to version. I cannot do this right now to our system because of so big effort on this. But I have a workaround to handle this particular situation since I know what the issue is.

Thanks again.

Regards... Hua

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 13 April 2020 16:59 PM UTC
  2. PowerBuilder
  3. # 9

Hi Hua; 

   I've seen these type of issues throughout PB versions since the days of PowerSoft. Here is the proper way to fix this for now handle and the future. Remember that the resize event can be fired multiple times during the Open() processing and event firing order / timing can change between PB releases. Here is what I do since PB 3.0 ...

Do not use (map) the pbm_size event on any UO.

  • Do not rely on the Constructor to initialize.
  • Create a "Post Constructor" unmapped event on every object class. Perform 99% of all initization here.
  • Create a User Event on all custom user objects to handle resizing. Use this to also pass along resize chaining when user objects are nested inside other user objects. This allows for 100% encapsulation.
  • Do not rely on the Window class's open event to initialize. Instead, create a "Post Open" event and do 99% of your initialization on the UE.
  • Following the above architecture design since PB 3, I have never had migration behaviour issues even when migrating older code to today's PB2019R2.

Food for thought.

Regards... Chris

Comment
  1. Yiannis Papadomichelakis
  2. Tuesday, 14 April 2020 11:11 AM UTC
What sort of problems can occur using a pbm_size event? Never had any problems with that and we use it a lot.
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 16 April 2020 09:58 AM UTC
Personally I really liked the old days, when first the inner most object's constructors were executed before the Open event on a window... I know that ship sailed several times different places. With a "Create on demand" tabpage, the constructor event might also be triggered after other events on that tabpage.

It's nice as a workaround to use post constructor events and ue_init() and so on, but that makes it way harder to eliminate flickering from you window while controls are being loaded, especially since SetRedraw() doesn't seem to do much on userobjects / tabpages.
  1. Helpful
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.