mIRC Home    About    Download    Register    News    Help

Print Thread
#63724 11/12/03 09:28 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
how can i make a edit box a marquee?


http://MTec89Net.com
irc.freenode.net #MTec89Net
#63725 11/12/03 10:18 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
I have a snipplet on mirc.net if you search for it.

Mysterious Link


-KingTomato
#63726 11/12/03 11:09 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
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 }
}

Last edited by MTec89; 11/12/03 11:14 PM.

http://MTec89Net.com
irc.freenode.net #MTec89Net
#63727 11/12/03 11:20 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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.


-KingTomato
#63728 12/12/03 12:46 AM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
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)
  }
}

Last edited by MTec89; 12/12/03 01:35 AM.

http://MTec89Net.com
irc.freenode.net #MTec89Net
#63729 12/12/03 05:26 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
add chr(160) to the end i think. Its a mirc flaw you have to workaround.


-KingTomato
#63730 12/12/03 07:54 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
didnt work;/ chr 32 didnt either


http://MTec89Net.com
irc.freenode.net #MTec89Net

Link Copied to Clipboard