At runtime, you can modify the appearance and behavior of a DataWindow object by doing one of the following:
Changing the values of its properties
Adding or deleting controls from the DataWindow object
You can use the Modify method or a property expression to set property values. This lets you change settings that you ordinarily specify during development in the DataWindow painter.
Before changing a property, you might want to get the current value and save it in a variable, so you can restore the original value later. To obtain information about the current properties of a DataWindow object or a control in a DataWindow object, use the Describe method or a property expression.
With some DataWindow properties, you can assign a value through an expression that the DataWindow evaluates at runtime, instead of having to assign a value directly. For example, the following statement displays a salary in red if it is less than $12,000, and in black otherwise:
dw_1.Modify("salary.Color &
= '0 ~t if(salary <12000,255,0)' ")
The syntax is different for expressions in code versus expressions specified in the DataWindow painter. For the correct syntax and information about which properties can be assigned expressions, see the DataWindow Reference in the online Help.
You can also use the Modify method to:
Create new objects in a DataWindow object
This lets you add DataWindow controls (such as text, bitmaps, and graphic controls) dynamically to the DataWindow object.
For how to get a good idea of the correct Create syntax, see “Specifying the DataWindow object syntax”.
Destroy controls in a DataWindow object
This lets you dynamically remove controls you no longer need.
Included with PocketBuilder is DW Syntax, a tool that makes it easy to build the correct syntax for property expressions, Describe, Modify, and SyntaxFromSQL statements. You click buttons to specify which properties of a DataWindow you want to use, and DW Syntax automatically builds the appropriate syntax, which you can copy and paste into your application code.
To access DW Syntax, select File>New and select the Tool tab.
You can use the Browser to get a list of DataWindow properties: on the DataWindow page, select a DataWindow object in the left pane and Properties in the right pane. To see the properties for a control in a DataWindow object, double-click the DataWindow object name, then select the control.