Index...
Centrallix Documentation
|
widget/imagebutton
imagebutton :: A button widget which uses a set of images to control its appearance.
Metadata:
type: | widget/imagebutton |
visual: | yes |
container: | no |
form element: | no |
Overview:
The ImageButton widget provides a clickable button that is comprised of a set of two or three images.The first image is shown normally when the button is idle, the second when the button is pointed-to, and the third image is shown when the button is actually clicked. This provides a "tri-state" appearance much like that provided by buttons in modern user interfaces, although the button can be two-state, with just an "unclicked" and "clicked" version of the image.
The images are automatically swapped out when the appropriate mouse events occur on the button.
ImageButtons can also be disabled, and a "disabled" image is displayed at that time.
Unlike the textbutton, there is no 'tristate' property for an imagebutton; to make an imagebutton tri-state (different image when idle vs. when pointed to), use a 'pointimage', otherwise do not specify 'pointimage'.
Usage:
The ImageButton can be placed inside any visible container, but only nonvisual widgets can be placed within it.
Properties:
Property | Type | Description |
clickimage |
string |
The ObjectSystem pathname of the image to be shown when the user clicks the imagebutton. Defaults to 'image' if not specified. |
disabledimage |
string |
The ObjectSystem pathname of the image to be shown when the imagebutton is disabled. Defaults to 'image' if not specified. |
enabled |
yes/no or expr |
Whether or not the imagebutton should be enabled. Defaults to 'yes'. Can be an expression that if uses runclient() will cause the enabled status of the imagebutton to 'follow' the value of that expression while the application is running. |
image |
string |
The pathname of the image to be shown when the button is "idle". |
pointimage |
string |
The pathname of the image to be shown when the button is pointed-to. Defaults to the 'image' if not specified. |
repeat |
yes/no |
Whether to repeat the click event multiple times while the user holds down the button. |
height |
integer |
height, in pixels, of the image button. |
width |
integer |
width, in pixels, of the image button. |
x |
integer |
x-coordinate of the upper left corner of the button, relative to its container. |
y |
integer |
y-coordinate of the upper left corner of the button, relative to its container. |
Child Properties:
none currently available
Actions:
Action | Description |
Enable |
This action causes the image button to enter its 'enabled' state, possibly changing its appearance if a 'disabledimage' was explicitly specified. |
Disable |
This action causes the image button to enter its 'disabled' state, displaying the 'disabledimage' if specified. |
Events:
Event | Description |
Click |
This event occurs when the user clicks the button. No parameters are available from this event. |
Sample Code:
$Version=2$
MyButton "widget/imagebutton"
{
x = 10; y = 10;
width = 50;
height = 20;
// No pointimage for this one, thus not "tristate".
image = "/images/default.png"
clickimage = "/images/clicked.png"
}
Comments...
(none yet)
Add a Comment...
|