8000 GitHub - jfhyn/wait-vcl: Form to wait for VCL projects (Delphi)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ wait-vcl Public
forked from atkins88/wait-vcl

Form to wait for VCL projects (Delphi)

License

Notifications You must be signed in to change notification settings

jfhyn/wait-vcl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Form to wait for VCL projects (Delphi)

Delphi Supported Versions Platforms

This component allows you to create forms of wait with progress bar (optional) in a simple way using threads. The use of the thread causes the application not to be locked during the execution of a process.

Prerequisites

  • [Optional] For ease I recommend using the Boss for installation
    • Boss - Dependency Manager for Delphi
  • BlockUI-VCL - Block User Interface for VCL Projects (Delphi)

Installation using Boss (dependency manager for Delphi applications)

boss install github.com/viniciussanchez/wait-vcl

Manual Installation

Add the following folders to your project, in Project > Options > Resource Compiler > Directories and Conditionals > Include file search path

../wait-vcl/src
../wait-vcl/src/view
../wait-vcl/src/providers

Getting Started

You need to use VCL.Wait

uses VCL.Wait;

Form with progress bar

var
  Waiting: TWait;
begin
  Waiting := TWait.Create('Wait...');
  Waiting.Start(
    procedure
    var
      I: Integer;
    begin
      Waiting.ProgressBar.SetMax(100);
      for I := 1 to 100 do
      begin
        Waiting.SetContent('Wait... ' + I.ToString + ' of 100').ProgressBar.Step();
        Sleep(100); // Your code here!!!
      end;
    end);
end;

wait-vcl

You can increment more than one:

Waiting.ProgressBar.Step(2);

The Start function will create a thread to execute the procedure passed as parameter. Within a thread should not be made interactions with the user! If you need to, use a TThread.Synchronize.

Form without progress bar

begin
  TWait.Create('Wait...').Start(
    procedure
    begin
      Sleep(1500); // Your code here!!!
    end);
end;

wait-vcl

About

Form to wait for VCL projects (Delphi)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Pascal 100.0%
0