|
|
|
|
|
- Overview
- Using a 5-state image for the cursor
- Advanced style settings
- Adding an image via gImage
Customizing the Switch controls
The Switch control is a 2-state Check Box control (on/off, true/false, yes/no). WINDEV, WEBDEV and WINDEV Mobile offer many customization options. Using a 5-state image for the cursor By default, the cursor is defined by a border ("Cursor border" in the "Style" tab of the control description). For each state (resting, hovering, etc.), this frame can be customized: background color, frame type and color, etc. It is also possible to use an image to define the cursor: - Open the Switch control description window.
- On the "Style" tab, select "Cursor border".
- In the "Use" area, select "5-state image". A window is displayed to select the desired image for the cursor border.
The image must be a 5-state image (or an image set) and not a "single" image.
Note: If you simply have an image "on its own", it can be automatically converted to 5-state mode using the image editor in WINDEV, WEBDEV and WINDEV Mobile. - Validate.
To obtain a very specific style, you can fine-tune the different options available in the "Style" tab of the Switch control description window. For each value (On/Off), for each state (normal, hover, ...) and for each element (slider frame, cursor frame, cursor label, ...), it is possible to modify the font, the colors, the images, etc... There are many combinations! For example, you can customize the cursor border by changing its roundness. If the roundness is half the dimensions of the cursor, the latter will be "round". For example, you can use the option "Caption of internal modes" to modify color of inactive captions (caption #B for the "OFF" value and caption #A for the "ON" value).
You can use emojis (specific Unicode characters) to obtain a "visual" switch and adapt its color. Please note: the visual displayed is system-dependent (the same character will not be displayed in exactly the same way on Windows, iOS or Android). Adding an image via gImage You can add an image to the caption with gImage to quickly customize the text of the options and keep the same cursor. With this method, however, you must select the color of the images carefully, taking into account the color of the cursor. To make images visible in all the states, simply swap the images through programming when the user clicks on the control ("Whenever modifying" event). For example:
IF MySelf THEN
MySelf[1].Caption = gImage(iMG_Name_Gray) + " Sort by name"
ELSE
MySelf[1].Caption = gImage(iMG_Name_White) + " Sort by name"
END
Note: all gXXX functions can be used in value labels ( gFontBold, gFontUnderlined, ...).
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|