The CoolButton
is a button class created to provide a dynamic way to have a really good (cool) looking button. The look, graphical behaviour and shape is totally up to the developer that makes use of this class.
The CoolButton
makes use of a number of org.eclipse.swt.graphics.Image
classes to give it a custom appearance.
The CoolButton
can behave like a push button (using: SWT.PUSH
) or a toggle button (using: SWT.TOGGLE
). In the case of the toggle button its important to provide the set of images that will be needed for it to behave as such.
A hot region, an area on the CoolButton
image that represents the mouse active region of the button, can be specified by calling the setHotRegionMask(org.eclipse.swt.graphics.Image)
.
This image must be black and white, the black region represents the hot region and the white region represents the region that will not be considered during mouse events.
Note this image should preferably be the same size as the image used to create the CoolButton
.
Known limitations: The only known limitation of this implementation of the CoolButton
is the following: When the mouse is hovering over the button and the button has focus (i.e tab key pressed until the button has focus); pressing and releasing the space bar key (or any key that can select a button when it has focus) will cause the button to go in its pressed state and back to the normal state not the hover state that it was previously in. It will go back to the hover state once the mouse has been moved that will send a mouse hover event to the CoolButton
Sample on how to use the CoolButton
is provided in the samples package.
@author Code CrofterOn behalf Polymorph Systems
@since RCP Toolbox v0.1
|
|