From fc595c4244f8fbe96125cf049df8dfbe3fa6d473 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 12 May 2008 08:20:14 +0000 Subject: [PATCH] sprite example: skip erasing background git-svn-id: trunk@15094 - --- examples/sprites/playground.lfm | 16 +++++------ examples/sprites/playground.lrs | 15 +++++----- examples/sprites/playground.pas | 8 +++++- examples/sprites/spriteexample.lpi | 46 +++++++++++++++--------------- 4 files changed, 45 insertions(+), 40 deletions(-) diff --git a/examples/sprites/playground.lfm b/examples/sprites/playground.lfm index 3437ddb100..8c11e5f952 100644 --- a/examples/sprites/playground.lfm +++ b/examples/sprites/playground.lfm @@ -1,17 +1,15 @@ object PlayGroundForm: TPlayGroundForm - Caption = 'PlayGroundForm' - ClientHeight = 300 - ClientWidth = 400 - OnClose = PlayGroundFormClose - OnCreate = PlayGroundFormCreate - OnDestroy = PlayGroundFormDestroy - PixelsPerInch = 90 - HorzScrollBar.Page = 399 - VertScrollBar.Page = 299 Left = 305 Height = 300 Top = 224 Width = 400 + HorzScrollBar.Page = 399 + VertScrollBar.Page = 299 + Caption = 'PlayGroundForm' + OnClose = PlayGroundFormClose + OnCreate = PlayGroundFormCreate + OnDestroy = PlayGroundFormDestroy + LCLVersion = '0.9.25' object Timer1: TTimer Interval = 100 OnTimer = Timer1Timer diff --git a/examples/sprites/playground.lrs b/examples/sprites/playground.lrs index d3cb830f84..628b5d059c 100644 --- a/examples/sprites/playground.lrs +++ b/examples/sprites/playground.lrs @@ -1,9 +1,10 @@ +{ This is an automatically generated lazarus resource file } + LazarusResources.Add('TPlayGroundForm','FORMDATA',[ - 'TPF0'#15'TPlayGroundForm'#14'PlayGroundForm'#7'Caption'#6#14'PlayGroundForm' - +#12'ClientHeight'#3','#1#11'ClientWidth'#3#144#1#7'OnClose'#7#19'PlayGroundF' - +'ormClose'#8'OnCreate'#7#20'PlayGroundFormCreate'#9'OnDestroy'#7#21'PlayGrou' - +'ndFormDestroy'#13'PixelsPerInch'#2'Z'#18'HorzScrollBar.Page'#3#143#1#18'Ver' - +'tScrollBar.Page'#3'+'#1#4'Left'#3'1'#1#6'Height'#3','#1#3'Top'#3#224#0#5'Wi' - +'dth'#3#144#1#0#6'TTimer'#6'Timer1'#8'Interval'#2'd'#7'OnTimer'#7#11'Timer1T' - +'imer'#4'left'#3#164#0#3'top'#2'1'#0#0#0 + 'TPF0'#15'TPlayGroundForm'#14'PlayGroundForm'#4'Left'#3'1'#1#6'Height'#3','#1 + +#3'Top'#3#224#0#5'Width'#3#144#1#18'HorzScrollBar.Page'#3#143#1#18'VertScrol' + +'lBar.Page'#3'+'#1#7'Caption'#6#14'PlayGroundForm'#7'OnClose'#7#19'PlayGroun' + +'dFormClose'#8'OnCreate'#7#20'PlayGroundFormCreate'#9'OnDestroy'#7#21'PlayGr' + +'oundFormDestroy'#10'LCLVersion'#6#6'0.9.25'#0#6'TTimer'#6'Timer1'#8'Interva' + +'l'#2'd'#7'OnTimer'#7#11'Timer1Timer'#4'left'#3#164#0#3'top'#2'1'#0#0#0 ]); diff --git a/examples/sprites/playground.pas b/examples/sprites/playground.pas index 25cba85bf6..0a1eaea163 100644 --- a/examples/sprites/playground.pas +++ b/examples/sprites/playground.pas @@ -5,7 +5,7 @@ unit PlayGround; interface uses - Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, LMessages, ExtCtrls; type @@ -17,6 +17,7 @@ type private FPicture: TPicture; procedure SetPicture(const AValue: TPicture); + procedure WMEraseBkgnd(var Msg: TLMessage); message LM_ERASEBKGND; public constructor Create(TheOwner: TComponent); override; destructor Destroy; override; @@ -131,6 +132,11 @@ begin FPicture.Assign(AValue); end; +procedure TPictureControl.WMEraseBkgnd(var Msg: TLMessage); +begin + Msg.Result := 1; +end; + procedure TPictureControl.PictureChanged(Sender: TObject); begin Invalidate; diff --git a/examples/sprites/spriteexample.lpi b/examples/sprites/spriteexample.lpi index 052ef3d340..cd95d7a9ec 100644 --- a/examples/sprites/spriteexample.lpi +++ b/examples/sprites/spriteexample.lpi @@ -2,38 +2,18 @@ - + - + <ActiveEditorIndexAtStart Value="0"/> </General> - <Units Count="2"> - <Unit0> - <Filename Value="spriteexample.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="SpriteExample"/> - <UsageCount Value="22"/> - </Unit0> - <Unit1> - <CursorPos X="12" Y="80"/> - <EditorIndex Value="0"/> - <Filename Value="playground.pas"/> - <ComponentName Value="PlayGroundForm"/> - <IsPartOfProject Value="True"/> - <Loaded Value="True"/> - <ResourceFilename Value="playground.lrs"/> - <TopLine Value="63"/> - <UnitName Value="PlayGround"/> - <UsageCount Value="22"/> - </Unit1> - </Units> <PublishOptions> <Version Value="2"/> <IgnoreBinaries Value="False"/> @@ -51,9 +31,29 @@ <PackageName Value="LCL"/> </Item1> </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="spriteexample.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="SpriteExample"/> + <UsageCount Value="22"/> + </Unit0> + <Unit1> + <Filename Value="playground.pas"/> + <ComponentName Value="PlayGroundForm"/> + <IsPartOfProject Value="True"/> + <ResourceFilename Value="playground.lrs"/> + <UnitName Value="PlayGround"/> + <CursorPos X="58" Y="135"/> + <TopLine Value="131"/> + <EditorIndex Value="0"/> + <UsageCount Value="22"/> + <Loaded Value="True"/> + </Unit1> + </Units> </ProjectOptions> <CompilerOptions> - <Version Value="4"/> + <Version Value="5"/> <SearchPaths> <SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/> </SearchPaths>