WorkScreen
= _NEWIMAGE(3600, 2400, 32) ' a nice large screen so we can scroll like crazyDisplayScreen
= _NEWIMAGE(640, 480, 32) 'a nice small display screen
PRINT "Let's print all sorts of stuff on our workscreen, and make certain that it's more than long enough so that it'll scroll quite a ways across from the normal screen." LINE (400, 400)-(3000, 1200), &HFFFFFF00, BF
PRINT "LINE #"; i;
". This is just a bunch of junk for testing purposes only. As you can see, if you want to read all the text from this line, you're going to have to scroll to see it all."
StartX
= 0: StartY
= 0: W
= _WIDTH(DisplayScreen
): H
= _HEIGHT(DisplayScreen
) DisplayScreen = temp
junk
= _RESIZE 'clear the resize flag after manually setting the screen to the size we specified. ScrollBar StartX, 2
ScrollBar StartY, 1
_PUTIMAGE (0, 0)-(W
- 20, H
- 20), WorkScreen
, DisplayScreen
, (StartX
, StartY
)-STEP(W
, H
)
SUB ScrollBar
(Start
, Direction
) D
= _DEST:
_DEST DisplayScreen
'our scrollbars show on the display Min = 0
IF Direction
= 1 THEN 'up/down bar Box MaxW - 20, 0, 20, MaxH - 20, &HFF777777, &HFFFFFFFF
Box MaxW - 19, Start / H * MaxH, 18, MaxH / H * MaxH - 20, &HFFFF0000, 0 'Red with transparent
Box Min, MaxH - 20, MaxW - 20, 20, &HFF777777, &HFFFFFFFF 'Gray with white border
Box Start / W * MaxW, MaxH - 19, MaxW / W * MaxW - 20, 18, &HFFFF0000, 0 'Red with transparent