vcl-dxmessagedialog-22ffed23.md
The procedural type for a hyperlink hint display handler in a message dialog.
TdxMessageDialogShowHyperlinkHintDelegate = reference to procedure(AArgs: TdxShowHyperlinkHintEventArgs);
| Name | Type | Description |
|---|---|---|
| AArgs | TdxShowHyperlinkHintEventArgs |
Stores information related to a hyperlink hint display event in a DevExpress control or its UI element.
|
A hyperlink defined as a part of formatted text in a message box dialog displays the target URI in a hint when the mouse pointer hovers over the hyperlink.
You can implement a handler of the TdxMessageDialogShowHyperlinkHintDelegate type and pass it as the AShowHyperlinkHintProc parameter of any message box creation method to change hint content.
The code example in this section demonstrates TdxMessageDialogHyperlinkClickDelegate and TdxMessageDialogShowHyperlinkHintDelegate handlers. The TdxMessageDialogHyperlinkClickDelegate handler requires a user to hold down the Ctrl key to activate a hyperlink. The TdxMessageDialogShowHyperlinkHintDelegate handler changes all hyperlink hints to prompt a user to hold the Ctrl key for hyperlink activation.
procedure TMyForm.LinkClickHandler(AArgs: TdxHyperlinkClickEventArgs);
begin
if AArgs.Shift <> [ssCtrl] then // If the Ctrl key is not held down
AArgs.Handled := True; // Prevents hyperlink activation
end;
procedure TMyForm.LinkHintHandler(AArgs: TdxShowHyperlinkHintEventArgs);
var
AHintPrefix, AHintURI: string;
begin
AHintPrefix := 'Ctrl-click to navigate to ';
AHintURI := AArgs.URI.Remove(0, 8); // Removes the URI scheme from the hyperlink hint
AArgs.Hint := AHintPrefix + AHintURI; // Redefines the hyperlink hint
end;
// This procedure displays a message box with dynamic content and prevents MAILTO links from being opened
procedure TMyForm.ShowMyMessage(const AMessage: string; const ALink: string);
begin
dxCreateMessageDialog(AMessage + #13#10 + ' [URL=' + ALink + ']' + ALink + '[/URL]',
LinkClickHandler, LinkHintHandler);
end;
void __fastcall TMyForm::LinkClickHandler(TdxHyperlinkClickEventArgs *AArgs)
{
if(AArgs->Shift != (TShiftState() << [ssCtrl])) // If the Ctrl key is not held down
AArgs->Handled = true; // Prevents hyperlink activation
}
void __fastcall TMyForm::LinkHintHandler(TdxShowHyperlinkHintEventArgs *AArgs)
{
UnicodeString AHintPrefix, AHintURI;
AHintPrefix = "Ctrl-click to navigate to ";
AHintURI = AArgs->URI.Remove(0, 8); // Removes the URI scheme from the hyperlink hint
AArgs->Hint = AHintPrefix + AHintURI; // Redefines the hyperlink hint
}
// This procedure displays a message box with dynamic content and prevents MAILTO links from being opened
void __fastcall TMyForm::ShowMyMessage(const UnicodeString &AMessage, const UnicodeString &ALink)
{
dxCreateMessageDialog(AMessage + "\n" + " [URL=" + ALink + "]" + ALink + "[/URL]",
LinkClickHandler, LinkHintHandler);
}
The following global methods reference the TdxMessageDialogShowHyperlinkHintDelegate procedural type as the AShowHyperlinkHintProc parameter:
dxCreateMessageDialog(string,TMsgDlgType,TMsgDlgButtons,TMsgDlgBtn,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Creates a message dialog box with a specified dialog type and message. Allows you to specify a set of buttons and move focus to one of the buttons.dxCreateMessageDialog(string,TMsgDlgType,TMsgDlgButtons,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Creates a message dialog box with a specified dialog type, message, and a set of buttons.
dxMessageBox(THandle,string,string,Integer,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Opens a message dialog box that displays a specified message, title, and buttons (configured using a combination of flags). Allows you to associate the message box with an owner window.dxMessageBox(string,string,Integer,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Opens a message dialog box that displays a specified message, title, and buttons (configured using a combination of flags).
dxMessageDlg(string,TMsgDlgType,TMsgDlgButtons,Longint,TMsgDlgBtn,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Opens a message dialog box with a specified dialog type, message, and a set of buttons (and allows you to specify the default button).dxMessageDlg(string,TMsgDlgType,TMsgDlgButtons,Longint,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Opens a message dialog box with a specified dialog type, message, and a set of buttons.
dxMessageDlgPos(string,TMsgDlgType,TMsgDlgButtons,Longint,Integer,Integer,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Opens a message dialog box at a specified position on the screen.dxMessageDlgPos(string,TMsgDlgType,TMsgDlgButtons,Longint,Integer,Integer,TMsgDlgBtn,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Opens a message dialog box at a specified position on the screen. Allows you to specify the default button.
dxMessageDlgPosHelp(string,TMsgDlgType,TMsgDlgButtons,Longint,Integer,Integer,string,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Opens a message dialog box associated with a help topic and positions the dialog box at specific screen coordinates.dxMessageDlgPosHelp(string,TMsgDlgType,TMsgDlgButtons,Longint,Integer,Integer,string,TMsgDlgBtn,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Opens a message dialog box associated with a help topic and positions the dialog box at specific screen coordinates. Allows you to specify the default button.
dxShowMessage(string,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Opens a generic message dialog box with an OK button.dxShowMessageFmt(string,Untyped[],TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Opens a generic message dialog box with a formatted message and an OK button.dxShowMessagePos(string,Integer,Integer,TdxMessageDialogHyperlinkClickDelegate,TdxMessageDialogShowHyperlinkHintDelegate)Opens a generic message dialog box at a specified position on the screen. See Also
TdxMessageDialogHyperlinkClickDelegate Procedural Type