JadeMask Class

The JadeMask control is a combination picture, button, and label. This control enables you to define images that are automatically presented when the mouse moves over the control and when the button is down or disabled.

The JadeMask control supports user-specified Web events (that is, you can write a function and use the Window class addWebEventMapping method to invoke it when a specified event occurs).

In addition, this control provides:

As the JadeMask class is a subclass of the Picture class, it inherits all of the properties and methods of the Picture, Control, and Window classes.

You can define the control as a single button, a two-state button, or an automatic two-state button based on the style property. You can also define the control as the Cancel button or the default button.

The canHaveFocus property determines whether the control can have focus. When the control has focus, it can be clicked with the mouse, the accelerator defined on the caption can be used, or the space key or return key pressed. If the control is also the Cancel button, pressing the Esc key also fires the click event.

The following examples show the bitmaps that can be provided.

These images represent the following states, respectively.

These images are placed on a background picture so that the button gives the impression that it consists of the swirl shown by the mask in the above examples. The control responds only when the mouse is over that logical area.

A skinned button does not display the focus rectangle if the focus picture is included in the skin. If these pictures are not defined, the pictureRollOver state is displayed when the control has focus or the normal control picture property state if that pictureRollOver is not provided.

When an image containing transparency is displayed in a browser as part of a Web-enabled application, the following conditions must be true for the transparency to be displayed:

When a JadeMask control is skinned and at least one of the skin images is 32‑bit (which supports transparency), the control is treated as though it is transparent; that is, the control is painted on its parent without the area being erased with the effective value of the backColor property. Instead, the parent shows through any transparent areas of the images (for rounded corners, for example). In addition, any semi‑transparent parts of the images are anti‑aliased with the parent image so that they are displayed with smooth corners over any background color.

For a summary of the constants, properties, method, and events defined in the JadeMask class, see "JadeMask Constants", "JadeMask Properties", "JadeMask Method", and "JadeMask Events", in the following subsections.