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 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 Left = 305
Height = 300 Height = 300
Top = 224 Top = 224
Width = 400 Width = 400
HorzScrollBar.Page = 399
VertScrollBar.Page = 299
Caption = 'PlayGroundForm'
OnClose = PlayGroundFormClose
OnCreate = PlayGroundFormCreate
OnDestroy = PlayGroundFormDestroy
LCLVersion = '0.9.25'
object Timer1: TTimer object Timer1: TTimer
Interval = 100 Interval = 100
OnTimer = Timer1Timer OnTimer = Timer1Timer

View File

@ -1,9 +1,10 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TPlayGroundForm','FORMDATA',[ LazarusResources.Add('TPlayGroundForm','FORMDATA',[
'TPF0'#15'TPlayGroundForm'#14'PlayGroundForm'#7'Caption'#6#14'PlayGroundForm' 'TPF0'#15'TPlayGroundForm'#14'PlayGroundForm'#4'Left'#3'1'#1#6'Height'#3','#1
+#12'ClientHeight'#3','#1#11'ClientWidth'#3#144#1#7'OnClose'#7#19'PlayGroundF' +#3'Top'#3#224#0#5'Width'#3#144#1#18'HorzScrollBar.Page'#3#143#1#18'VertScrol'
+'ormClose'#8'OnCreate'#7#20'PlayGroundFormCreate'#9'OnDestroy'#7#21'PlayGrou' +'lBar.Page'#3'+'#1#7'Caption'#6#14'PlayGroundForm'#7'OnClose'#7#19'PlayGroun'
+'ndFormDestroy'#13'PixelsPerInch'#2'Z'#18'HorzScrollBar.Page'#3#143#1#18'Ver' +'dFormClose'#8'OnCreate'#7#20'PlayGroundFormCreate'#9'OnDestroy'#7#21'PlayGr'
+'tScrollBar.Page'#3'+'#1#4'Left'#3'1'#1#6'Height'#3','#1#3'Top'#3#224#0#5'Wi' +'oundFormDestroy'#10'LCLVersion'#6#6'0.9.25'#0#6'TTimer'#6'Timer1'#8'Interva'
+'dth'#3#144#1#0#6'TTimer'#6'Timer1'#8'Interval'#2'd'#7'OnTimer'#7#11'Timer1T' +'l'#2'd'#7'OnTimer'#7#11'Timer1Timer'#4'left'#3#164#0#3'top'#2'1'#0#0#0
+'imer'#4'left'#3#164#0#3'top'#2'1'#0#0#0
]); ]);

View File

@ -5,7 +5,7 @@ unit PlayGround;
interface interface
uses uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, LMessages,
ExtCtrls; ExtCtrls;
type type
@ -17,6 +17,7 @@ type
private private
FPicture: TPicture; FPicture: TPicture;
procedure SetPicture(const AValue: TPicture); procedure SetPicture(const AValue: TPicture);
procedure WMEraseBkgnd(var Msg: TLMessage); message LM_ERASEBKGND;
public public
constructor Create(TheOwner: TComponent); override; constructor Create(TheOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
@ -131,6 +132,11 @@ begin
FPicture.Assign(AValue); FPicture.Assign(AValue);
end; end;
procedure TPictureControl.WMEraseBkgnd(var Msg: TLMessage);
begin
Msg.Result := 1;
end;
procedure TPictureControl.PictureChanged(Sender: TObject); procedure TPictureControl.PictureChanged(Sender: TObject);
begin begin
Invalidate; Invalidate;

View File

@ -2,38 +2,18 @@
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<PathDelim Value="/"/> <PathDelim Value="/"/>
<Version Value="5"/> <Version Value="6"/>
<General> <General>
<Flags> <Flags>
<SaveClosedFiles Value="False"/> <SaveClosedFiles Value="False"/>
<SaveOnlyProjectUnits Value="True"/> <SaveOnlyProjectUnits Value="True"/>
</Flags> </Flags>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<ActiveEditorIndexAtStart Value="0"/>
<IconPath Value="./"/> <IconPath Value="./"/>
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Title Value="spriteexample"/> <Title Value="spriteexample"/>
<ActiveEditorIndexAtStart Value="0"/>
</General> </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> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
<IgnoreBinaries Value="False"/> <IgnoreBinaries Value="False"/>
@ -51,9 +31,29 @@
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item1> </Item1>
</RequiredPackages> </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> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="4"/> <Version Value="5"/>
<SearchPaths> <SearchPaths>
<SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/> <SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/>
</SearchPaths> </SearchPaths>