I am trying to use a freeware componet called LedScreen to do some neat scrolling tricks. This is working out fine creating a single string and having it scroll on a seperate form.
What i want to do is to create a script using some kind of timed events so i can introduce a new string and have it appear after the previous has finished scrolling. so far its not working out at all and I can't figure out how to do it.
The scroller has Finish parameter that supposedly signals a 0 to indicate when the scroll has done but its at zero the second the line is excuted.
All this needs to be done so when i click back to the main form the scroller will disappear.
if the code fragment doesnt help maybe i can email the source code of the component to someone.
thanks.
TLedScreen = class(TCustomControl)
private
Leds : TBitmap;
ScreenImage : TBitmap;
ScreenData : Array [1..90] of Byte;
TextData : PTextData;
TextLength : Integer;
TextSize : Integer;
Timer : TTimer;
First,Last : Integer;
ScrollCount : Integer;
Loops : Integer;
ShiftCount : Integer;
LeftShift : Boolean;
LastLine : Integer;
FinishTag : Word;
FinishedRows : Array [0..7] of Boolean;
ScreenBits : Array [1..180,0..7] of Boolean;
VisibleLeds : Integer;
VisibleCols : Integer;
FLightColor : TColor;
FDarkColor : TColor;
FBackground : TColor;
FFinish : Word;
FOnFinish : TNotifyEvent;
FAbout : TAboutProperty;
procedure SetLightColor(Value : TColor);
procedure SetDarkColor(Value : TColor);
procedure SetBackground(Value : TColor);
protected
procedure CreateLeds; virtual;
procedure DrawLed(IsOn : Boolean; X,Y : Integer); virtual;
procedure CreateText(Text : String; FillLine : Boolean; Alignment : TAlignment); virtual;
procedure LeftScroll(Sender : TObject); virtual;
procedure RightScroll(Sender : TObject); virtual;
procedure DownScroll(Sender : TObject); virtual;
procedure UpScroll(Sender : TObject); virtual;
procedure LeftSlideIn(Sender : TObject); virtual;
procedure RightSlideIn(Sender : TObject); virtual;
procedure UpSlideIn(Sender : TObject); virtual;
procedure DownSlideIn(Sender : TObject); virtual;
procedure LeftSlideOut(Sender : TObject); virtual;
procedure RightSlideOut(Sender : TObject); virtual;
procedure UpSlideOut(Sender : TObject); virtual;
procedure DownSlideOut(Sender : TObject); virtual;
procedure LeftSlideLinesIn(Sender : TObject); virtual;
procedure RightSlideLinesIn(Sender : TObject); virtual;
procedure LeftSlideLinesOut(Sender : TObject); virtual;
procedure RightSlideLinesOut(Sender : TObject); virtual;
procedure UpSlideLinesIn(Sender : TObject); virtual;
procedure DownSlideLinesIn(Sender : TObject); virtual;
procedure UpSlideLinesOut(Sender : TObject); virtual;
procedure DownSlideLinesOut(Sender : TObject); virtual;
procedure Paint; override;
public
constructor Create(AOwner : TComponent); override;
destructor Destroy; override;
procedure ScrollLeft(Text : String; Loop : Integer; Finish : Word); virtual;
procedure ScrollRight(Text : String; Loop : Integer; Finish : Word); virtual;
procedure ScrollDown(Text : String; Loop : Integer; Finish : Word;
Alignment : TAlignment); virtual;
procedure ScrollUp(Text : String; Loop : Integer; Finish : Word;
Alignment : TAlignment); virtual;
procedure SlideInLeft(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideInRight(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideInUp(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideInDown(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideOutLeft(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideOutRight(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideOutUp(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideOutDown(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideLinesInLeft(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideLinesInRight(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideLinesOutLeft(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideLinesOutRight(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideLinesInUp(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideLinesInDown(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideLinesOutUp(Text : String; Finish : Word; Alignment : TAlignment); virtual;
procedure SlideLinesOutDown(Text : String; Finish : Word; Alignment : TAlignment); virtual;
property Finish : Word read FFinish;
published
property LightColor : TColor read FLightColor write SetLightColor;
property DarkColor : TColor read FDarkColor write SetDarkColor;
property Background : TColor read FBackground write SetBackground;
property OnFinish : TNotifyEvent read FOnFinish write FOnFinish;
property About : TAboutProperty read FAbout write FAbout;
end;
Drop a LedScreen component on your form, A TListBox, & a TTimer & two buttons (Start & Stop)
Fill the TListBox with Strings (or sentences)
and use the folowing code
//LedScreen Components OnFinish event
procedure TForm1.LedScreen1Finish(Se
begin
inc(strIndex);
end;
procedure TForm1.FormActivate(Sender
begin
strIndex:= 0;
end;
//Start Button
procedure TForm1.Button1Click(Sender
begin
Timer1.Enabled:= True;
LedScreen1.ScrollLeft(List
end;
//timer onTimer event
procedure TForm1.Timer1Timer(Sender:
begin
LedScreen1.ScrollLeft(List
end;
//Stop Button
procedure TForm1.Button2Click(Sender
begin
Timer1.Enabled:= False;
end;