Page History
&<img src="../resources/images/opentocr.png" title="Open Contents list" border="0"&>
You are here:
...
A user-defined control is a special kind of reusable part for displaying list-type information. It offers more flexibility to the designer than predefined controls such as the tree view or list view controls.
User-designed controls can only be used with applications which are run in DirectX mode.
The Visual LANSA user-designed controls are:
...
- Fields received as on Add_entry
Group_By Name(#ListFields) Fields(#Empno #Surname #Givename #Deptment #Section #Deptdesc #Secdesc)
The *ListFields parameter, which can also be added to the Begin_Com, defines the fields that will act as the underlying data for the list. The control passes the specified fields into the design instance at the moment an Add_Entry command is executed.
For each of the events that can happen to a design, there is an equivalent OnXxxxx method on the interface that can be redefined within the design. This allows control to be passed to the design instance by the parent control. In this way, when the design is created by the use of Add_Entry, the OnAdd method is executed:
Mthroutine Name(OnAdd) Options(*Redefine)
#lEmployee := ("&1 &2 (&3)").Substitute( #GiveName #Surname #Empno )
#lDepartment := ("&1 (&2)").Substitute( #Deptdesc #Deptment )
#lSection := ("&1 (&2)").Substitute( #Secdesc #Section )
Endroutine
Similarly, to manage focus being set, it is necessary to add a style to show focus, and when the item is no longer focus, the style needs to be removed:
Mthroutine Name(OnItemGotFocus) Options(*Redefine)
#Com_self.Styles.Add( #XDXStyles<Focus> )
Endroutine
Mthroutine Name(OnItemLostFocus) Options(*Redefine)
#Com_self.Styles.Remove( #XDXStyles<Focus> )
Endroutine
Each individual user-designed control has its own interface. Most have similar methods for add, delete, focus and selection. Only tree is different because it also provides methods for expanding and collapsing items.
Refer to the F2 Component Help for information about user-designed control properties, methods and events.
&<img src="../resources/images/opentoc-dark.png" title="Open Contents List" border="0"&>