TScrollMsg

Fonte: source/classes/scrolmsg.prg

Inherits from: TPanel

TScrollMsg is an auto-scrolling marquee text control. It continuously scrolls text either horizontally (ticker-tape style) or vertically (scrolling credits style). A timer drives incremental pixel scrolling, and the text wraps around seamlessly when it reaches the end. It supports configurable speed, colors, borders, and runtime text updates.

Key DATA Members

DATATypeDescription
cTextCharacterThe text to scroll (read-only, use SetText() to update)
lVerticalLogicalVertical scrolling when .T. (default), horizontal when .F.
nSpeedNumericScroll speed in pixels per tick (default 2)
lBorderLogicalDraw a border around the control (default .T.)
nScrollPixNumericCurrent pixel scroll offset (protected)
nTextSizeNumericCached text dimension for wrap calculation (protected)

Methods

MethodDescription
New( nRow, nCol, nW, nH, cText, oWnd, oFont, nSpeed, nClrText, nClrBack, lHoriz, lPixels, lDesign, cVarName, lNoBorder )Create a new TScrollMsg marquee control
SetText( cText )Change the scrolling text at runtime and restart scroll

Example: Horizontal Marquee

#include "FiveWin.ch"

function Main()

   local oWnd, oScroll

   DEFINE WINDOW oWnd TITLE "News Ticker" SIZE 600, 100

   oScroll := TScrollMsg():New( 10, 10, 560, 30,;
               "Breaking news: FWH 26.05 released!",;
               oWnd,, 3, CLR_YELLOW, CLR_BLUE, .T., .T. )

   ACTIVATE WINDOW oWnd CENTERED

return nil

Notes

Veja Também