2
* This file is part of the dis-Emi-A HaXe Library. Copyright © edA-qa mort-ora-y
3
* For full copyright and license information please refer to doc/license.txt.
11
import flash.events.Event;
13
class ScrollbarTest extends ui.StageLayout
15
var vertScroll : Scrollbar;
16
var horzScroll : Scrollbar;
17
var scrollText : StaticText;
24
vertScroll = Scrollbar.vertical();
25
vertScroll.setRange( 0, 100, 10 );
26
vertScroll.addEventListener( UIEvent.USER_CHANGE,
27
function( evt : Event ) { me.scrollText.text += "\nVERT:" + me.vertScroll.at; } );
28
addChild( vertScroll );
30
horzScroll = Scrollbar.horizontal();
31
horzScroll.setRange( -50, 25, 5 );
32
horzScroll.addEventListener( UIEvent.USER_CHANGE,
33
function( evt : Event ) { me.scrollText.text += "\nHORZ:" + me.horzScroll.at; } );
34
addChild( horzScroll );
36
scrollText = StaticText.scrollText( "Scroll other bars to add text.", null, mathx.MatPoint.at( 30, 15 ) );
37
addChild( scrollText );
40
override function _resize( w : Float, h : Float )
42
vertScroll.move( w/10, h/10 );
43
vertScroll.resize( w/20, 8*h/10 );
45
horzScroll.move( 2*w/10, h/10 );
46
horzScroll.resize( 7*w/10, h/20 );
48
scrollText.move( w/3, h/3 );
49
scrollText.resize( 2*w/3, 2*h/3 );
52
public static function main()
54
ui.StageLayout.setup( ScrollbarTest );
b'\\ No newline at end of file'