1. Tracy Lamb
  2. PowerBuilder
  3. Friday, 6 May 2022 13:04 PM UTC

Hi all,

I'm testing out pfc tab objects, and I have a question about the resize service.  In the constructor event of the tab object, I enable the resize service and register all of the resizable objects:

integer li_rc
itab_This = this

of_setresize(TRUE)

inv_resize.of_Register(tabpage_1, "ScaleToRight&Bottom")
inv_resize.of_Register(tabpage_2, "ScaleToRight&Bottom")
inv_resize.of_Register(tabpage_3, "ScaleToRight&Bottom")
inv_resize.of_Register(tabpage_print, "ScaleToRight&Bottom")

inv_resize.of_Register(tabpage_1.dw_1, "ScaleToRight&Bottom")
inv_resize.of_Register(tabpage_2.dw_2, "ScaleToRight&Bottom")
inv_resize.of_Register(tabpage_3.dw_3, "ScaleToRight&Bottom")
inv_resize.of_Register(tabpage_print.dw_print, "ScaleToRight&Bottom")

 

I also enable the resize service in the constructor event of each datawindow:

this.of_setResize(TRUE)

When I put this object into a window, I resize the tab object and register it in the window's open event:

// Resize objects...
tab_1.Width = this.WorkspaceWidth()
tab_1.Height = this.WorkspaceHeight() - 10

// Window Resize Behavior
of_SetResize(true)
inv_resize.of_Register(tab_1, "ScaleToRight&Bottom")

 

A couple of questions... do I need to register the tabpages ?

Also, I'm getting a null object reference when I run the code.  From running the debugger, the error seems to be coming from the dw_1 constructor.

Any ideas, suggestions are appreciated.

~~~Tracy

 

 

Accepted Answer
Tracy Lamb Accepted Answer Pending Moderation
  1. Friday, 6 May 2022 15:59 PM UTC
  2. PowerBuilder
  3. # Permalink

Thank you all for your feedback! So here's what I did that seems to work...

On the ancestor tab object, removed the resize service on the datawindows then left the dataobject on the datawindows blank.
Removed the lines that register the tab pages for resize.
On the descendent, I added the dataobjects, but still left the resize service off of the datawindows.

If I need the datawindow resize service in any of the descendents, I can add it there.  To be honest, I'm not sure what the datawindow resize service does. I've just always put it in my code.

Many Thanks,

~~~Tracy

 

 

 

Comment
  1. Benjamin Gaesslein
  2. Monday, 9 May 2022 07:21 AM UTC
The DW resize service can resize controls within a DW based on the size of the DW control. Unless you register controls within the DW with it, you don't need to activate it.
  1. Helpful
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Friday, 6 May 2022 15:04 PM UTC
  2. PowerBuilder
  3. # 1

I'm guessing that your app is fully PFC, but if you ever want to try using the pfc resize service without the pfc, I did a presentation on this at Elevate 2021.  I also agree that you shouldn't be using the dwresize service if you are not planning to resize the actual columns inside the dw.  Here's a link to my presentation.

 

https://www.youtube.com/watch?v=zPAnRMC-12c

 

Comment
There are no comments made yet.
Arnd Schmidt Accepted Answer Pending Moderation
  1. Friday, 6 May 2022 13:46 PM UTC
  2. PowerBuilder
  3. # 2

Hi Tracy,

that looks like an issue in the PFC's

pfc_n_cst_dwsrv_resize.of_setrequestor() Method:

ls_describeret = adw_Requestor.Object.DataWindow.Processing

So if no datawindow is assigned to your dw_1.dataobject  ... Booooom.

hth

Arnd

Comment
  1. Andreas Mykonios
  2. Friday, 6 May 2022 13:50 PM UTC
And you are right.. Maybe they use the n_cst_dwsrv_resize. But in code parts provided only the n_cst_resize is referenced.
  1. Helpful
  1. Andreas Mykonios
  2. Friday, 6 May 2022 13:52 PM UTC
Also enabling n_cst_dwsrv_resize has no sense without a dataobject, as it is used to set resize setting for controls in a dataobject...
  1. Helpful 1
  1. Arnd Schmidt
  2. Friday, 6 May 2022 14:33 PM UTC
@Tracy: Do yo really want to enable(use) the additional resize service inside the datawindows for columns etc.?

If not, then there is no need for a "this.of_setResize(TRUE)" in the constructor events of the datawindows.
  1. Helpful 1
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Friday, 6 May 2022 13:24 PM UTC
  2. PowerBuilder
  3. # 3

You don't need to register tabpages. Only tab control. Tabpages follows in size always the control. This is the case in any tab control (not only the pfc one).

Now if you want to resize objects inside a tabpage then you have to enable the service in that tabpage and register the controls.

Andreas.

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 6 May 2022 13:13 PM UTC
  2. PowerBuilder
  3. # 4

Hi Tracy,

I remember you asking why to use certain pfc objects: https://community.appeon.com/index.php/qna/q-a/why-use-the-pfc-tab-object 

What's happening to you now might be the answer to that question.

regards,

MiguelL

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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.