1
0
mirror of https://github.com/loginov-dmitry/multithread.git synced 2024-11-24 08:52:15 +02:00

Ex2 converted to Lazarus

This commit is contained in:
loginov-dmitry 2024-10-12 22:34:21 +03:00
parent bc2b723c6b
commit 5680842a84
7 changed files with 147 additions and 4 deletions

5
.gitignore vendored
View File

@ -6,3 +6,8 @@ __history
*.exe
*.log
*.zip
/Ex1/backup
/Ex1/lib
*.lps
/Ex2/backup
/Ex2/lib

BIN
Ex2/Ex2ProjLaz.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

81
Ex2/Ex2ProjLaz.lpi Normal file
View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<Title Value="Ex2ProjLaz"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="Ex2ProjLaz.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="Ex2Unit.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="Ex2ProjLaz"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="C:\Dima\Delphi\GitHub\multithread\Ex2"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

24
Ex2/Ex2ProjLaz.lpr Normal file
View File

@ -0,0 +1,24 @@
program Ex2ProjLaz;
{$IFDEF FPC}{$CODEPAGE UTF8}{$H+}{$MODE DELPHI}{$ENDIF}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, Ex2Unit;
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

BIN
Ex2/Ex2ProjLaz.res Normal file

Binary file not shown.

24
Ex2/Ex2Unit.lfm Normal file
View File

@ -0,0 +1,24 @@
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 127
ClientWidth = 251
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
Font.Style = []
OnDestroy = FormDestroy
PixelsPerInch = 96
object btnRunParallelThread: TButton
Left = 8
Top = 8
Width = 235
Height = 33
Caption = #1047#1072#1087#1091#1089#1090#1080#1090#1100' '#1087#1072#1088#1072#1083#1083#1077#1083#1100#1085#1099#1081' '#1087#1086#1090#1086#1082
TabOrder = 0
OnClick = btnRunParallelThreadClick
end
end

View File

@ -1,10 +1,15 @@
unit Ex2Unit;
{$IFDEF FPC}{$CODEPAGE UTF8}{$H+}{$MODE DELPHI}{$ENDIF}
unit Ex2Unit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
{$IFnDEF FPC}
Windows, Messages,
{$ELSE}
LCLIntf, LCLType, LMessages,
{$ENDIF}
SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type
TMyLongThread = class(TThread)
@ -30,7 +35,11 @@ var
implementation
{$R *.dfm}
{$IFnDEF FPC}
{$R *.dfm}
{$ELSE}
{$R *.lfm}
{$ENDIF}
procedure TForm1.btnRunParallelThreadClick(Sender: TObject);
begin