You can specify default parameters for actions in the declaration of the member function for the action, as follows:
Either of these enables a default value to be passed in an event-to-action connection, thus avoiding the need to supply a parameter value.
For example, suppose you want to connect the buttonClickEvent feature of a Remove push button to a removeSelected action that you created for an IListBox*-based part. Normally, you would also need to connect the selection attribute of the IListBox*-based part to the index attribute of the connection between buttonClickEvent and removeSelected. This connection would be required to get the index of the selected item in the list box.
However, in the .vbe file of the IListBox*-based part, you can specify the following default parameter value for the removeSelected action:
//VBAction: removeSelected, "removeSelected",, //VB: removeSelected(unsigned long index=selection())
This means that if no attribute of the IListBox*-based part is connected to the index attribute, the selection member function (the get member function of the selection attribute) is called by default to provide the index of the selected item.
You could do the same thing by creating a removeSelected action on the Action page of the Part Interface Editor for the IListBox*-based part. You would specify the default parameter in the declaration of the removeSelected member function in the Action member function field as follows:
virtual unsigned long removeSelected(unsigned long index=selection())
However, you must include this signature and the default parameters in the actual C++ code or you will receive an error.
Parameter
Connections
Supplying a Parameter Value
Using a Connection
Supplying a Parameter Value
Using a Constant
Making Connections in the
Composition Editor
