Sun Microsystems Computer Accessories manual Obtain and Enter the Button Properties

Page 24

Bottom right coordinate - the bottom right coordinate of the screen area: (screen.x+screen.width, screen.y+screen.height).

Customization of the display area will be available in future versions of the Wireless Toolkit.

Obtain and Enter the Button Properties

1.By measuring the image file, obtain the button properties.

A button on the emulated device is defined in the main device property file by name and screen location in the following form:

button.<button_name> = x, y, width, height where the parameters are as follows:

button_name: One of the button names defined for the DefaultColorPhone: 0, 1, 2, 3, 4, 5, 6, 7, 8,9, POUND, ASTERISK, SEND, END, LEFT, RIGHT, UP, DOWN, SELECT, SOFT1, SOFT2 and POWER. For information about how to use additional button names, see “Device Buttons” on page 29.”

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.

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 2 on page 11.

10 Wireless Toolkit Basic Customization Guide • December 2003

Image 24
Contents Basic Customization Guide Please Contents Examining Device Property Files Default Emulator Device Property Files Vi Wireless Toolkit Basic Customization Guide December Figures Viii Wireless Toolkit Basic Customization Guide December Tables Wireless Toolkit Basic Customization Guide December Who Should Use This Book How This Book Is OrganizedUsing Operating System Commands Typographic Conventions Shell PromptsRelated Documentation Accessing Sun Documentation Online Sun Welcomes Your CommentsCustomizing the Wireless Toolkit How to Customize the Wireless ToolkitDevice Property Files and the Default Emulator Customization StepsCustomizing the Wireless Toolkit Wireless Toolkit Basic Customization Guide December Creating Device Property Files Make a Copy of an Existing Main Device Property FileObtain and Enter Image Files Obtain and Enter the Screen Properties Screen LocationTotal Screen Size Display AreaDisplay Area in Full Screen Mode Specifying Screen PropertiesObtain and Enter the Button Properties By measuring the image file, obtain the button propertiesHeight Width Obtain and Enter Soft Button Label Areas Soft button label display is defined by a line of the form Obtain and Enter Icon Properties Defining the Icon Location and StatesEnter the following measured values for the icons properties Enter Color Properties Run the Emulator for the New DeviceScreen Background RGB Color Examining Device Property Files Device Property Files Main Device Property File FontsFonts Used by the Midp APIs Default Font System FontsBitmap Fonts Ascii character Distance to character Font Underlining Device ImageImage without Buttons Pressed Image with Buttons PressedImage with Buttons Highlighted and Backlight On ScalingScreen Properties Screen Location Display Area in Full Screen Mode Total Screen SizeDisplay Area Screen Pixel Ratio Screen Background ColorScreen Border Color Touch ScreenScreen Buffering Device Buttons Keyboard HandlerDefining a Device Button Button.LEFT = 13, 197, 20 Assigning a PC Keyboard Key to a Button Assigning a Game Action to a Button Specifying the Characters Generated by a Button PressAssigning Abstract Commands to Buttons Abstract Command Types in Order of PrecedenceEmulating Abstract Command Button Assignments Precedence of Assigning Commands to a Button Secondary Button Assignments Abstract Command Menu Displayed Icons Defining the Icon Location and StatesSoft Button Label Display Soft Button Labels on the Emulated Device DisplayColor Sound AlertsDevice Software Capabilities Alert Type ValuesLocales Character EncodingsEnableAlphaChannel false Transparent ImagesWireless Toolkit Basic Customization Guide December Default Emulator Device Property Files Property FilesDefaultGrayPhone.properties Appendix a Default Emulator Device Property Files Wireless Toolkit Basic Customization Guide December Appendix a Default Emulator Device Property Files Wireless Toolkit Basic Customization Guide December # alert.alerttype.sound soundfile Wireless Toolkit Basic Customization Guide December Device Image Files Icon Image FilesIcon Image Files Support for ByteCode Obfuscators Adding a ByteCode ObfuscatorExample Appendix B Support for ByteCode Obfuscators Wireless Toolkit Basic Customization Guide December P E N D I X C Wireless Toolkit Basic Customization Guide December Index Keyboard.handler property Device property files, 1 WMA messages, customizing Wireless Toolkit Basic Customization Guide December