Marquee plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
 
(5 intermediate revisions by 5 users not shown)
Line 8: Line 8:


== Description ==
== Description ==
Resultss looks like marquee tag on the html page, scrolling text. Some animation on the INSTFILES page during long installs may be useful (but this is applicable to other pages as well, for example as a help text near some controls), 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. 20 parameters allow to define text, position, border, colors, font and scroll. The only big limitation I see now - horizontal scroll only (both directions).  Extended functionality (compare to html tag) - bi-directional movement (/swing).
Result looks like marquee tag on the html page, scrolling text. Some animation on the INSTFILES page during long installs may be useful (but this is applicable to other pages as well, for example as a help text near some controls), 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. 20 parameters allow to define text, position, border, colors, font and scroll. The only big limitation I see now - horizontal scroll only (both directions).  Extended functionality (compare to html tag) - bi-directional movement (/swing).


== Syntax ==
== Syntax ==
Line 21: Line 21:
:: Typeface name of font, default is Times (meaning Times New Roman).
:: Typeface name of font, default is Times (meaning Times New Roman).


:; /COLOR=xxxxxx
:; /COLOR=0xXXXXXX
:: Font color, hex value RGB, FF0000 is red, default - current system color.
:: Font color, hex value RGB, 0xFF0000 is red, default - current system color.


:; /HEIGHT=xxx
:; /HEIGHT=xxx
Line 40: Line 40:


:; /UNDERLINE
:; /UNDERLINE
:: Underlined font, defalt is no.
:: Underlined font, default is no.


:; /SCROLLS=x
:; /SCROLLS=x
Line 66: Line 66:
:: "x" pixels spacer between text clipping rect and border, 0 if border not set, default is 1.
:: "x" pixels spacer between text clipping rect and border, 0 if border not set, default is 1.


:; /BCOL=xxxxxx
:; /BCOL=0xXXXXXX
:: Border color, default is text color.
:: Border color, default is text color.


:; /GCOL=xxxxxx
:; /GCOL=0xXXXXXX
:: Background color, default is drawing rect left top point color.
:: Background color, default is drawing rect left top point color.


Line 85: Line 85:


=== "stop" DLL function ===
=== "stop" DLL function ===
<highlight-nsis>Marquee::stop</highlight-nsis>
<highlight-nsis>Marquee:stop</highlight-nsis>
Stops the text movement.
Stops the text movement.


== Example ==
== Example ==
<highlight-nsis>
<highlight-nsis>
   Marquee::start /NOUNLOAD /color=0000b0 /top=80 "Marquee plug-in"
   Marquee::start /NOUNLOAD /color=0x0000b0 /top=80 "Marquee plug-in"
;  add you code here
;  add you code here
   Marquee::stop
   Marquee::stop

Latest revision as of 21:24, 11 August 2010

Author: Takhir (talk, contrib)


Links

Download:
Marquee.zip (9 KB)
Forum thread

Description

Result looks like marquee tag on the html page, scrolling text. Some animation on the INSTFILES page during long installs may be useful (but this is applicable to other pages as well, for example as a help text near some controls), 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. 20 parameters allow to define text, position, border, colors, font and scroll. The only big limitation I see now - horizontal scroll only (both directions). Extended functionality (compare to html tag) - bi-directional movement (/swing).

Syntax

"start" DLL function

Marquee::start [params] "text to display"

Starts the text movement.

[params]
Parameters. Can be any of the following:
/FACE=FontFace
Typeface name of font, default is Times (meaning Times New Roman).
/COLOR=0xXXXXXX
Font color, hex value RGB, 0xFF0000 is red, default - current system color.
/HEIGHT=xxx
Height, in logical units, of the font's character cell or character, default is 18.
/WIDTH=xxx
Average char width, in logical units, set -1 to use current system font, default is 10.
/WEIGHT=xxx
Weight of the font in the range 0 through 1000, default is 600 (FW_SEMIBOLD, WINGDI.H).
/CHARSET=xxx
Character set, default is 0 (ANSI_CHARSET, WINGDI.H).
/ITALIC
Italic font, default is no italic font.
/UNDERLINE
Underlined font, default is no.
/SCROLLS=x
Number of text scrolls, set 1 for once, default is 0 (non-stop).
/STEP=x
Text movement step, negative for left2right, higher value = faster scroll, default is 1 pixel. Default /START value for /STEP=0 is CENTER.
/INTERVAL=xx
Text movement interval (between jumps), lower value = faster scroll, default is 20 milliseconds.
/LEFT=x
Additional left spacer, percents of the dialog width, default is 0 (%).
/RIGHT=x
Additional right spacer, percents of the dialog width, default is left spacer value.
/TOP=xx
Text top spacer, percents of the dialog client area height, default is 60 (%).
/BORDER=x
Displays "x" pixel(s) border rectangle.
/SPACER=x
"x" pixels spacer between text clipping rect and border, 0 if border not set, default is 1.
/BCOL=0xXXXXXX
Border color, default is text color.
/GCOL=0xXXXXXX
Background color, default is drawing rect left top point color.
/HWND=x
Window handle to paint on. Default is current installer page.
/SWING
bi-directional movement
/START={RIGHT|LEFT|CENTER}
start position inside rectangle (for /step=0 mainly). Default position is outside paint rectangle
"text to display"
Max length 1024 or 8096.

"stop" DLL function

Marquee:stop

Stops the text movement.

Example

   Marquee::start /NOUNLOAD /color=0x0000b0 /top=80 "Marquee plug-in"
;  add you code here
   Marquee::stop