Winform

In this section:

How to:

Reference:

The Winform command controls the forms that appear on the screen. Forms are used to edit and display data. They act as an application's user interface, whereas a procedure controls the application's logic and use of data.


Top of page

x
Syntax: How to Use the Winform Command

The Winform command performs three tasks:

The syntax of the Winform command for displaying and controlling forms is

Winform command formname [;]

where command is one of the following:

Show

Makes the specified form active: it displays the form and transfers control to it, enabling an application user to manipulate the controls (of the form), such as buttons and fields. In a Windows-deployed application, if other forms are currently displayed on the screen, the specified form is displayed on top.

Show_Active

Can be used for clarity. It is functionally identical to Show.

Show_Inactive

In Windows-deployed applications, this displays the specified form without making it active. Because the form is inactive, control passes to the following command, not to the form. You can use this to change the initial properties of a form, and of the form's controls, dynamically at run time before the form is displayed.

In Web-deployed applications, you can use this to change the initial properties of a form, and of the form's controls, dynamically at run time. SHOW_INACTIVE does not display the form.

In Web-deployed applications, this option does not apply.

Reset

Resets a form and its controls to their original properties. All selectable controls, such as list boxes, check boxes, and radio buttons, return to their default selections.

Refresh

Repopulates the form's data values as if control had returned to the form from an event handler, but without making the form active.

In Web-deployed applications, this option does not apply.

Close_All

Closes all forms. The form environment remains active.

Close

Closes the chain of forms from the currently active form back up to the specified form. If you do not specify a form, the command closes only the currently active form.

The close operation does the following:

  • Passes control directly to the beginning of the chain, to the point just following the Winform Show command that called the specified form.
  • Removes closed forms from the screen.
Show_And_Exit

Displays the specified form and then immediately terminates the application. This enables you to end an application while displaying a final form that remains on the screen. In an application deployed on the Web, this avoids returning the end user to the launch form. Any client-level logic (such as hypertext links, JavaScript and VBScript functions, and Java applets) will remain active, but all native Maintain logic such as event handlers will not respond because the application has terminated. SHOW_AND_EXIT is not applicable to Windows-deployed applications.

The syntax of the Winform command for changing a form control property is:

Winform Set formname[.controlname].property TO value [;]

The syntax of the Winform command for querying a form control property is

Winform Get formname[.controlname].property INTO variable [;]

where:

formname

Is the name of the form.

controlname

Is the name of the form control whose property you wish to set or get. Omit the control name if you are changing a property for an entire form, otherwise you must specify it.

property

Is any valid property.

value

Is a value that is valid for the specified property.

variable

Is any scalar variable (a user-defined field or a stack cell) to which you will assign the value of the specified property of the specified form or control.

;

Terminates the command. Although the semicolon is optional, including it to allow for flexible syntax and better processing is recommended. For more information about the semicolon, see Terminating a Command's Syntax.

For information about form and control properties, see Form and Control Properties Reference in the Developing WebFOCUS Maintain Applications manual. For information about using the WINFORM SET and GET commands, see Dynamically Changing Form Control Properties.


Top of page

x
Reference: Commands Related to Winform

Top of page

x
Displaying Default Values in a Form

If a form displays a variable that has not been assigned a value, the form will display the default value. A variable's default is determined by its data type and whether it was defined with the MISSING attribute:

Data Type

Default value without the MISSING attribute

Default value with the MISSING attribute

Character/Alphanumeric

space

null

Numeric

zero

null

Date and time

space

null

A null value is displayed as a period (.) by default; you can specify a different character using the SET NODATA command.



x
Dynamically Changing Form Control Properties

You can change many properties of forms and controls at run time using the Winform Set command, and can determine the current state of those properties using the Winform Get command. You can set other properties using functions.

If you want to change a form's properties at run time before the form is displayed, you can first issue the Winform Show_Inactive command, then issue commands to set form and control properties, and finally issue a Winform Show command. In Windows-deployed applications, Winform Show will make the form active; in Web-deployed applications, it will display the form. If you wish to change a form's properties in response to user activity in the form, you can trigger a function containing Winform Set commands and function calls from those user events. You cannot dynamically set a form's properties before it has been opened with either a Winform Show or Winform Show_Inactive.

For example, you could develop a data entry function that determines whether a user has entered data into a field; if the user has not, you could use the Winform Set command to change the field's color and give it focus, effectively drawing the user's attention to it and making it the target of any keyboard activity.

For information about form and control properties, see the Developing WebFOCUS Maintain Applications manual.


WebFOCUS