home *** CD-ROM | disk | FTP | other *** search
- unit about;
-
- interface
-
- {$r pics.res}
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls;
-
- type
- TfrmAbout = class(TForm)
- btnOk: TButton;
- lblExpert: TLabel;
- lblwritten: TLabel;
- lblVersion: TLabel;
- lblThanks: TLabel;
- imgIcon: TImage;
- tim: TTimer;
- pnt: TPaintBox;
- procedure timTimer(Sender: TObject);
- procedure FormClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- public
- bClosing: Boolean;
- sVersion: String;
- lDelayTime: Longint;
- procedure ShowDialog(sVer: String); virtual;
- end;
-
- var
- frmAbout: TfrmAbout;
-
- implementation
-
- {$R *.DFM}
-
- procedure TfrmAbout.ShowDialog(sVer: String);
- begin
- lblVersion.Caption:='Version '+sVer;
- sVersion:=sVer;
- ShowModal;
- end;
-
- procedure TfrmAbout.timTimer(Sender: TObject);
- var tBmp: TBitMap;
- lCounter: Longint;
- lTop: Longint;
- lDelay: Longint;
- pcMsg: PChar;
- sMsg: String;
- lLeft: Longint;
- tTmp: TBitMap;
- const aiColor: array[0..9] of TColor = (
- clBlack, clRed, clGreen, clBlue, clYellow, clAqua, clPurple, clOlive, clFuchsia, clMaroon);
- BMPHEIGHT = 880;
- MAXIDS = 44;
-
- procedure DeCrypt;
- begin
- with tBmp.Canvas do begin
- if sMsg[1]='!' then begin
- sMsg:=Copy(sMsg, 2, Length(sMsg));
- repeat
- case sMsg[1] of
- 'c': begin
- Font.Color:=aiColor[StrToInt(sMsg[2])];
- Delete(sMsg, 1, 2);
- end;
- 'b': begin
- try
- tTmp:=TBitMap.Create;
- tTmp.Handle:=LoadBitmap(hInstance, PChar(Copy(sMsg, 2, Length(sMsg))));
- sMsg:='';
- Draw(1, lTop, tTmp);
- //tTmp.Free; // seems to except, dunno why...
- Inc(lTop, tTmp.Height-TextHeight('M')*130 div 100);
- except
- Inc(lTop, TextHeight('M')*130 div 100);
- end;
- end;
- 's': begin
- Font.Size:=StrToIntDef(Copy(sMsg, 2, 2), 8);
- Delete(sMsg, 1, 3);
- end;
- 'f': begin
- case sMsg[2] of
- '0': Font.Style:=[];
- '1': Font.Style:=[fsBold];
- '2': Font.Style:=[fsItalic];
- '3': Font.Style:=[fsBold, fsItalic];
- '4': Font.Style:=[fsUnderline];
- end;
- Delete(sMsg, 1, 2);
- end;
- end;
- until (sMsg='') or (not (sMsg[1] in ['s', 'f', 'c']));
- end;
- if (sMsg<>'') and (sMsg[1]='!') then
- Delete(sMsg, 1, 1);
- sMsg:=PChar(sMsg);
- if Pos('!', sMsg)>0 then begin
- TextOut(lLeft, lTop, Copy(sMsg, 1, Pred(Pos('!', sMsg))));
- Inc(lLeft, TextWidth(Copy(sMsg, 1, Pred(Pos('!', sMsg)))));
- sMsg:=Copy(sMsg, Pos('!', sMsg), Length(sMsg));
- end
- else begin
- TextOut(lLeft, lTop, sMsg);
- sMsg:='';
- end;
- end;
- end;
-
- procedure WaitMS(lMS: Longint);
- begin
- while GetTickCount-lDelay<lMS do
- Application.ProcessMessages;
- //Sleep(lMS);
- end;
-
- begin
- tim.Enabled:=FALSE;
- // get the scroller...
- lblVersion.Visible:=FALSE;
- lblWritten.Visible:=FALSE;
- lblThanks.Visible:=FALSE;
- btnOk.Visible:=FALSE;
- tBmp:=TBitMap.Create;
- pcMsg:=NIL;
- try
- with tBmp do begin
- Width:=pnt.Width;
- Height:=BMPHEIGHT;
- GetMem(pcMsg, 300);
- lTop:=0;
- Canvas.Brush.Color:=clBtnFace;
- Canvas.FillRect(Rect(0, 0, Width, Height));
- try
- with Canvas do begin
- for lCounter:=1 to MAXIDS do begin
- {$IFDEF DEBUG}
- Caption:=IntToStr(lCounter);
- {$ENDIF}
- if LoadString(hInstance, lCounter, pcMsg, 300)>0 then begin
- sMsg:=String(pcMsg);
- while (Pos('$BUILD', sMsg)>0) do
- sMsg:=Copy(sMsg, 1, Pred(Pos('$BUILD', sMsg)))+sVersion+Copy(sMsg, Pos('$BUILD', sMsg)+6, Length(sMsg));
- lLeft:=1;
- repeat
- DeCrypt
- until Pos('!', sMsg)=0;
- lTop:=lTop+TextHeight('M')*130 div 100;
- end;
- end;
- end;
- lCounter:=91;
- with pnt.Canvas do begin
- repeat
- Draw(-1, lCounter, tBmp);
- Application.ProcessMessages;
- Dec(lCounter);
- lDelay:=GetTickCount;
- WaitMS(lDelayTime);
- until (Abs(lCounter)+91>=BMPHEIGHT) or bClosing;
- end;
- except
- end;
- end;
- finally
- if Assigned(pcMsg) then
- FreeMem(pcMsg, 300);
- tBmp.Free;
- end;
- lblVersion.Visible:=TRUE;
- lblWritten.Visible:=TRUE;
- lblThanks.Visible:=TRUE;
- btnOk.Visible:=TRUE;
- tim.Enabled:=TRUE;
- end;
-
- procedure TfrmAbout.FormClick(Sender: TObject);
- begin
- Close;
- bClosing:=TRUE;
- end;
-
- procedure TfrmAbout.FormCreate(Sender: TObject);
- begin
- bClosing:=FALSE;
- lDelayTime:=50;
- sVersion:='';
- end;
-
- end.
-