Open form window

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 11 (Modified)


Open form window ({aTable; }formName{; type{; hPos{; vPos{; *}}}}) WinRef

ParameterTypeDescription
aTableTableTable of the form or Default table, if omitted
formNameStringName of the form
typeLongintWindow type
hPosLongintHorizontal position of the window
vPosLongintVertical position of the window
**Save current position and size of the window
Function resultWinRefWindow reference number

Description

The Open form window command opens a new window using the size and resizing properties of the form formName.

Note that formName is not displayed in the window. If you want to display the form, you have to call a command which loads a form (ADD RECORD for example).

By default (if the type parameter is not passed), a standard window with a close box is opened. Unlike the Open window command, no method is associated to the window's close box. Clicking on this close box cancels and closes the window, except if the On Close Box form event has been activated for the form. In this case, the code associated with the On Close Box event will be executed.

If formName is resizable, the window opened will contain a zoom box as well as a grow box.

Note: To know the main properties of a form, use the GET FORM PROPERTIES command.

The optional type parameter allows you to specify a type for the window. You must pass one of the following predefined constants (placed in the "Open form window" theme):

ConstantTypeValue
Standard form windowLongint8
Modal form dialog boxLongint1
Movable form dialog boxLongint5
Palette form windowLongint1984
Pop up form windowLongint32
Sheet form windowLongint33

Notes:

The attributes (grow box, close box...) of the window created depend on the interface specifications of the operating system for the chosen type. It is therefore possible to obtain different results depending on the platform used.

For more information about window types, refer to the Window types section. Note that only the types listed in the "Open form window" theme can be used with the Open form window command.

The optional parameter hPos allows you to define the horizontal position of the window. You can pass a defined position, expressed in points, to this parameter (refer to the Open window command) or one of the following predefined constants placed in the "Open form window" theme:

ConstantTypeValue
Horizontally CenteredLongint65536
On the LeftLongint131072
On the RightLongint196608

The optional parameter vPos allows you to define the vertical position of the window. You can pass a defined position, expressed in points, to this parameter (refer to the Open window command) or one of the following predefined constants placed in the "Open form window" theme:

ConstantTypeValue
Vertically CenteredLongint262144
At the TopLongint327680
At the BottomLongint393216

These parameters take into account the presence of the tool bar and menu bar as well as the current size of the application's window (on Windows).

If you pass the optional parameter *, the current position and size of the window are memorized when closed. When the window is reopened again, its previous position and size are respected. In this case, the vPos and hPos parameters are only used the first time the window is opened.

Examples

1. The following statement opens a standard window with a close box and automatically adjusts it to be the same size as the "Input" form. Since the form has been defined as resizable, the window also has a grow and a zoom box:

   $winRef := Open form window ([Table1];"Enter")

2. The following statement opens a floating palette in the upper left portion of the screen based on a project form named "Tools".. This palette uses the last position it was in when the user closed it each time it is reopened:

   $winRef := Open form window ("Tools"; Palette form window; On the Left; At the Top;*)

See Also

GET FORM PROPERTIES, Open window, Window Types.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next