Simple Local Language Dialogs

PopupMessage

The
PopupMessage
procedure displays a simple popup message to the user.
The message can be shown with an optional title and language preference.
procedure PopupMessage(Text: String; Title: String = ''; English: Boolean = False);

Parameters

  • Text: String; The message content to be displayed.
  • Title: String; The title of the popup window (default is empty).
  • English: Boolean; If `True`, the message is displayed in English, regardless of system language.

YesNoDialog

The
YesNoDialog
function displays a confirmation dialog with "Yes" and "No" options.
It can include a title and an optional help URL for further information.
function YesNoDialog(Content: String; Title: String = ''; English: Boolean = False; HelpURL: String = ''): Boolean;

Parameters

  • Content: String; The main message of the dialog.
  • Title: String; The title of the dialog (default is empty).
  • English: Boolean; If `True`, forces the dialog to be shown in English.
  • HelpURL: String; An optional URL to provide help information.

Return Value

Returns `True` if the user selects "Yes".
Returns `False` otherwise.

DeleteDialog

The
DeleteDialog
function displays a confirmation dialog when deleting an item.
function DeleteDialog(Subject: String): Boolean;

Parameters

  • Subject: String; The name of the item to be deleted.

Return Value

Returns `True` if the user confirms deletion.
Returns `False` otherwise.

ModifiedWarningDialog

The
ModifiedWarningDialog
function warns the user about unsaved modifications.
function ModifiedWarningDialog: Boolean;

Return Value

Returns `True` if the user confirms they want to proceed without saving changes.
Returns `False` otherwise.

ModifiedSaveNowDialog

The
ModifiedSaveNowDialog
function prompts the user to save modifications before exiting.
function ModifiedSaveNowDialog: Boolean;

Return Value

Returns `True` if the user agrees to save changes.
Returns `False` if the user chooses not to save.

ColorDialog

The
ColorDialog
function opens a color selection dialog to allow users to choose a color.
function ColorDialog(VAR Color: TColor; Parent: TWinControl = NIL): Boolean;

Parameters

  • Color: TColor; The initial color and output for the selected color.
  • Parent: TWinControl; The parent control of the dialog (default is `NIL`).

Return Value

Returns `True` if the user selects a color.
Returns `False` if the user cancels the selection.

SelectFolder

The
SelectFolder
function opens a dialog for the user to select a directory.
It allows for an optional description and can be tied to a specific window handle.
function SelectFolder(VAR Directory: String; Note: String = ''; Handle: Cardinal = 0): Boolean;

Parameters

  • Directory: String; The variable to store the selected folder path.
  • Note: String; An optional message to display in the dialog.
  • Handle: Cardinal; The window handle of the parent application.

Return Value

Returns `True` if the user selected a folder.
Returns `False` if the dialog was canceled.

OpenFileDialog

The
OpenFileDialog
function opens a file selection dialog for the user to choose one or more files.
It supports filtering by file extension, setting an initial directory, and including hidden files.
function OpenFileDialog(Caption, ExtList, Path: String; Include_Hidden: Boolean; VAR FileName: String;
                         Multi_Select: Boolean = False): Boolean;

Parameters

  • Caption: String; The title of the dialog.
  • ExtList: String; A list of allowed file extensions.
  • Path: String; The initial directory for the file dialog.
  • Include_Hidden: Boolean; If `True`, hidden files will be included.
  • FileName: String; The variable to store the selected file path.
  • Multi_Select: Boolean; If `True`, allows multiple file selection.

Return Value

Returns `True` if the user selected a file.
Returns `False` if the dialog was canceled.

SaveFileDialog

The
SaveFileDialog
function opens a dialog for the user to specify a file path for saving.
It supports filtering by file extension and setting an initial directory.
function SaveFileDialog(Caption, FileExt, Path: String; Include_Hidden: Boolean; VAR FileName: String): Boolean;

Parameters

  • Caption: String; The title of the dialog.
  • FileExt: String; The default file extension.
  • Path: String; The initial directory for the file dialog.
  • Include_Hidden: Boolean; If `True`, hidden files will be included.
  • FileName: String; The variable to store the selected file path.

Return Value

Returns `True` if the user specified a file name.
Returns `False` if the dialog was canceled.

Prevent_Override_Dialog

The
Prevent_Override_Dialog
function prompts the user with a warning before overwriting an existing file.
function Prevent_Override_Dialog(Full_FN: String): String;

Parameters

  • Full_FN: String; The full file name to check before overwriting.

Return Value

Returns the confirmed file path if the user chooses to proceed.
Returns an empty string if the user cancels the overwrite action.

Debug_Write_Log

The
Debug_Write_Log
procedure writes debugging messages to the log file.
It is intended for use in design mode for tracking component activity.
procedure Debug_Write_Log(Subject: TComponent; _Message: String);

Parameters

  • Subject: TComponent; The component associated with the debug message.
  • _Message: String; The debug message to write.
The message is logged to the application’s debug log file.