AfterSizeEvent"
From Documentation
(5 intermediate revisions by 2 users 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 12: | Line 12: | ||
= Example = | = Example = | ||
− | Resize the window to show different | + | Resize the window component to show different sized images accordingly. |
− | <source lang="xml" | + | <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= | ||
− | {| | + | {| class='wikitable' | width="100%" |
! Version !! Date !! Content | ! Version !! Date !! Content | ||
|- | |- |
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 |