API version 1
- ‐
Scrolled¶
ウインドウがスクロールした場合に発生します。
ScrolledイベントのEventオブジェクトは以下の構造を持ちます。
型 |
名前 |
説明 |
---|---|---|
boolean |
horizontal |
横スクロールが発生した場合true、縦スクロール時はfalse |
使用例
CRSダウンロード
Form DisplayObj_eve {
x = 0;
y = 0;
width = 800;
height = 600;
/* Form1上で操作します */
Form Form1 {
x = 15;
y = 15;
width = 600;
height = 300;
function onMouseEnter(e) {
bgColor = "#CCFFCC" ;
}
function onMouseLeave(e) {
bgColor = "#ffffff" ;
}
}
EditBox chkScroll {
x = 15;
y = 390;
width = 192;
height = 82;
value = "スクロールバーの白部分をクリックして挙動を確認" ;
/* contextMenu = false ; */
Function OnScrolled( e ) {
//.MessageBox( "スクロール発生 " );
}
}
CheckBox chkGesture {
x = 15;
y = 325;
width = 192;
height = 62;
UseChange = true;
CheckItem item[2] {
height = 25;
Width = 170;
Function OnTouch( e ) {
try {
^.^.Form1.UseMouseMove = chkGesture.item[0].Selected ? DisplayObject.MOVE_ANYTIME : DisplayObject.MOVE_STD;
^.^.Form1.UseMouseWheel = chkGesture.item[1].Selected ? Form.WHEEL_ANYTIME : Form.WHEEL_STD;
} catch( e ) {
//.MessageBox( e.message );
}
}
}
item[0].Title = "UseMouseMove=ANYTIME";
item[1].Title = "UseMouseWheel=ANYTIME";
}
EditBox edEvent {
x = 210;
y = 325;
width = 405;
height = 196;
}
Button Button1 {
x = 119;
y = 491;
width = 88;
height = 32;
Title = "クリア";
Function OnTouch( e ) {
^.edEvent.Clear();
}
}
/*マウス関係のイベントが多く記述されています。必要なものを選んで確認ください */
Function OnDoubleClicked( e ) {
edEvent = String.format( "[%1] DoubleClicked xpos=%2 ypos=%3\r\n", e.from.name, e.xPos, e.yPos ) + edEvent;
}
Function OnRClicked( e ) {
edEvent = String.format( "[%1] RClicked xpos=%2 ypos=%3\r\n", e.from.name, e.xPos, e.yPos ) + edEvent;
}
Function OnMouseWheel( e ) {
edEvent = String.format( "[%1] MouseWheel xpos=%2 ypos=%3\r\n", e.from.name, e.xPos, e.yPos ) + edEvent;
}
Function OnClicked( e ) {
edEvent = String.format( "[%1] Clicked xpos=%2 ypos=%3\n", e.from.name, e.xPos, e.yPos ) + edEvent;
}
Function OnMouseMove( e ) {
edEvent = String.format( "[%1] MouseMove xpos=%2 ypos=%3\n", e.from.name, e.xPos, e.yPos ) + edEvent;
}
Function OnContextMenu( e ) {
edEvent = String.format( "[%1] ContextMenu xpos=%2 ypos=%3\r\n", e.from.name, e.xPos, e.yPos ) + edEvent;
}
Function OnLButtonUp( e ) {
edEvent = String.format( "[%1] LButtonUp xpos=%2 ypos=%3\r\n", e.from.name, e.xPos, e.yPos ) + edEvent;
}
Function OnRButtonUp( e ) {
edEvent = String.format( "[%1] RButtonUp xpos=%2 ypos=%3\r\n", e.from.name, e.xPos, e.yPos ) + edEvent;
}
Function OnKeyDown( e ) {
edEvent = String.format( "[%1] KeyDown \r\n", e.key ) + edEvent;
}
Function OnKeyUp( e ) {
edEvent = String.format( "[%1] KeyUp \r\n", e.key ) + edEvent;
}
}