[Ocs-comps-commits] OCS2/Samples/VCL/ScreenSaver/Region ScreenSaver.cfg,NONE,1.1 ScreenSaver.dof,NON
Brought to you by:
tectsoft
Update of /cvsroot/ocs-comps/OCS2/Samples/VCL/ScreenSaver/Region In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10593/Samples/VCL/ScreenSaver/Region Added Files: ScreenSaver.cfg ScreenSaver.dof ScreenSaver.dpr ScreenSaver.res Unit1.dfm Unit1.pas Unit2.dfm Unit2.pas Log Message: Initially added to source control --- NEW FILE: ScreenSaver.dpr --- program ScreenSaver; uses Forms, Unit1 in 'Unit1.pas' {Form1}, Unit2 in 'Unit2.pas' {Form2}, OrckaScreenSaver in '..\..\Source\OrckaScreenSaver.pas'; {$E scr} {$R *.RES} begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end. --- NEW FILE: Unit2.pas --- unit Unit2; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Spin; type TForm2 = class(TForm) SpinEdit1: TSpinEdit; SpinEdit2: TSpinEdit; Label1: TLabel; Label2: TLabel; btnOK: TButton; btnCancel: TButton; private { Private declarations } public { Public declarations } end; procedure ShowOptions; implementation uses IniFiles; {$R *.DFM} procedure ShowOptions; var Form2: TForm2; Ini: TInifile; begin Form2 := TForm2.Create(nil); try Ini := TIniFile.Create('oss.ini'); try Form2.SpinEdit1.Value := Ini.ReadInteger('Settings', 'Size', 150); Form2.SpinEdit2.Value := Ini.ReadInteger('Settings', 'Speed', 3); if Form2.ShowModal = mrOk then begin Ini.WriteInteger('Settings', 'Size', Form2.SpinEdit1.Value); Ini.WriteInteger('Settings', 'Speed', Form2.SpinEdit2.Value); end; finally Ini.Free; end; finally Form2.Free; end; end; end. --- NEW FILE: Unit2.dfm --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ScreenSaver.dof --- [Compiler] A=0 B=0 C=1 D=1 E=0 F=0 G=1 H=1 I=0 J=1 K=0 L=1 M=0 N=1 O=0 P=1 Q=0 R=0 S=0 T=1 U=0 V=1 W=0 X=1 Y=1 Z=1 ShowHints=1 ShowWarnings=1 UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; [Linker] MapFile=0 OutputObjs=0 ConsoleApp=1 DebugInfo=0 RemoteSymbols=0 MinStackSize=16384 MaxStackSize=1048576 ImageBase=4194304 ExeDescription= [Directories] OutputDir= UnitOutputDir= PackageDLLOutputDir= PackageDCPOutputDir= SearchPath=D:\packages\CDGen\Source;D:\packages\CDMail\Source;D:\packages\CDSubCls\Source Packages=Vcl50;Vclx50;VclSmp50;Qrpt50;Vcldb50;Vclbde50;ibevnt50;vcldbx50;TeeUI50;TeeDB50;Tee50;TeeQR50;VCLIB50;vclie50;Inetdb50;Inet50;NMFast50;dclocx50;dclaxserver50 Conditionals= DebugSourceDirs= UsePackages=0 [Parameters] RunParams= HostApplication= [Language] ActiveLang= ProjectLang=$00000409 RootDir= [Version Info] IncludeVerInfo=1 AutoIncBuild=1 MajorVer=1 MinorVer=0 Release=0 Build=3 Debug=0 PreRelease=0 Special=0 Private=0 DLL=0 Locale=1033 CodePage=1252 [Version Info Keys] CompanyName=Orcka FileDescription= FileVersion=1.0.0.3 InternalName= LegalCopyright=Copyright © 2000. Orcka Development. LegalTrademarks= OriginalFilename= ProductName= ProductVersion=1.0.0.0 Comments= --- NEW FILE: Unit1.pas --- unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, OrckaScreenSaver, ExtCtrls; type TForm1 = class(TForm) OrckaScreenSaver1: TOrckaScreenSaver; procedure OrckaScreenSaver1Initialize(Sender: TObject; Bitmap: TBitmap); procedure OrckaScreenSaver1Finalize(Sender: TObject); procedure OrckaScreenSaver1DrawScene(Sender: TObject; Bitmap: TBitmap); procedure OrckaScreenSaver1Configuration(Sender: TObject); private FScreen: TBitmap; GoLeft: Boolean; GoDown: Boolean; nTop, nLeft: Longint; SpotSize: Word; MoveBy: Word; public end; var Form1: TForm1; implementation uses IniFiles, Unit2; {$R *.DFM} procedure TForm1.OrckaScreenSaver1Initialize(Sender: TObject; Bitmap: TBitmap); var Ini: TInifile; begin Ini := TIniFile.Create('oss.ini'); try SpotSize := Ini.ReadInteger('Settings', 'Size', 150); MoveBy := Ini.ReadInteger('Settings', 'Speed', 3); finally Ini.Free; end; FScreen := TBitmap.Create; FScreen.Width := Screen.Width; FScreen.Height := Screen.Height; BitBlt(FScreen.Canvas.Handle, 0, 0, Screen.Width, Screen.Height, GetDC(GetDesktopWindow), 0, 0, SRCCopy); Bitmap.Canvas.Draw(0, 0, FScreen); Randomize; nTop := Random(Bitmap.Height - SpotSize) + 1; nLeft := Random(Bitmap.Width - SpotSize) + 1; GoDown := LongBool(Random(1)); GoLeft := LongBool(Random(1)); end; procedure TForm1.OrckaScreenSaver1Finalize(Sender: TObject); begin FScreen.Free; end; procedure TForm1.OrckaScreenSaver1DrawScene(Sender: TObject; Bitmap: TBitmap); var Rgn1, Rgn2: HRgn; begin Bitmap.Canvas.Draw(0, 0, FScreen); if nTop < 0 then GoDown := True else if (GoDown) and (nTop + SpotSize > Screen.Height) then GoDown := False; if nLeft < 0 then GoLeft := False else if (not GoLeft) and (nLeft + SpotSize > Screen.Width) then GoLeft := True; Application.ProcessMessages; if GoDown then Inc(nTop, MoveBy) else Dec(nTop, MoveBy); if GoLeft then Dec(nLeft, MoveBy) else Inc(nLeft, MoveBy); Rgn1 := CreateEllipticRgn(nLeft, nTop, nLeft + SpotSize, nTop + SpotSize); Rgn2 := CreateRectRgn(0, 0, Screen.Width, Screen.Height); CombineRgn(Rgn2, Rgn2, Rgn1, RGN_DIFF); FillRgn(Bitmap.Canvas.Handle, Rgn2, GetStockObject(BLACK_BRUSH)); end; procedure TForm1.OrckaScreenSaver1Configuration(Sender: TObject); begin ShowOptions; end; end. --- NEW FILE: Unit1.dfm --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ScreenSaver.cfg --- -$A- -$B- -$C+ -$D+ -$E- -$F- -$G+ -$H+ -$I- -$J+ -$K- -$L+ -$M- -$N+ -$O- -$P+ -$Q- -$R- -$S- -$T+ -$U- -$V+ -$W- -$X+ -$YD -$Z1 -cg -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -H+ -W+ -M -$M16384,1048576 -K$00400000 -LE"d:\program files\borland\delphi5\Projects\Bpl" -LN"d:\program files\borland\delphi5\Projects\Bpl" -U"D:\packages\CDGen\Source;D:\packages\CDMail\Source;D:\packages\CDSubCls\Source" -O"D:\packages\CDGen\Source;D:\packages\CDMail\Source;D:\packages\CDSubCls\Source" -I"D:\packages\CDGen\Source;D:\packages\CDMail\Source;D:\packages\CDSubCls\Source" -R"D:\packages\CDGen\Source;D:\packages\CDMail\Source;D:\packages\CDSubCls\Source" --- NEW FILE: ScreenSaver.res --- (This appears to be a binary file; contents omitted.) |