From 4bbe8f5e49d8bdc61db4de88f2dac0d84b27b4b3 Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 27 Nov 2007 09:35:11 +0000 Subject: [PATCH] add define SplashDrawVersion to draw lazarus version over splash image git-svn-id: trunk@13049 - --- ide/splash.lfm | 1 + ide/splash.lrs | 3 ++- ide/splash.pp | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/ide/splash.lfm b/ide/splash.lfm index bea773e445..e34725deac 100644 --- a/ide/splash.lfm +++ b/ide/splash.lfm @@ -17,6 +17,7 @@ object SplashForm: TSplashForm Width = 429 Align = alClient AutoSize = True + OnPaint = ImagePaint Transparent = False end end diff --git a/ide/splash.lrs b/ide/splash.lrs index 4b699c0925..0ad92d016d 100644 --- a/ide/splash.lrs +++ b/ide/splash.lrs @@ -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 ]); diff --git a/ide/splash.pp b/ide/splash.pp index 546579a322..6a7fe71d9f 100644 --- a/ide/splash.pp +++ b/ide/splash.pp @@ -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}