ButtonStyle :

setTextNormal, setBgNormal, setBosNormal, setIosNormal, setBordersNormal, setImageNormal

 

setTextRoll, setBgRoll, setBosRoll, setIosRoll, setBordersRoll, setImageRoll

 

setTextDown, setBgDown, setBosDown, setIosDown, setBordersDown, setImageDown

 

setTextSelected, setBgSelected, setBosSelected, setIosSelected, setBordersSelected, setImageSelected

 

setTextRollSelected, setBgRollSelected, setBosRollSelected, setIosRollSelected, setBordersRollSelected, setImageRollSelected

 

setTextInactive, setBgInactive, setBosInactive, setIosInactive, setBordersInactive, setImageInactive

 

All those methods allow the control of the appearances of buttons (looks) in 6 states:

Normal:

When the Button is created.

Roll:

When the mouse is over the Button

Down:

When the left button of the mouse is pressed.

Selected:

When a Button is activated. After activation a Button remains selected until another Button of the same Bar is activated.

RollSelected:

When the mouse is over a selected Button

Inactive:

If the setInactive method of a Button is used with true as parameter. When a Button is reactivated (setInactive(false)) it comes back to its original status (Normal or Selected).

Each look is defined by 6 elements:

Text:

The color of the text.

Bg:

The background color of the Button.

Bos:

Bold characters

Ios:

Italic characters

Borders:

The existence and appearance of borders

Image

The image that will be shown depending on the event.

Warning: If there is an image defined for the 'Normal' state and an image defined for the 'Inactive' state the inactive image will not correctly be set with Netscape 4.

Demo

file: styleWindows.js, definition of buttonStyle
See the source code

Syntaxes

Button.setTextXXXXX (color)

Button.setBgXXXXX (flag)

Button.setBostXXXXX (flag)

Button.setIosXXXXX (flag)

Button.setBordersXXXXX (stringType)

Button.setImageXXXXX (filePath)

Parameters

color

setTextXXX methods.

Hexa RGB code or browser compatible code. Use null (default) or a empty string for transparent color

flag

setBg / Bos / IosXXX methods.

Boolean. If true the property corresponding to the method is applied and not if false

string

setBordersXXX methods.

String keyword, not case sensitive:

§         'Normal'. Use the color set with the setBordersColor method.

§         'ThreeD': Create a 3D effect for the borders. See setBordersLightThreeD and setBordersDarkThreeD to set the colors of 3D borders.

§         'ThreeDInv': Create a 'pushed button' effect.

filePath

See the filePath paragraph in Styles

 

Comment

The 5 first looks depends on action of the mouse. The last one depends on the use of a method. But they all work in the same way.

About Selected and RollSelected looks: Once a button has been activated, with a mouseover or a click depending on the setActivateOn method, the button is selected and remains selected until another button of the same bar is selected. If this selected state is not to be seen:

§         the Selected look is to be set as the same as the Normal look.

§         the RollSelected look is to be set as the same as the Roll look.

Caution: Borders must have a width (setBordersWidth method) and a color (setBordersColor method) in order to be visible.