Checkbox"
From Documentation
Charlesqiu (talk | contribs) |
Charlesqiu (talk | contribs) (→Mold) |
||
Line 33: | Line 33: | ||
= Mold = | = Mold = | ||
+ | [ZK EE] | ||
+ | [Since 8.6.0] | ||
+ | |||
+ | There are two additional molds for Checkbox: switch and toggle, you can customize the mold in css by overriding class. | ||
+ | <source language="xml"> | ||
+ | <checkbox mold="switch" /> | ||
+ | <checkbox mold="toggle" /> | ||
+ | </source> | ||
+ | |||
+ | == switch == | ||
+ | Default: | ||
+ | |||
+ | [[File:Switch-off.png]] [[File:Switch-on.png]] | ||
+ | |||
+ | Customized in CSS: | ||
+ | |||
+ | [[File:Switch-off-customized.png]] [[File:Switch-on-customized.png]] | ||
+ | <source language="css"> | ||
+ | .z-checkbox-switch-off { | ||
+ | background-color: red; | ||
+ | } | ||
+ | .z-checkbox-switch-on { | ||
+ | background-color: green; | ||
+ | } | ||
+ | .z-checkbox-switch-off:before { | ||
+ | background-color: black; | ||
+ | } | ||
+ | .z-checkbox-switch-on:before { | ||
+ | background-color: white; | ||
+ | } | ||
+ | </source> | ||
=Supported Events= | =Supported Events= |
Revision as of 07:16, 18 July 2018
Checkbox
Employment/Purpose
A checkbox.
Example
<window title="Checkbox demo" border="normal" width="350px">
<checkbox id="apple" label="Apple" onCheck="doChecked()" />
<checkbox id="orange" label="Orange" onCheck="doChecked()" />
<checkbox id="banana" label="Banana" onCheck="doChecked()" />
<hbox>
You have selected :
<label id="fruit2" />
</hbox>
<zscript> void doChecked() { fruit2.value = (apple.isChecked() ?
apple.label+' ' : "")
+ (orange.isChecked() ? orange.label+' ' : "")
+ (banana.isChecked() ? banana.label+' ' : "");
}
</zscript>
</window>
Mold
[ZK EE] [Since 8.6.0]
There are two additional molds for Checkbox: switch and toggle, you can customize the mold in css by overriding class.
<checkbox mold="switch" />
<checkbox mold="toggle" />
switch
Default:
Customized in CSS:
.z-checkbox-switch-off {
background-color: red;
}
.z-checkbox-switch-on {
background-color: green;
}
.z-checkbox-switch-off:before {
background-color: black;
}
.z-checkbox-switch-on:before {
background-color: white;
}
Supported Events
Event: Event
Denotes when a component gets the focus. | |
Event: Event
Denotes when a component loses the focus. | |
Event: CheckEvent
Denotes when a component is checked or unchecked. |
- Inherited Supported Events: LabelImageElement
Supported Children
*None
Use Cases
Version | Description | Example Location |
---|---|---|
Version History
Version | Date | Content |
---|---|---|