mIRC Homepage
Posted By: krunch scrolling dialog - 14/02/06 05:31 AM
using the edit box, is there a quick way of making text scroll back and forth automaticly?
Posted By: hixxy Re: scrolling dialog - 14/02/06 05:32 AM
You'll have to use a timer and 'hard spaces' ($chr(160) / $chr(255))
Posted By: krunch Re: scrolling dialog - 14/02/06 06:01 AM
i understand what you mean, but i can scroll it one way but not the other
Posted By: hixxy Re: scrolling dialog - 14/02/06 09:51 AM
You mean you want it to scroll to the left as well? If so you can use the same logic but use $mid(text,N) (so you effectively remove the first character each time the timer executes.)
Posted By: MikeChat Re: scrolling dialog - 14/02/06 06:35 PM
I dont know about a "quick way"
but you can try this
Code:
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
}
Posted By: krunch Re: scrolling dialog - 14/02/06 10:42 PM
cheers mate,
that code woks well
witch a little tweking for my script
© mIRC Discussion Forums