As of 4D v18, a new set of 4D View Pro form events are available. They return special information that can be accessed with the new FORM Event command, introduced in this blog post. Say hello to: “On Column Resize”, “On Row Resize”, “On Clicked”, “On Double Clicked”, “On Header Click”, “On Selection Change”, and “On After Edit”.
These new events are listed in the property list:
When the event occurs, you can retrieve all of the associated information from the object returned by the FORM Event command. For example, if you’ve selected the “On Column Resize” event, the command will return an object with information like this when a column is resized:
You can use this object to trigger an action, such as setting the background color of the resized column to red:
If (FORM Event.code=On Column Resize)
VP SET CELL STYLE (FORM Event.range;New object("backColor";"red"))
Take a look at the HDI to see these new events in action, and check out the doc center for more technical details.
Note: As explained in this blog post, the returned attributes depend on the context and they can be different according to the element used. The example above is for a 4D View Pro object during an “On Column Resize” event. For other objects or other events, different attributes are returned.