x: The x-coordinate of the left edge of the button image, in pixels relative to the left edge of the device image

y: The y-coordinate of the top edge of the button image, in pixels relative to the top edge of the device image

width: The width of the button image, in pixels

height: The height of the button image, in pixels.

For example,

button.LEFT = 13, 197, 20, 20

For the second form (polygonal), the definitions for button_name, x, and y are the same as for the rectangular form. The polygonal form can consist of multiple points defined by x and y coordinates. A minimum of three sets of x and y coordinates are required to use this form.

For example, if the LEFT button were polygonal, it could have the following values:

button.LEFT = 166, 420, 143, 432, 143, 406

The button location and dimensions are used for two purposes:

To define the active region in which a mouse click is interpreted as a button press.

To define the region of the device image that is used to show graphic effects on device buttons.

The region for each button should be defined to be large enough to cover the button's area on all three device images. However, be careful not to allow the buttons' regions to overlap each other.

The button coordinates are shown in FIGURE 6.

30 Wireless Toolkit Basic Customization Guide • December 2003

Page 44
Image 44
Sun Microsystems Computer Accessories manual Button.LEFT = 13, 197, 20