[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'InterfaceBase' (#lcl)

TWidgetSet.AskUser

Displays a dialog box with the specified values, and returns the modal result.

Declaration

Source position: lclintfh.inc line 38

public function TWidgetSet.AskUser(

  const DialogCaption: string;

  const DialogMessage: string;

  DialogType: LongInt;

  Buttons: TDialogButtons;

  HelpCtx: LongInt

):LongInt; virtual;

Arguments

DialogCaption

  

Caption for the dialog.

DialogMessage

  

Message text for the dialog.

DialogType

  

Dialog type used to get an icon and flags used the dialog.

Buttons

  

Collection with buttons for the dialog.

HelpCtx

  

Help context used when F1 is pressed in the dialog.

Function result

Modal result value for the dialog as a LongInt type.

Description

AskUser uses the native facilities provided by the platform or operating system to display a dialog, and captures the modal result value. This method is overridden in descendent class to implement the platform-specific dialog.

The implementation in TWidgetSet is used as a fallback when no other mechanism is available. It uses the routine assigned to QuestionDialogFunction to execute the dialog and capture the modal result value. No default actions are performed when QuestionDialogFunction has not been assigned (contains Nil).


Version 4.0 Generated 2025-05-03 Home