DVL Software Limited
[ About | Services | Products | Search | Feedback | Support ]

PowerBuilder Tips

Using the Resize and Preference service together

Back to the Tips

The resize service (n_cst_resize) is useful for windows which contain controls which can be resized.  The preference service (n_cst_preferences) is great for users.   It allows windows to remember their last position and size.  However, unless you use these services in the correct order, you can get into strife.  For example, if you don't set the resize service and register your controls before the ancestor's open script completes, you may have wind up with controls that have not been resized properly.

Below are two screens.  The first has not resized correctly but the second one has correctly resized.  The difference between the two windows is the following script in the pfc_preopen event.  This script will be executed before the open event of pfc_w_master which is where the preferences are reset.  You'll note that of_SetOrigSize() is commented out.  I've never actually found a situation where this is needed or useful.  But that doesn't mean it isn't useful.  Somewhere...out there.

//this.inv_Resize.of_SetOrigSize(this.width, this.height)
this.inv_Resize.of_Register(dw_1, "ScaleToRight&Bottom")

resize1.gif (49186 bytes)
Incorrect resizing

resize2.gif (36495 bytes)
Correct resizing

Back to the Tips

[ About | Services | Products | Search | Feedback | Support ]

This page last updated: Wednesday, 23 February 2000
Copyright 1997, 1998, 1999, 2000 DVL Software Limited.  All rights reserved.