mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 10:47:58 +02:00
add define SplashDrawVersion to draw lazarus version over splash image
git-svn-id: trunk@13049 -
This commit is contained in:
parent
ab4ffc3715
commit
4bbe8f5e49
@ -17,6 +17,7 @@ object SplashForm: TSplashForm
|
||||
Width = 429
|
||||
Align = alClient
|
||||
AutoSize = True
|
||||
OnPaint = ImagePaint
|
||||
Transparent = False
|
||||
end
|
||||
end
|
||||
|
@ -6,5 +6,6 @@ LazarusResources.Add('TSplashForm','FORMDATA',[
|
||||
+#3'T'#1#8'AutoSize'#9#11'BorderStyle'#7#6'bsNone'#7'Caption'#6#7'Lazarus'#12
|
||||
+'ClientHeight'#3'U'#1#11'ClientWidth'#3#173#1#9'FormStyle'#7#11'fsStayOnTop'
|
||||
+#8'Position'#7#14'poScreenCenter'#0#6'TImage'#5'Image'#6'Height'#3'U'#1#5'Wi'
|
||||
+'dth'#3#173#1#5'Align'#7#8'alClient'#8'AutoSize'#9#11'Transparent'#8#0#0#0
|
||||
+'dth'#3#173#1#5'Align'#7#8'alClient'#8'AutoSize'#9#7'OnPaint'#7#10'ImagePain'
|
||||
+'t'#11'Transparent'#8#0#0#0
|
||||
]);
|
||||
|
@ -40,7 +40,8 @@ uses
|
||||
Graphics,
|
||||
LResources,
|
||||
StdCtrls,
|
||||
SysUtils;
|
||||
SysUtils,
|
||||
AboutFrm;
|
||||
|
||||
type
|
||||
|
||||
@ -49,6 +50,7 @@ type
|
||||
TSplashForm = class(TForm)
|
||||
Image: TImage;
|
||||
procedure ApplicationOnIdle(Sender: TObject; var Done: boolean);
|
||||
procedure ImagePaint(Sender: TObject);
|
||||
private
|
||||
protected
|
||||
public
|
||||
@ -61,6 +63,28 @@ var
|
||||
|
||||
implementation
|
||||
|
||||
{.$define SplashDrawVersion}
|
||||
|
||||
{$ifdef SplashDrawVersion}
|
||||
const
|
||||
VersionPos: TPoint = (X:407; Y:281);
|
||||
VersionStyle: TTextStyle =
|
||||
(
|
||||
Alignment : taCenter;
|
||||
Layout : tlCenter;
|
||||
SingleLine : True;
|
||||
Clipping : True;
|
||||
ExpandTabs : False;
|
||||
ShowPrefix : False;
|
||||
Wordbreak : False;
|
||||
Opaque : False;
|
||||
SystemFont : False;
|
||||
RightToLeft: False
|
||||
);
|
||||
VersionFontStyle: TFontStyles = [fsBold];
|
||||
VersionFontColor: TColor = clBlue;
|
||||
{$endif}
|
||||
|
||||
constructor TSplashForm.Create(AOwner: TComponent);
|
||||
var
|
||||
B: TBitmap;
|
||||
@ -70,7 +94,7 @@ begin
|
||||
B := LoadBitmapFromLazarusResource('splash_logo');
|
||||
Image.Picture.Graphic := B;
|
||||
B.Free;
|
||||
|
||||
|
||||
Application.OnIdle := @ApplicationOnIdle;
|
||||
end;
|
||||
|
||||
@ -89,6 +113,26 @@ begin
|
||||
Hide;
|
||||
end;
|
||||
|
||||
procedure TSplashForm.ImagePaint(Sender: TObject);
|
||||
|
||||
{$ifdef SplashDrawVersion}
|
||||
var
|
||||
ATextRect: TRect;
|
||||
{$endif}
|
||||
|
||||
begin
|
||||
|
||||
{$ifdef SplashDrawVersion}
|
||||
// GetLazarusVersionString is too long => use LazarusVersionStr
|
||||
ATextRect.TopLeft := VersionPos;
|
||||
ATextRect.BottomRight := Point(Image.Picture.Width, Image.Picture.Height);
|
||||
Image.Canvas.Font.Style := VersionFontStyle;
|
||||
Image.Canvas.Font.Color := VersionFontColor;
|
||||
Image.Canvas.TextRect(ATextRect, VersionPos.X, VersionPos.Y, LazarusVersionStr, VersionStyle);
|
||||
{$endif}
|
||||
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I splash.lrs}
|
||||
{$I ../images/splash_logo.lrs}
|
||||
|
Loading…
Reference in New Issue
Block a user