AfterSizeEvent"
From Documentation
Line 15: | Line 15: | ||
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> |
Revision as of 01:45, 30 August 2022
AfterSizeEvent
- Demonstration: N/A
- Java API: AfterSizeEvent
- JavaScript API: N/A
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 |