User Tools

Site Tools


tplextensionwindowresize.htm
Navigation:  Templates > Guide to all Templates > Extension Templates >====== WindowResize extension template ====== Previous pageReturn to chapter overviewNext page

This Extension template lets the end user resize windows that have traditionally been fixed in size due to the controls they contain (List boxes, entry controls, buttons, etc.).

The template generates code to reposition the controls, resize the controls, or both, when the end user resizes the window.

TipBox.jpg

To allow window resizing you must set the WINDOW's frame type to Resizable and you must check the Immediate box to add the IMM attribute to the WINDOW.

Overriding Resize for a specific control

Resizer Configuration Options

Resize Strategy

Specifies the method for resizing and repositioning the controls to fit within the new window size.

Centered

With this strategy, each control will keep its size and the position will change to stay centered in the window.

Use Anchor:

This option by default works the same way as the Centered option, but also moves additional anchor strategies to each individual control's Action Tab. This resizing strategy works using “Anchors” to define how the control will behave on the resize with regard to its parent control.

Parent controls can be a TAB, OPTION, GROUP, or a WINDOW. For example, a RADIO control will anchor based on the OPTION resize direction.

NoteBox.jpg

As far as all resize strategies are concerned, a control's parent control is identified by its position on the window and not how it is defined structurally. For example, if a BUTTON is defined outside of a TAB control, but its default physical position is located within the TAB control, the TAB control is the actual parent control for that BUTTON.

Anchoring is based on what window edge is resized. For example, if a control is set to Anchor:Left, resizing the window's left edge will move the control proportionally to the left. If a control is set to Anchor:Right, resizing the window's right edge will move the control proportionally to the right.

The anchors define which edge of the parent control the target control will be bound to. Possible values for Anchor Strategy are Anchor:Right, Anchor:Left, Anchor:Top, and Anchor:Bottom

To make these options easy to use, setting this strategy enables the Set Resize Control's Anchors button located on each control's Actions tab.

This dialog allows you to specify which edge of the parent control that the target control will be bound (anchored) to.

resizeanchor.jpg

In addition to the anchor buttons shown above (T,B,L,R), there are additional grow buttons (^,V, <;, > ) that allow the control's target edge to resize proportionally in the active vertical or horizontal direction. For example, if a window is resized on top, what control edge will “grow” proportionally based on the amount of sizing?

To better illustrate the use of anchor and the grow buttons, click here for a detailed example.

blk2blue.jpg

Resize

The generated code scales all window coordinates by the same amount, thus preserving the relative sizes and positions of all controls. That is, all controls, including buttons and entry fields get taller and wider as the window gets taller and wider. Window fonts are unchanged.

Spread

The generated code applies the following strategies to the respective control types:

Button

Only the horizontal position (X coordinate) is scaled with the window; width, height, and vertical position are unchanged.

Radio Button

Horizontal and vertical position are scaled with the window, but width and height are unchanged.

Check Box

Horizontal and vertical position are scaled with the window, but width and height are unchanged.

Entry

Width, horizontal and vertical position are scaled with the window, but height is unchanged.

Combo Box

Width, horizontal and vertical position are scaled with the window, but height is unchanged.

Spin Box

Width, horizontal and vertical position are scaled with the window, but height is unchanged.

Drop Combo

Width, horizontal and vertical position are scaled with the window, but height is unchanged.

Other Controls

All coordinates are scaled with the window.

Surface

Makes the most of the available pixels by positioning other controls to maximize the size of LIST, SHEET, PANEL, and IMAGE controls. We recommend this strategy for Wizard generated windows.

TipBox.jpg

Even though list boxes may be resized, the column widths within the list box are not resized. However, the right-most column does expand or contract depending on the available space.

Don't Alter Controls

Controls are not resized when the window is resized.

TipBox.jpg

For this strategy, you may add the SCROLL attribute to each control plus the HVSCROLL attribute to the window to provide a 'moving window' over a larger page.

Restrict Minimum Window Size

Check this box to specify a minimum window height and width. This lets you enforce a minimum reasonable size of the window based on the size and number of controls on the window. In other words, you can keep your end user from shrinking the window so much that its controls become invisible or unrecognizable.

Minimum Width

Specify the minimum width of the window in dialog units. Dialog units are based on the window's font and are 1/4 of the average character width.

Zero sets the window minimum to the size at which the window opens (not necessarily the design time size). In other words, it takes into account any .INI setting plus any runtime Property syntax. Thus, we allow the developer to open the window, perform any dynamic control production (including resizing the window) before the minimum restriction takes effect.

Minimum Height

Specify the minimum height of the window in dialog units. Dialog units are based on the window's font and are 1/8 of the character height.

Zero sets the window minimum to the size at which the window opens (not necessarily the design time size). In other words, it takes into account any .INI setting plus any runtime Property syntax. Thus, we allow the developer to open the window, perform any dynamic control production (including resizing the window) before the minimum restriction takes effect.

Restrict Maximum Window Size

Check this box to specify a maximum window height and width. This lets you enforce a maximum reasonable size of the window.

Maximum Width

Specify the maximum width of the window in dialog units. Dialog units are based on the window's font and are 1/4 of the average character width.

Zero sets the window maximum to the size at which the window opens (not necessarily the design time size). In other words, it takes into account any .INI setting plus any runtime Property syntax. Thus, we allow the developer to open the window, perform any dynamic control production (including resizing the window) before the maximum restriction takes effect.

Maximum Height

Specify the maximum height of the window in dialog units. Dialog units are based on the window's font and are 1/8 of the character height.

Zero sets the window maximum to the size at which the window opens (not necessarily the design time size). In other words, it takes into account any .INI setting plus any runtime Property syntax. Thus, we allow the developer to open the window, perform any dynamic control production (including resizing the window) before the maximum restriction takes effect.

Overriding the Resize Strategy for a Specific Control

Window Control

Select a control from the drop-down list.

Disable Resizing for this Control?

Check this box to prevent resizing of the selected control when the user resizes the window. The control will retain its design-time dimensions.

Horizontal Resize Strategy

Specify how the control's width is determined when the end user resizes the window.

Choose from:

Lock Width The control's design time width does not change.
Constant Right Border Locks right edge, moves left.
Constant Right Center Border Similar to the Constant Right Border strategy, but splits the resizing proportion using the vertical center axis.Used for multiple controls populated on the same horizontal plane.

Vertical Resize Strategy

Specify how the control's height is determined when the end user resizes the window.

Choose from:

Lock Height The control's design time height does not change.
Constant Bottom Border Locks bottom edge, moves top.
Constant Bottom Center Border Similar to the Constant Bottom Border strategy, but splits the resizing proportion distance using the horizontal center axis.Used when you have multiple controls populated on the same vertical plane.

Horizontal Positional Strategy

Specify how the control's horizontal position is determined when the end user resizes the window.

Choose from:

Move The entire control moves in the direction of the parent's horizontal resizing.
Lock Position The control's left edge maintains a fixed distance (the design time distance) from parent's left edge.
Fix Right The control's right edge maintains a proportional distance from parent's right edge.
Fix Left The control's left edge maintains a proportional distance from parent's left edge.
Fix Center The control's center maintains a proportional distance from parent's center.
Fix Nearest Applies Fix Right or Fix Left, whichever is appropriate.
Fix To Center The control's center maintains a proportional distance from it's own center, not the parent's center.

Vertical Positional Strategy

Specify how the control's vertical position is determined when the end user resizes the window.

Choose from:

Move The entire control moves in the direction of the parent's vertical resizing
Lock Position The control's top edge maintains a fixed distance (the design time distance) from parent's top edge.
Fix Bottom The control's bottom edge maintains a proportional distance from parent's bottom edge.
Fix Top The control's top edge maintains a proportional distance from parent's top edge.
Fix Center The control's center maintains a proportional distance from parent's center.
Fix Nearest Applies Fix Top or Fix Bottom, whichever is appropriate.
Fix To Center The control's center maintains a proportional distance from it's own center, not the parent's center.

Resizer Configuration Options

The Classes tab, located on the WindowResize template dialog, contains standard Classes options, with the following exceptions:

Auto-Find Parent Controls

Controls whether the SetParentDefaults method will be called during the Resize Initialization. The Default value is “Yes”.

Optimize Moves

Sets the Resizer Class DeferMoves property. The default value is FALSE (No).

See the links to the appropriate methods above for more information.

tplextensionwindowresize.htm.txt · Last modified: 2021/04/15 15:57 (external edit)