AfterSizeEvent"
From Documentation
m (correct highlight (via JWB)) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
= AfterSizeEvent = | = AfterSizeEvent = | ||
− | * | + | *JavaDoc:<javadoc>org.zkoss.zk.ui.event.AfterSizeEvent</javadoc> |
− | + | ||
− | + | {{versionSince | 6.5.2}} | |
= Employment/Purpose = | = Employment/Purpose = | ||
Line 14: | Line 14: | ||
Resize the window component to show different sized images accordingly. | Resize the window component to show different sized images accordingly. | ||
<source lang="xml" highlight="3"> | <source lang="xml" highlight="3"> | ||
− | <window title="AfterSizeEvent" border="normal" width="250px" height="200px" maximizable="true" sizable="true"> | + | <window title="AfterSizeEvent" border="normal" width="250px" height="200px" |
− | + | maximizable="true" sizable="true"> | |
− | + | <attribute name="onAfterSize"><![CDATA[ | |
int width = event.getWidth(); | int width = event.getWidth(); | ||
− | if (width >= 600) | + | if (width >= 600){ |
− | + | Clients.log(">600"); | |
− | else if (width >= 400 && width < 600) | + | }else if (width >= 400 && width < 600){ |
− | + | Clients.log("400 ~ 600"); | |
− | else | + | }else{ |
− | + | Clients.log("<400"); | |
+ | } | ||
]]></attribute> | ]]></attribute> | ||
− | |||
</window> | </window> | ||
</source> | </source> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=Version History= | =Version History= |
Latest revision as of 01:46, 30 August 2022
AfterSizeEvent
- JavaDoc:AfterSizeEvent
Since 6.5.2
Employment/Purpose
Represents an event that resizes and provides the new size of a component.
Example
Resize the window component to show different sized images accordingly.
<window title="AfterSizeEvent" border="normal" width="250px" height="200px"
maximizable="true" sizable="true">
<attribute name="onAfterSize"><![CDATA[
int width = event.getWidth();
if (width >= 600){
Clients.log(">600");
}else if (width >= 400 && width < 600){
Clients.log("400 ~ 600");
}else{
Clients.log("<400");
}
]]></attribute>
</window>
Version History
Version | Date | Content |
---|---|---|
6.5.2 | March 2013 | Add onAfterSize event to get component size |