Skip to content
⌘ NSIS Forum Archive

Marquee plug-in

18 posts

Takhir#

Marquee plug-in

Result looks like <marquee> tag on the html page, scrolling text. I thought about some animation on the INSTFILES page during long installs (but may be used with other pages as well), attached plug-in is one of possible ways. Text length to be displayed may be big enough, limited by NSIS 'stringsize' parameter, 1024 and 8096 bytes for common and special NSIS builds. 14 parameters define text, font and scroll. The only big limitation I see now - horizontal scroll only (both directions), "Star Wars" introduction panoramic text not implemented yet 🙂 (requires more time). Idea was also discussed in this thread http://forums.winamp.com/showthread....hreadid=210055
deguix#
May I implement this to IOEx 😁? I mean, its a lot easier to work on a control when someone else already started the work 😎.
Takhir#
2 new parameters - right text limit (not center position) and border rectangle (optional 🙂 ).
Takhir#
'/once' option was replaced with '/scrolls=cnt', where 0 (default) is non-stop mode, positive values define how many times user will see scrolling text (if page will not be closed earlier 🙂 ).
Text alignment is more safe now - '/top=100' aligns text to client area bottom (plug-in shifts target rectangle up using calculated text height value), '/top=0' - top alignment with additional little shift down if '/border' defined.
Takhir#
New options: border width, color and spacer between border and text clipping rectangle. Archive page now available http://nsis.sourceforge.net/archive/...instances=0,32
Takhir#
2 little updates: a bit safer on Abort/Quit (no problems with previous versions, but now it's even safer 🙂 ) and faster redraw (usefull on INSTFILES page when processor load is up to 100%). zipped dll size 3 kB.
Takhir#
2 new options:
bi-directional movement (/swing)
start position inside 'marquee' rectangle (left, right, center) - mainly for /step=0 static text mode.
Updated wiki page
Takhir#
2 new options:
GCOL - sets background color for drawing rectangle, default is rect left top point color.
HWND - window handle to paint on. Default is current installer page.
wiki page
stass#
How do NSIS, running text string (crawl line)? That is, the text moves from left to right.
This can Marquee plugin. But very bad plugin works on custom pages. We can say in general is not working as it should ...
How to do it without a plugin ?
Anders#
Originally Posted by stass View Post
How to do it without a plugin ?
It cannot be done without a plugin. You could do it with a nsDialogs timer and strcpy...
Anders#
Originally Posted by stass View Post
Anders
Please tell me - how to do it with a timer ?
In the timer callback you use StrCpy to modify the string...
stass#
Anders
Can be an example ? Please ...

pattern was this:
!include "nsDialogs.nsh"
OutFile "ScrollTxt.exe"
Page custom myPage
var dialog
var txt
var VarTime
Function myPage
nsDialogs::Create 1018
Pop $dialog
${NSD_CreateText} 0 0 100% 8% "ScrollTxt    ScrollTxt    ScrollTxt    "
Pop $txt
SetCtlColors $txt 0xFF0000 0xffffff
System::Call 'user32::SetTimer(i $txt,i 2,i 250,i0)i.r0'
StrCpy $VarTime $0 
nsDialogs::Show
FunctionEnd
Section
SectionEnd 
Anders#
...I said nsDialogs timer. I don't have NSIS on this machine, you have to figure it out on your own.
stass#
Anders

I corrected the code. But why the text is moving in the opposite direction? And how to make a smooth movement of the text?

Page custom myPage 
var dialog 
var txt 
Function myPage 
nsDialogs::Create 1018 
Pop $dialog 
${NSD_CreateText} 0 0 100% 8% "ScrollTxt    ScrollTxt    ScrollTxt    " 
Pop $txt 
SetCtlColors $txt 0xFF0000 0xffffff 
${NSD_CreateTimer} OnTimer 150
nsDialogs::Show
${NSD_KillTimer} OnTimer
FunctionEnd
Function OnTimer
StrCpy $0 $txt
${NSD_GetText} $0 "$1"
        StrCpy $2 $1 1
        StrCpy $1 "$1$2" "" 1
${NSD_SetText} $0 "$1"
FunctionEnd
Section 
SectionEnd 
JasonFriday13#
You can try lockwindow off/on to get a better repaint. The string copy code appears to scroll to the left, this makes reading it very easy. Scrolling to the right requires reversing the logic (removing the last char and adding it to the start).