alias rescroll dialog -m rescroll rescroll
dialog rescroll {
title "Reversing Scroll Sample"
size -1 -1 100 50
option dbu
edit "", 100, 5 5 90 15
button "Start", 900, 24 25 25 15
button "Stop", 901, 51 25 25 15
button "", 999, 0 0 0 0, cancel
}
on *:dialog:rescroll:init:0:{
set %rescroll.text ....................This string of text.
set %rescroll.control left
set %rescroll.count 1
.timerrescroll.left 0 1 moveleft
}
on *:dialog:rescroll:sclick:900:{
if (%rescroll.count > 10) {
.timerrescroll.left 0 1 moveleft
}
if (%rescroll.count <= 9) {
.timerrescroll.right 0 1 moveright
}
}
on *:dialog:rescroll:sclick:901:{
.timerrescroll* off
}
on *:dialog:rescroll:sclick:999:{
.timerrescroll* off
unset %rescroll*
}
alias moveleft {
if (%rescroll.count > 39) {
.timerrescroll.left off
.timerrescroll.right 0 1 moveright
}
did -ra rescroll 100 $mid(%rescroll.text,%rescroll.count,40)
inc %rescroll.count
}
alias moveright {
if (%rescroll.count <= 1) {
.timerrescroll.right off
.timerrescroll.left 0 1 moveleft
}
did -ra rescroll 100 $mid(%rescroll.text,%rescroll.count,40)
dec %rescroll.count
}