The Events Node
The Events node () is the top node under which you can add Event nodes to define events. In the Settings window for this node, you can add the following events.
Events
On Startup Events
From the On startup list, select a method that runs before the application window opens. It is therefore not possible to call a plot, for example, or other user-interface-related code (for such methods, you can use an On load event for forms). A possible use is to set up some special settings for the application (such as changing a settings for a form object). In such cases, the On startup event is faster than the On load event for a form object because it runs before the application window opens. You can add the following types of events by choosing from the Create Global Method menu () to the right of the On data change list:
Choose Create Global Method () to create a global method. Type the name of the global method in the Name field of the Create Global Method dialog that opens and then click OK. The global method is then added under Methods, and its Method Editor window opens.
Choose Create Local Method () to create a local method. Its Method Editor window opens.
Choose Create Command Sequence () to create a command sequence using the Create Command Sequence dialog that opens. There you can choose commands from the available Forms, GUI Commands, Methods, Form Methods, Libraries, and Model folders. To add a command, right-click the desired command node and choose the command to use (Run, for example). The command then appears in the list of commands below. You can edit that command sequence using the toolbar buttons for moving and deleting commands below the table. Click the Convert to Method button () and choose Convert to Method or Convert to Form Method to convert the command sequence to a method. Click the Go to Method button () below the table to select the method in the Application Builder tree and open the method in a Method Editor window. For commands that include arguments, click the Edit Argument button () to choose an argument in the Edit Argument dialog that opens.
There can only be one local method and one command sequence so if you add one or both of them, the menu will instead contain Remove Local Method () and Remove Command Sequence (), respectively. Click one of them to delete the local method or command sequence.
The selected method in the On data change list then changes to the created method or command sequence. To open the selected method or command sequence, click the Go to Source button (). The focus then moves to the method’s editor window or the Command Sequence dialog, respectively.
About to Shut Down Events
From the About to shut down list, select a method that runs before the application closes. You can use it to clear or remove some files or add a confirmation check, for example. The method you refer to can return a Boolean value. When it does, and the return value is false, the shutdown will be canceled. You can add the following types of events by choosing from the Create Global Method menu () to the right of the About to shut down list:
Choose Create Global Method () to create a global method. Type the name of the global method in the Name field of the Create Global Method dialog that opens and then click OK. The global method is then added under Methods, and its Method Editor window opens.
Choose Create Local Method () to create a local method. Its Method Editor window opens.
Choose Create Command Sequence () to create a command sequence using the Create Command Sequence dialog that opens. There you can choose commands from the available Forms, GUI Commands, Declarations, Form Declarations, Methods, Form Methods, Libraries, and Model folders. To add a command, right-click the desired command node and choose the command to use (Run, for example). The command then appears in the list of commands below. You can edit that command sequence using the toolbar buttons for moving and deleting commands below the table. Click the Convert to Method button () and choose Convert to Method or Convert to Form Method to convert the command sequence to a method. Click the Go to Method button () below the table to select the method in the Application Builder tree and open the method in a Method Editor window. For commands that include arguments, click the Edit Argument button () to choose an argument in the Edit Argument dialog that opens.
There can only be one local method and one command sequence so if you add one or both of them, the menu will instead contain Remove Local Method () and Remove Command Sequence (), respectively. Click one of them to delete the local method or command sequence.
The selected method in the About to shut down list then changes to the created method or command sequence. To open the selected method or command sequence, click the Go to Source button (). The focus then moves to the method’s editor window or the Command Sequence dialog, respectively.