PFC Guide Titlebar
HomeFAQLinksPFCMAGExtensionsDownloadWhat's NewSearch

Resize Service FAQ


Table of Contents

  1. When the sheet is opened in Layered! arrange style the controls are resized incorrectly.
  2. When Resize Service is used with the Preference Service the controls are resized incorrectly.

What is the purpose of the Resize Service?

The PFC resize service provides functionality to automatically move and resize controls when the window or tab are resized. A minimum size can be specified, beyond which the control is no longer resized. Options provided to select how each individual control is resized are listed in a table below.

FixedToRight Control is moved keeping the original distance to the right edge.
FixedToBottom Control is moved keeping the original distance to the bottom edge.
FixedToRight&Bottom Control is moved keeping the original distance to the right and bottom edge.
Scale Control is resized proportionally to the window.
ScaleToRight Control is resized keeping the original distance to the right edge.
ScaleToBottom Control is resized keeping the original distance to the bottom edge.
ScaleToRight&Bottom Control is resized keeping the original distance to the right and bottom edge.
FixedToRight&ScaleToBottom Control is moved keeping the original distance to the right edge.
Control is resized keeping the original distance to the bottom edge.
FixedToBottom&ScaleToRight Control is moved keeping the original distance to the bottom edge.
Control is resized keeping the original distance to the right edge.
Back to Top

When the sheet is opened in Layered! arrange style the controls are resized incorrectly.

In order to properly resize controls the resize service needs to know:

The original window size is registered by placing a call to of_SetOrigSize() when the service is created. The original control size and position are registered when each control resize style is specified.

In some cases, such as when opened in Layered! mode, the window may be resized before the open event or even pfc_preopen event. In that case a call to inv_resize.of_SetOrigSize (this.WorkSpaceWidth(), this.WorkSpaceHeight()) will register the new and not the original window size. This will result in the wrong resize behavior, typically a large gap between the controls and the window edge. The problem is that there is no way to dynamically calculate the original window size once it is opened in Layered! mode.

When a window is opened in any style other than Original! prior to registering any controls you need to add a call to of_SetOrigSize() with the static original window values.

this.of_SetResize(true)
inv_resize.of_SetOrigSize (1493, 2497)

In most cases you can avoid hardcoding the window size by using the of_getminmaxpoints() function. The idea is to calculate the original window size by adding a constant gap value to the square area occupied by all the controls on the window. This method will work when the controls occupy most of the area of the window.

int	ix, iy, imaxx, imaxy

of_setResize(TRUE)
IF IsValid(inv_resize) THEN
	inv_resize.of_getminmaxpoints(control, ix, iy, imaxx, imaxy)
	inv_resize.of_setorigsize(imaxx + CON.II_RESIZE_GAP, &
	imaxy + CON.II_RESIZE_GAP)
END IF

 

Back to Top

When Resize Service is used with the Preference Service the controls are resized incorrectly.

When the preference service is enabled it will resize the window in the ancestor (pfc_w_master) open event. If the Resize Service is enabled after the window is resized it will loose the reference to the original window size.

The easiest way to fix the problem is to enable the resize service in the pfc_preopen event.

If the resize service has to be enabled after the window has already been resized, of_SetOrigSize() function should be used to specify the original window size.

Back to Top

Contributed by PFCGuide staff, except where noted otherwise.
PFCGuide is sponsored by Dynamic Technology Group
The information provided is for advice only and not to be considered a contract or a liability against Dynamic Technology Group.

Last revised: February 15, 2004 03:58 AM.