Designer: Many aspects of the form window can be modified in the Designer. See the Designer User's Guide for more information. You can also call the window functions from your code at any point after reading the form from the Designer library.
Code: To modify the window that displays a data form, you use the many window functions available. Window functions take a window pointer as an argument. The pointer to the form window is contained in the form structure in member wnp. To access this window, use:
|
For example, the following code defines a form and adds the text "Canyon Corp. Order Form," centered in the top of the border of the form window and displayed with the LHIGHLITE logical attribute:
|
The next time the form is displayed, this title will appear in the border of the form window.
You may also want to change the logical attribute array used by the form. The window structure has as one of its members a pointer to a logical attribute array. If this member is specified, the window uses the definitions in this logical attribute array. Otherwise, either the system logical attribute array or the Designer library logical attribute array is used, depending on whether the form was created in code or in the Designer.
To specify the logical attribute array to be used for a form, simply change the attribute array associated with the form window using the set window logical attribute array function, sw_latt():
|
For example:
|
The system logical attribute array is #defined as LATT_SYS. If you want to reinstall the system logical attribute array for a form, specify LATT_SYS for the attribute array.
For complete information about these and other functions that control the appearance of windows, see Chapter 25, "Changing the Appearance of Windows."
Warning: Do not change the size or location of a form window when the form is on the screen. Also, if you are changing the size of a form window after the fields have already been defined for the form, make sure the new form window is large enough to hold the defined fields.
Note: It is generally not a good idea to access structure members directly, since structure member names may change in future releases. However, there are a few names which we are not likely to change. One of these is dfmp->wnp.