Parse basic attributes and advanced attributes of Button, and present it as described in XML file.
Function | Function description | Default value | Sample in XML |
---|---|---|---|
background | Set background color for button | OS | <Button background="240,0,0"/> |
foreground | Set foreground color for button | OS | <Button foreground="240,0,0"/> |
font | Set font for button | OS | <Button font = " Arial, 10, BOLD|ITALIC"/> |
bounds | Set margin bounds(X, Y, Width, Height) for button | OS | <Button bounds="15, 15, 466, 18"/> |
text | Set text for button, but you can’t set HTML special character directly(e.g. if you want to set ‘&’, you must set it to & ) | "" | <Button text="Test Button"/> |
enabled | If it is true, the button is enabled; If it is false, it is disabled. | TRUE | <Button enabled="TRUE"/> |
visible | If it is true, the button is visible; If it is false, it is invisible. | TRUE | <Button visible="TRUE"/> |
alignment | Set alignment mode, it has three values: LEFT, CENTER, and RIGHT. | LEFT | <Button alignment="CENTER"/> |
disableInError | If it's true, when an error occures, the button will be disabled; if it is false, with an error, the button is still enabled. | FALSE | <Button disableInError="TRUE"/> |
enableOKKey | If it is true, when the OKKey is pressed, this Button will response by executing its user defined actions. | FALSE | <Button enableOKKey="true"/> |
tabIndex | Define tab focus sequences. | INFINITE | <Button tabIndex="1"/> |
image | Set image file for button. Default path of the image file is located in root directory of the application, but you can set relative path in the attribute. When you set image and text for button together, alignment will be always for center(This is a limitation of the native widget on Windows®), and image is always located in the front of text. When image size is larger than label size, only part of image can be shown. | NULL | <Button image="imagename"/> |
helpID | helpId is defined in myHelpContexts.xml, you press shortcut key when the focus is on the button, it will pop up help message about the button | NULL | <Button helpId="buttonId"/> |