mIRC Homepage
Posted By: MTec89 marquee - 11/12/03 09:28 PM
how can i make a edit box a marquee?
Posted By: KingTomato Re: marquee - 11/12/03 10:18 PM
I have a snipplet on mirc.net if you search for it.

Mysterious Link
Posted By: MTec89 Re: marquee - 11/12/03 11:09 PM
its not working right, it is just flashing the text
i only left the code that could possibly be pertinent

Code:
dialog mp3 {
  title "M. P. 3."
  size -1 -1 64 363
  option dbu
  edit "X - X", 7, 0 38 63 20, autohs center
  edit "--:--", 8, 0 58 63 20, autohs center
  text "Prog", 9, 0 78 63 20, center
  text "%", 10, 22 99 17 8, center
}
alias play {
  if (!%mp3ddir) { set %mp3ddir $$sdir(C:\music,Pick MP3 DIR) }
  set %mp3.csong $$sfile($+(%mp3ddir,*.mp3),Pick Sound,Play)
  mp3.play
}
alias mp3.play {
  .splay $+(",%mp3.csong,")
  .mp3.update
  .set %mp3.splay 1
  .timerstyles -m 0 300 $scroll
}
on *:dialog:mp3:init:*: {
  dll $rbar Dock $dialog(mp3).hwnd > left
}
on *:dialog:mp3:close:*: { .splay -p stop | .timermp3 off }
alias mp3.update { .timermp3 -o 0 1 /mp3.update2 }
alias mp3.update2 {
  if ($dialog(mp3)) {
    if (!$sound(%mp3.csong).title) { did -ra mp3 7 Unknown }
    else { did -ra mp3 7 $sound(%mp3.csong).artist - $sound(%mp3.csong).title }
    did -ra mp3 9 $int($calc($calc($insong.pos / 1000) / $calc($insong.length / 1000) * 100)) 
    did -ra mp3 8 $gmt($calc($insong.pos / 1000),nn:ss)
    did -ra mp3 10 $int($calc($calc($insong.pos / 1000) / $calc($insong.length / 1000) * 100)) $+ %
    if ($insong.pos >= $insong.length) { .timermp3 off }
  }
  else { timermp3 off | splay -p stop }
}
alias scroll {
  if ($dialog(mp3)) {
    /did -ra mp3 7 %styleMsg
    /did -ra mp3 7 $right(%curVal, -1) $+ $left(%curVal, 1)
  }
  else { timerstyles off }
}
Posted By: KingTomato Re: marquee - 11/12/03 11:20 PM
1. You can't have it place the song title in your mp3.update2 every time the timer executes (in this case every second), or else its going to star scrolling, then reset itself

Song - Title.mp3
ong - Title.mp3 S
ng - Title.mp3 So
Song - Title.mp3
ong - Title.mp3 S
ng - Title.mp3 So

Going to keep doing that.

2. The /scroll you're using is missing the current value of the edit box (%curVal) Look in my example where I set it.
Posted By: MTec89 Re: marquee - 12/12/03 12:46 AM
how can i space artist from title? right now it will scroll like

tist - SongA

Code:
alias mp3.play {
  .splay $+(",%mp3.csong,")
  .mp3.update
  .set %mp3.splay 1
  mp3.at
}
alias mp3.update2 {
  if ($dialog(mp3)) {
    if (!$sound(%mp3.csong).title) {
      ; did -ra mp3 7 Unknown
    }
    else {
      ; mp3.at
    }
    did -ra mp3 9 $int($calc($calc($insong.pos / 1000) / $calc($insong.length / 1000) * 100)) 
    did -ra mp3 8 $gmt($calc($insong.pos / 1000),nn:ss)
    did -ra mp3 10 $int($calc($calc($insong.pos / 1000) / $calc($insong.length / 1000) * 100)) $+ %
    if ($insong.pos >= $insong.length) { .timermp3 off }
    scroll
  }
  else { timermp3 off | splay -p stop }
}
alias scroll {
  if ($dialog(mp3)) {
    var %curVal = $did(mp3, 7)
    did -ra mp3 7 %styleMsg
    did -ra mp3 7 $right(%curVal, -1) $+ $left(%curVal, 1)
  }
}
Posted By: KingTomato Re: marquee - 12/12/03 05:26 AM
add chr(160) to the end i think. Its a mirc flaw you have to workaround.
Posted By: MTec89 Re: marquee - 12/12/03 07:54 PM
didnt work;/ chr 32 didnt either
© mIRC Discussion Forums