TdxInputQueryValidationProc Type
The procedural type for validation routines used in input query dialogs.
Declaration
TdxInputQueryValidationProc = reference to procedure(ValueIndex: Integer; const Value: string; var IsValid: Boolean);
Parameters
Name | Type | Description |
---|---|---|
ValueIndex | Integer | The index of the currently evaluated string. |
Value | string | The currently evaluated string. |
IsValid | Boolean | If |
Remarks
The following code example demonstrates a validation routine that disables the OK button and ignores the Enter keystroke if at least one of the displayed text editors is empty:
uses
dxInputDialogs; // This unit declares the dxInputQuery function
// ...
procedure TMyForm.ValidationProcedure(ValueIndex: Integer; const Value: string; var IsValid: Boolean);
begin
if Value = '' then // Disables the "OK" button if at least one editor value is an empty string
IsValid := False;
end;
procedure TMyForm.cxButton1Click(Sender: TObject);
var
APrompts, AValues: array of string;
begin
SetLength(APrompts, 2);
SetLength(AValues, 2);
APrompts[0] := 'First Name:';
APrompts[1] := 'Last Name';
dxInputQuery('New User', APrompts, AValues, ValidationProcedure);
end;
Direct TdxInputQueryValidationProc Procedural Type References
The following global methods accept a routine of the TdxInputQueryValidationProc
type as the AValidationProc
parameter:
- dxInputQuery(string,string,string,TdxInputQueryValidationProc)
- Invokes a modal input dialog box that prompts a user to enter a string and checks if the user input is valid.
- dxInputQuery(string,string[],string[],TdxInputQueryValidationProc)
- Invokes an input dialog box that allows users to enter a string.
- dxSelectQuery(string,string,TStrings,string,Boolean,TdxInputQueryValidationProc)
- Invokes a modal input dialog box that allows users to select a value in a combo box.
See Also