Adding event handling scripts
Event handling scripts are declared in ArcPad Extensible Markup Language (XML) files an attribute of an object that is capable of generating events. All event handler attributes use the naming convention of on[name] where [name] is the event type name. For example, the declaration for a form button control that handles an OnClick event would appear as follows:
<BUTTON name ="ok" onclick="Call OKClicked" .... />
The above button would call the subroutine OKClicked when it's clicked.
Although you can type a complete script in the Event Script text box for each event, it's often more efficient to type all the scripts needed for a customization file in a single VBScript source code file as subroutines and functions. You can then call the appropriate subroutine or function in the Event Script text box for each event.
Adding an event handling script to a form event
- Open an existing form in the Form Editor.
- Click the Form menu and click Form Properties.
The Form Properties dialog box appears.
- Click the Events tab.
- Click the event to which you want to associate a script.
- Type or paste the script into the Event Script box.
- Click OK.
Associating a script with a page event
- Open an existing form in the Form Editor.
- Click the tab of the page to which you want to associate the event.
- Click the Page menu and click Page Properties.
The Page Properties dialog box appears.
- Click the Events tab.
- Click the event to which you want to associate a script.
- Type or paste the script into the Event Script box.
- Click OK.
Associating a script with a control event
- Open an existing form in the Form Editor.
- Click the tab of the page containing the control to which you want to associate the event.
- Click the Control menu and click Control Properties.
The Control Properties dialog box appears.
- Click the Events tab.
- Click the event to which you want to associate a script.
- Type or paste the script into the Event Script box.
- Click OK.
Associating an event script with a custom tool event
- Create or open an applet or default configuration file containing at least one toolbar.
- Click the Toolbars button
on the toolbar.
The Toolbars dialog box appears.
- Click the toolbar containing the custom tool to which you want to associate an event script.
- Click the Edit button.
The Toolbar dialog box appears.
- Click the custom tool to which you want to associate an event script.
- Click the Edit button.
- On the Events page of the Tool Properties dialog box, click the event to which you want to associate a script.
- Type or paste the script into the Event Script box.
- Repeat steps 7 and 8 to add additional event scripts.
- Click OK.
- Click OKOK on the Toolbar dialog box.
- Click OK on the Toolbars dialog box.
Associating an event script with a system object event
- Create or open an applet, default configuration, or layer definition file.
- Click the System Objects button
on the toolbar.
The System Objects dialog box appears.
- Click the object to which you want to associate an event script.
- Click the event to which you want to associate an event script.
- Type or paste the script into the Event Script box.
- Repeat steps 3–5 to add additional event scripts for the system objects.
- Click OK.