Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

smart_dialogs

A Lazarus package with custom dialogs

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

smart_dialogs

Description

This is a documentation of the smart_dialogs project, a Lazarus package with UI components.

Project statatistics

  • Lines of code: 2.871
  • Files: 16
  • Folders: 7
  • Screens: 3
  • Dependencies: 3
  • Average lines per file: 180

Steps to add package in your project

In lazarus IDE go to Package -> Open package file (.lpk) and select the SmartDialogs.lpk file, after this, Use -> Add to project and after Use -> Install

SimpleDialog

To use SimpleDialog, call the Show() function.

Example Code

object
SimpleDialog.Show('System info message here', TTypeMessage.tmInfo);

ConfirmationDialog

To use ConfirmationDialog, call the Show() function, which returns a Boolean value.

Example Code

object
if ConfirmationDialog.Show(
  'Do you really want to perform this operation ?', 
  TTypeMessage.tmQuestion) then
begin
  // make something here
end;

LoaderDialog

The LoaderDialog component includes a property called SlowProcess. This property is responsible for handling slow tasks while keeping the loader visible, ensuring a smooth user experience during long-running processes.

The SlowProcess property should be assigned to a procedure that contains the task to be executed. Below is an example demonstrating how to link a slow task to the LoaderDialog and display it while the task is being processed.

Example Code

object
procedure TForm1.Button1Click(Sender: TObject);
begin
  // Assign the slow process to the LoaderDialog
  LoaderDialog1.SlowProcess := @SampleSlowProcess;

  // Show the LoaderDialog while the process is running
  LoaderDialog1.Show('Loading...');
end;

procedure TForm1.SampleSlowProcess;
begin  
  Sleep(4000);
end;

BackgroundFullScreen

To use BackgroundFullScreen, call the PushBackground() procedure, and after to close call the PopBackground() procedure.

Example Code

object
TSDBackgroundManager.PushBackground(SampleForm, False);

// Show another modal form here
SampleForm.ShowModal;

TSDBackgroundManager.PopBackground;