sprite example: skip erasing background

git-svn-id: trunk@15094 -
This commit is contained in:
mattias 2008-05-12 08:20:14 +00:00
parent 58088268ed
commit fc595c4244
4 changed files with 45 additions and 40 deletions

View File

@ -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

View File

@ -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
]);

View File

@ -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;

View File

@ -2,38 +2,18 @@
<CONFIG>
<ProjectOptions>
<PathDelim Value="/"/>
<Version Value="5"/>
<Version Value="6"/>
<General>
<Flags>
<SaveClosedFiles Value="False"/>
<SaveOnlyProjectUnits Value="True"/>
</Flags>
<MainUnit Value="0"/>
<ActiveEditorIndexAtStart Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=""/>
<Title Value="spriteexample"/>
<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>