You've already forked multithread
mirror of
https://github.com/loginov-dmitry/multithread.git
synced 2025-07-07 14:42:25 +02:00
Ex12 converted to Lazarus (required trunk FPC)
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -30,3 +30,5 @@ __history
|
|||||||
/Ex10/lib
|
/Ex10/lib
|
||||||
/Ex11/backup
|
/Ex11/backup
|
||||||
/Ex11/lib
|
/Ex11/lib
|
||||||
|
/Ex12/backup
|
||||||
|
/Ex12/lib
|
||||||
|
BIN
Ex12/Ex12ProjLaz.ico
Normal file
BIN
Ex12/Ex12ProjLaz.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 130 KiB |
85
Ex12/Ex12ProjLaz.lpi
Normal file
85
Ex12/Ex12ProjLaz.lpi
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<Version Value="12"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<General>
|
||||||
|
<SessionStorage Value="InProjectDir"/>
|
||||||
|
<Title Value="Ex12ProjLaz"/>
|
||||||
|
<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="Ex12ProjLaz.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
</Unit>
|
||||||
|
<Unit>
|
||||||
|
<Filename Value="Ex12Unit.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
</Unit>
|
||||||
|
<Unit>
|
||||||
|
<Filename Value="..\CommonUtils\MTUtils.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
</Unit>
|
||||||
|
</Units>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="11"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Target>
|
||||||
|
<Filename Value="Ex12ProjLaz"/>
|
||||||
|
</Target>
|
||||||
|
<SearchPaths>
|
||||||
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
|
<OtherUnitFiles Value="..\CommonUtils"/>
|
||||||
|
<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
Ex12/Ex12ProjLaz.lpr
Normal file
24
Ex12/Ex12ProjLaz.lpr
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
program Ex12ProjLaz;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF UNIX}
|
||||||
|
cthreads,
|
||||||
|
{$ENDIF}
|
||||||
|
{$IFDEF HASAMIGA}
|
||||||
|
athreads,
|
||||||
|
{$ENDIF}
|
||||||
|
Interfaces, // this includes the LCL widgetset
|
||||||
|
Forms, Ex12Unit, MTUtils;
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
RequireDerivedFormResource:=True;
|
||||||
|
Application.Scaled:=True;
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
|
|
BIN
Ex12/Ex12ProjLaz.res
Normal file
BIN
Ex12/Ex12ProjLaz.res
Normal file
Binary file not shown.
59
Ex12/Ex12Unit.lfm
Normal file
59
Ex12/Ex12Unit.lfm
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 0
|
||||||
|
Height = 390
|
||||||
|
Top = 0
|
||||||
|
Width = 775
|
||||||
|
Caption = 'Form1'
|
||||||
|
ClientHeight = 390
|
||||||
|
ClientWidth = 775
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -13
|
||||||
|
Font.Name = 'Tahoma'
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
Position = poScreenCenter
|
||||||
|
object labLabLastThreadTime: TLabel
|
||||||
|
Left = 8
|
||||||
|
Height = 16
|
||||||
|
Top = 47
|
||||||
|
Width = 336
|
||||||
|
Caption = 'Информация о времени последнего запущенного потока'
|
||||||
|
end
|
||||||
|
object btnRunInParallelThread: TButton
|
||||||
|
Left = 8
|
||||||
|
Height = 33
|
||||||
|
Top = 8
|
||||||
|
Width = 217
|
||||||
|
Caption = 'Запустить доп. поток'
|
||||||
|
TabOrder = 0
|
||||||
|
OnClick = btnRunInParallelThreadClick
|
||||||
|
end
|
||||||
|
object Button1: TButton
|
||||||
|
Left = 248
|
||||||
|
Height = 33
|
||||||
|
Top = 8
|
||||||
|
Width = 177
|
||||||
|
Caption = 'Остановить потоки'
|
||||||
|
TabOrder = 1
|
||||||
|
OnClick = Button1Click
|
||||||
|
end
|
||||||
|
object ListBox1: TListBox
|
||||||
|
Left = 8
|
||||||
|
Height = 313
|
||||||
|
Top = 69
|
||||||
|
Width = 759
|
||||||
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
|
ItemHeight = 0
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object btnClearListBox: TButton
|
||||||
|
Left = 431
|
||||||
|
Height = 33
|
||||||
|
Top = 8
|
||||||
|
Width = 75
|
||||||
|
Caption = 'Очистить'
|
||||||
|
TabOrder = 3
|
||||||
|
OnClick = btnClearListBoxClick
|
||||||
|
end
|
||||||
|
end
|
@ -1,11 +1,16 @@
|
|||||||
unit Ex12Unit;
|
{$IFDEF FPC}{$CODEPAGE UTF8}{$H+}{$MODE DELPHI}{$ENDIF}
|
||||||
|
unit Ex12Unit;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
{$IFnDEF FPC}
|
||||||
Dialogs, StdCtrls, MTUtils, ComCtrls, ExtCtrls, StrUtils, Contnrs,
|
Windows, Messages,
|
||||||
Generics.Collections;
|
{$ELSE}
|
||||||
|
LCLIntf, LCLType, LMessages,
|
||||||
|
{$ENDIF}
|
||||||
|
SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, MTUtils, ComCtrls,
|
||||||
|
ExtCtrls, StrUtils, Contnrs, Generics.Collections;
|
||||||
|
|
||||||
type
|
type
|
||||||
TMyThread = class(TThread)
|
TMyThread = class(TThread)
|
||||||
@ -37,7 +42,11 @@ var
|
|||||||
Form1: TForm1;
|
Form1: TForm1;
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{$R *.dfm}
|
{$IFnDEF FPC}
|
||||||
|
{$R *.dfm}
|
||||||
|
{$ELSE}
|
||||||
|
{$R *.lfm}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
procedure TForm1.btnClearListBoxClick(Sender: TObject);
|
procedure TForm1.btnClearListBoxClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user