UpDown controls

Use an UpDown control to show a pair of arrow buttons that the user can click to increment or decrement a number displayed in an associated Edit control. The number stays within the scroll range of the UpDown control.

UpDown controls are represented by Control objects in the ArcPad object model and by UPDOWN elements in ArcPad Extensible Markup Language (XML).

Attributes

UpDown control attributes are set at design time in ArcPad Studio on the Control Properties dialog box. They cannot be changed at run time (some attributes have corresponding properties that can be accessed and changed at run time). For more information, see Attributes vs. properties.

Attributes are written to the customization file (layer definition, applet, default configuration) in ArcPad XML format.

The following table shows the available UpDown control attributes and descriptions:

Attributes

Descriptions

name

The UpDown control name. Used to reference the UpDown control in scripts.

width

The control's width.

height

The control's height.

x

The x-coordinate for the upper left corner of the control.

y

The y-coordinate for the upper left corner of the control.

alignment

The control's alignment with respect to its buddy control.

orientation

The placement of the arrow buttons on the control (horizontal or vertical).

group

Specifies if the control starts a new group of controls.

border

Specifies if the control has a button.

lower

The minimum number in the scroll range of the control.

upper

The maximum number associated with the UpDown control.

buddy

The Edit control associated with the UpDown control.

Events

UpDown controls do not generate events.

Properties

UpDown control properties can be read and set at run time via scripts.

The following table shows the available UpDown control properties and descriptions:

Properties

Descriptions

Enabled

Returns or sets a value that determines if the control is enabled.

hWnd

Returns the control's window handle.

Index

Returns the control's index.

Name

Returns the control's name.

Parent

Returns a reference to the page that contains the control.

Type

Returns the control type (for example, UPDOWN for an UpDown control).

Visible

Returns or sets a value that determines if the control is visible.

Methods

UpDown controls do not support methods.

Referencing an UpDown control

You can only reference an UpDown control in a form that is currently displayed. Attempting to reference an UpDown control in a form that is not currently displayed results in a runtime error. The following discusses the approaches (Direct and Event) to referencing an UpDown control.

Direct reference

This involves referencing an UpDown control via its name, page's name, form's name, and form's parent object. For example, use the following code to reference an UpDown control with the name "updHeight" on a page with the name "pgPage3" in a form with the name "frmSettings" that is present in an applet with the name "Custom Settings":

VBScript

Dim objForm
Set objForm = Applet.Forms("frmSettings")
Dim objPage
Set objPage = objForm.Pages("pgPage3")
Dim objUpDown
Set objUpDown = objPage.Controls("updHeight")

JScript

var objForm = Applet.Forms("frmSettings");
var objPage = objForm.Pages("pgPage3");
var objUpDown = objPage.Controls("updHeight");

Python

objForm = Applet.Forms("frmSettings")
objPage = objForm.Pages("pgPage3")
objUpDown = objPage.Controls("updHeight")

The previous code assumes that it is present in the applet (that is, in the .apa file or its associated script file). If you need to reference the same UpDown control from a different applet or other customization file, explicitly reference the applet. See the following code:

VBScript

Dim objApplet
Set objApplet = Application.Applets("Custom Settings")
Dim objForm
Set objForm = objApplet.Forms("frmSettings")
Dim objPage
Set objPage = objForm.Pages("pgPage3")
Dim objUpDown
Set objUpDown = objPage.Controls("updHeight")

JScript

var objApplet = Application.Applets("Custom Settings");
var objForm = objApplet.Forms("frmSettings");
var objPage = objForm.Pages("pgPage3");
var objUpDown = objPage.Controls("updHeight");

Python

objApplet = Application.Applets("Custom Settings")
objForm = objApplet.Forms("frmSettings")
objPage = objForm.Pages("pgPage3")
objUpDown = objPage.Controls("updHeight")

Event reference

This involves referencing an UpDown control in an event handling script. For example, use the following code to reference an UpDown control with the name "updHeight" on a page with the name "pgPage3" in the OnLoad event handler of its form:

VBScript

Dim objPage
Set objPage = ThisEvent.Object.Pages("pgPage3")
Dim objUpDown
Set objUpDown = objPage.Controls("updHeight")

JScript

var objPage = ThisEvent.Object.Pages("pgPage3");
var objUpDown = objPage.Controls("updHeight");

Python

objPage = ThisEvent.Object.Pages("pgPage3")
objUpDown = objPage.Controls("updHeight")

2/7/2013