Стартовый пул
This commit is contained in:
59
ANB ST CP/Demo/WaitDemo/sources/data/MainForm.lfm
Normal file
59
ANB ST CP/Demo/WaitDemo/sources/data/MainForm.lfm
Normal file
@@ -0,0 +1,59 @@
|
||||
object MainFrm: TMainFrm
|
||||
Left = 301
|
||||
Height = 154
|
||||
Top = 148
|
||||
Width = 397
|
||||
BorderIcons = [biSystemMenu]
|
||||
BorderStyle = bsSingle
|
||||
Caption = 'Wait DEMO'
|
||||
ClientHeight = 154
|
||||
ClientWidth = 397
|
||||
Font.CharSet = RUSSIAN_CHARSET
|
||||
Font.Color = clBlack
|
||||
Font.Height = -15
|
||||
Font.Name = 'Times New Roman'
|
||||
Font.Pitch = fpVariable
|
||||
Font.Quality = fqDraft
|
||||
LCLVersion = '1.6.0.4'
|
||||
object WaitingIntro: TLabel
|
||||
Left = 10
|
||||
Height = 17
|
||||
Top = 10
|
||||
Width = 377
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 10
|
||||
Caption = '&We waiting (sec):'
|
||||
ParentColor = False
|
||||
end
|
||||
object WaitingSec: TLabel
|
||||
Left = 10
|
||||
Height = 72
|
||||
Top = 37
|
||||
Width = 377
|
||||
Align = alClient
|
||||
Alignment = taCenter
|
||||
BorderSpacing.Around = 10
|
||||
Caption = '&Press "wait 5 sec"...'
|
||||
Font.CharSet = ANSI_CHARSET
|
||||
Font.Color = clBlack
|
||||
Font.Height = -15
|
||||
Font.Name = 'Old English Text MT'
|
||||
Font.Pitch = fpVariable
|
||||
Font.Quality = fqDraft
|
||||
Font.Style = [fsBold]
|
||||
Layout = tlCenter
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object WaitBtn: TButton
|
||||
Left = 10
|
||||
Height = 25
|
||||
Top = 119
|
||||
Width = 377
|
||||
Align = alBottom
|
||||
BorderSpacing.Around = 10
|
||||
Caption = '&Wait 5 sec'
|
||||
OnClick = WaitBtnClick
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
41
ANB ST CP/Demo/WaitDemo/sources/data/MainForm.pas
Normal file
41
ANB ST CP/Demo/WaitDemo/sources/data/MainForm.pas
Normal file
@@ -0,0 +1,41 @@
|
||||
unit MainForm;
|
||||
{$mode delphi}
|
||||
{$codepage UTF8}
|
||||
interface
|
||||
uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, VCLEx;
|
||||
type
|
||||
{ TMainFrm }
|
||||
TMainFrm = class(TForm)
|
||||
WaitBtn: TButton;
|
||||
WaitingSec: TLabel;
|
||||
WaitingIntro: TLabel;
|
||||
procedure WaitBtnClick(Sender: TObject);
|
||||
private
|
||||
public
|
||||
CurWait, OldS, NewS: Int64;
|
||||
end;
|
||||
var
|
||||
MainFrm: TMainFrm;
|
||||
implementation
|
||||
{$R *.lfm}
|
||||
{ TMainFrm }
|
||||
procedure TMainFrm.WaitBtnClick(Sender: TObject);
|
||||
procedure OnWait;
|
||||
begin
|
||||
MainFrm.CurWait:= MainFrm.CurWait + 1;
|
||||
MainFrm.NewS:= MainFrm.CurWait div 1000;
|
||||
if MainFrm.NewS > MainFrm.OldS then
|
||||
begin
|
||||
MainFrm.WaitingSec.Caption:= IntToStr(MainFrm.NewS);
|
||||
MainFrm.OldS:= MainFrm.NewS;
|
||||
end;
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
begin
|
||||
OldS:= 0;
|
||||
CurWait:= 0;
|
||||
WaitingSec.Caption:= '0';
|
||||
WaitEx(5000, @OnWait);
|
||||
WaitingSec.Caption:= '&Stoped...';
|
||||
end;
|
||||
end.
|
Reference in New Issue
Block a user