1. Tracy Lamb
  2. PowerBuilder
  3. Monday, 4 December 2023 16:32 PM UTC

I think I isolated my previous question to an issue with PFC.  Was able to create a small project to demonstrate a little of what's going on... I suspect my previous issues are related.  I've attached a zip file with all of my project files.

Using PB2022 R2 and PFC2022.

To replicate:

1. Run the project.  The MDI frame opens in a maximized state.

2. Click the box next to X on the top, right side of the frame to put the frame in a normal state, not maximized.

3. Select File - Open.  A window with a datawindow will display. Horizontal and vertical scroll bars display.

4. Click the box next to X on the top, right side of the frame to put the frame back in a maximized state.

5. The datawindow does not resize. 

6. When I put the frame back into a normal state, then maximized state again, the datawindow does resize. 

~~~Tracy

 

 

 

 

Attachments (1)
Accepted Answer
Tracy Lamb Accepted Answer Pending Moderation
  1. Tuesday, 9 January 2024 17:57 PM UTC
  2. PowerBuilder
  3. # Permalink

PB2022 R3 GL came out yesterday.  This cleared up the problems I was having with the MDI tabbed-view style, PFC resize service, without having to update the PFC files.  Thank you Appeon!

~~~Tracy

Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 9 January 2024 18:28 PM UTC
Thanks for confirming R3 resolves the issue!
  1. Helpful
There are no comments made yet.
Tracy Lamb Accepted Answer Pending Moderation
  1. Monday, 8 January 2024 23:09 PM UTC
  2. PowerBuilder
  3. # 1

Bruce,

I see PB2022 R3 GL came out today... any idea how long it will take to update the PFC?  No rush, just wondering if it will be weeks or months?

~~~Tracy

 

Comment
There are no comments made yet.
Julie Jiang @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 6 December 2023 09:31 AM UTC
  2. PowerBuilder
  3. # 2

Hi all, 

Note that of the 4 issues summarized by Bruce:

Issue #1 and #2 are bugs. The engineer told me that they will be fixed in the R3 GA version.

Issue #3 and #4 are actually enhancement requests.  We now studying how to implement them.  

Best regards, Julie

Comment
  1. Tracy Lamb
  2. Wednesday, 6 December 2023 12:39 PM UTC
Thank you Julie!
  1. Helpful
There are no comments made yet.
Bruce Armstrong Accepted Answer Pending Moderation
  1. Tuesday, 5 December 2023 06:46 AM UTC
  2. PowerBuilder
  3. # 3

I responded to your post in the PFC Github project, but responding here as well for completeness.  What I responded to there, and also passed onto Appeon was the following:

  1. When tabbedview MDI is used and the tabs are maximized, when the frame size is changed the sheets do not resize (they do not receive a resize event). I believe given that they are maximized to fit the frame that they should be automatically resized when the frame is resized.
  2. When tabbedview MDI is used and the tabs are not maximized, a resize even is not sent to the window when a sheet is maximized. It is when it’s resized manually or minimized, but not when it’s maximized. I believe this is a bug.
  3. When tabbedview MDI is used and the tabs are maximized, the resize event and this.WorkSpaceHeight() both return a value that represents the entire MDI_1 client area. However, the tabbed view control (mditbb_1) is occupying part of that space. In order to determine what is the actual useful window area, the height of mdittb_1 has to be subtracted from the newsize/WorkSpaceHeight when the sheet is maximized.
  4. In order to try to adjust the resize behavior of PFC I need to be able to determine dynamically whether tabbedview MDI is in use and whether it has been configured to maximize the sheets. However:
    a. Not only are the TabbedView and MaximizeAllTabbedSheets not setable at runtime, they aren’t readable either. There are no properties reported on the window type to correspond to them.
    b. I could try to determine if TabbedView is in use by trying to determine if mditbb_1 is valid at runtime. However that doesn’t appear as a property I can access from outside of the frame (it’s not a property on the window class). Note that mdi_1 is a property of the window class, so that technique does work for mdi_1, but not for mditbb_1.
    c. What I’ve found does work is looping through the control array of the frame and looking to see if one of the objects has a classname of mditbb_1. However that only tells me that TabbedMDI is in use, there still doesn’t seem to be any way that I can determine whether or not MaximizeAllTabbesSheets is set.

 

Comment
  1. Tracy Lamb
  2. Tuesday, 5 December 2023 13:26 PM UTC
Thank you Bruce. In the pfcbugs example, I changed the mdi frame property windowstate to Normal! and left MaximizeAllTabbedSheets properties checked. I still have to manually resize the frame to get the dw to resize. With 3 windows open when the frame is in a normal size, I manually resize the fram, then maximize the frame. The only dw that resizes correctly is the currently selected one. The other 2 seems to resize partially? When I uncheck the MazimizeAllTabbedSheets, I can't get the 3rd tab (first one opened) to resize. Even if I put the mdi frame in a normal state, select the 3rd tab, manually resize, then maximize the frame. Very odd.



Before messing with the MDI frame properties, I changed the frame's pfc_open event as follows:

SetPointer( HourGlass! )

OpenSheet (lw_sheet,"w_sheet_masterlist", this, 0 , Layered!)



Hope this is helpful.

~~~Tracy
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 5 December 2023 15:45 PM UTC
Hi Tracy;

FWIW: I can also replicate this identical issue as well in my STD Framework Demo Apps!!!! :-(

Also, a related problem in opening a Tabbed Sheet in a maximized frame and then restoring the frame to normal does not resize the DC either.

This is a definitely Appeon PB issue!

Please open a Support Ticket for this problem and attach your PFC example to it as well.

Regards .. Chris
  1. Helpful 1
  1. Bruce Armstrong
  2. Tuesday, 5 December 2023 16:56 PM UTC


When I got your sample resize wasn't working for me at all. The one thing I changed and it started working correctly was to change:



of_SetResize(true)

inv_resize.of_Register(dw_1, "SCALERIGHT&BOTTOM")



to:



li_rc = this.of_SetResize(true)

li_rc = this.inv_resize.of_Register(dw_1, inv_resize.scalerightbottom)



Here's where I was at when I started to realize some of the issues were beyond something I could control. The extra 104 I'm substracting from the new window height is the size of the tabbed bar, but it's only needed when the window is maximized and there's an issue getting notification when that happens. If you used MaximizeAllTabbedSheets and took the control/min/max buttons off the sheet you would probably use this, as the user wouldn't be able to change the sheets out of the maximized state. Also you could add something to the frame to send a message to all the sheets to resize themselves. However, at this point I'm thinking I'll just wait to see what Appeon does.



integer li_rc, li_index, li_count

w_frame lw_frame

string ls_classname

integer li_tabheight = 0



// Resize objects...

lw_frame = gnv_app.of_getframe( )



li_count = UpperBound ( lw_frame.control )

FOR li_index = 1 TO li_count

ls_classname = ClassName ( lw_frame.control[li_index] )

IF ls_classname = 'mditbb_1' THEN

li_tabheight = 104

END IF

NEXT



dw_1.Width = this.WorkSpaceWidth() - 40

dw_1.Height = this.WorkspaceHeight() - ( 40 + li_tabheight )



// Window Resize Behavior

li_rc = this.of_SetResize(true)

li_rc = this.inv_resize.of_Register(dw_1, inv_resize.scalerightbottom)
  1. Helpful 2
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 5 December 2023 01:07 AM UTC
  2. PowerBuilder
  3. # 4

Hi, Tracy -

I believe the problem you are experiencing is due to (1) the way the PFC's window resize service is designed/coded and (2) the way you are using it.

If you examine the code in the resize service object (pfc_n_cst_resize), you'll see that there are two key instance variables:

long	il_parentprevwidth = -1
long	il_parentprevheight = -1

Their initial values of -1 indicate that no actual value has been set. Once the resize service is in active use (i.e., the window is being resized). these var's are updated every time the window's Resize event fires, which is quite frequently as the user drags a window's border. The new/current window width & height are compared against the previous Resize event's width & height to determine the amount of change (the delta's) in each.

Now, if you examine the code in the Resize event of the PFC's "master" ancestor window, pfc_w_master, you'll find the following code at the beginning:

// Notify the resize service that the window size has changed.
If IsValid (inv_resize) and This.windowstate <> minimized! Then
	inv_resize.Event pfc_Resize (sizetype, This.WorkSpaceWidth(), This.WorkSpaceHeight())
End If

Note that if the window is maximized, the resize service does not get notified of the change in the window's size. This is intentional. When you make the window open in a maximized state, the resize service never gets called. Once the window is restored to it's original/design size, then the resize service  can get involved, the instance var's get set, and the window resize service does its magic.

I suggest there are two ways to resolve your issue:

  1. Don't open the window in a maximized state (this is the "if it hurts when you do that, DON'T do that" solution). You can use a tip that Chris suggests; Open the window invisible/hidden, then in the pfc_PostOpen event, set the window state to Maximized! and immediately make it visible.
  2. Use the of_SetOrigSize(width, height) function of the resize service object as soon as you turn on the service, presumably in the window's pfc_PreOpen event. This function sets values for the two critical instance var's and changes their initial/default "no value has been set" values.

I admit that I have not tried either alternative, as I've never opened a PFC-based window in a maximized state... but I believe either of these alternatives should resolve the unusual behavior you are experiencing.

Best regards, John

Comment
  1. Tracy Lamb
  2. Tuesday, 5 December 2023 13:56 PM UTC
Thanks. That didn't solve the problem either. I set the frame to open in a normal state, no change. Then unchecked the MaximizeAllTabbedSheets, no change. Then used of_SetOrigSize to set the initial width, height to the WorkspaceWidth, WorkSpaceHeight in the sheet I was opening before registering the dw for the resize service, no change. One thing I found a little strange is that if I have 3 or 4 tabs open, all opened with the frame in a normal state, then manually resize the frame, all but the first tab opened resize - but not all resize the same. The first tab opened never resized,

Hopefully Bruce and Appeon will come up with an easy solution for PB2022 R3.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 5 December 2023 00:23 AM UTC
  2. PowerBuilder
  3. # 5
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.