Back to Devexpress

TdxHyperlinkMouseHoverEvent Type

vcl-cxcontrols-a66a90b8.md

latest7.4 KB
Original Source

TdxHyperlinkMouseHoverEvent Type

The procedural type for hyperlink mouse hover events in DevExpress controls and their UI elements.

Declaration

delphi
TdxHyperlinkMouseHoverEvent = procedure(Sender: TObject; AArgs: TdxHyperlinkEventArgs) of object;

Parameters

NameTypeDescription
SenderTObject

Provides access to the control or UI element that raised the hyperlink mouse hover event.

Cast this parameter value to the corresponding terminal control or UI element class to access all public API members. Refer to the following section for detailed information on Sender types in different DevExpress products: Accessible Event Parameters.

Tip

You can call the Sender.ClassType function or use any other RTTI functionality to identify the actual control or UI element type.

| | AArgs | TdxHyperlinkEventArgs |

Provides access to information on the hyperlink mouse hover event that occurred in the UI element accessible through the Sender parameter.

For example, you can use AArgs.Text and AArgs.URI properties to identify the target hyperlink’s anchor text and URI.

|

Remarks

You can handle hyperlink mouse hover events to track movements of the mouse pointer between hyperlinks defined in a formatted message, label, or UI element caption in a DevExpress control.

Accessible Event Parameters

The following parameters are accessible within a hyperlink mouse hover event handler:

Sender

Provides access to the control or UI element that raised the hyperlink hover event. The Sender parameter type depends on the class that declares the corresponding mouse hover event (OnHyperlinkMouseEnter or OnHyperlinkMouseLeave):

Formatted Label EditorsThe actual Sender type is TdxFormattedLabel or TdxDBFormattedLabel.Layout ControlSender is a terminal TdxCustomLayoutItem class descendant instance (at the layout item level) or a TdxLayoutControl instance (at the layout control level).AArgs

Provides access to information related to the hyperlink mouse hover event that occurred and allows you to identify the target hyperlink in a formatted message, label, or UI element caption. For example, you can use AArgs.HyperlinkIndex and AArgs.URI properties to identify the hovered hyperlink’s position and target URI.

Refer to the TdxHyperlinkEventArgs class description for detailed information on all options accessible within a hyperlink mouse hover event handler.

The code example in this section demonstrates OnHyperlinkMouseEnter and OnHyperlinkMouseLeave event handlers that update the form caption as the mouse pointer moves between layout item hyperlinks.

The OnHyperlinkMouseEnter event handler displays the target URI of a hyperlink in the form caption when the mouse pointer enters the hyperlink’s area. The OnHyperlinkMouseLeave event handler changes the form caption to a predefined string when the mouse pointer leaves a hyperlink.

Tip

This scenario can be useful if you need to display hyperlink targets without hints (if the CaptionOptions.ShowHyperlinkHint property is set to bFalse, for example).

delphi
procedure TMyForm.dxLayoutControl1Item1HyperlinkMouseEnter(Sender: TObject;
  AArgs: TdxHyperlinkEventArgs); // Displays the hyperlink target in the form caption
begin
  Caption := 'Navigate to ' + AArgs.URI;
end;

procedure TMyForm.dxLayoutControl1Item1HyperlinkMouseLeave(Sender: TObject;
  AArgs: TdxHyperlinkEventArgs); // Displays the predefined string instead of a hyperlink target
begin
  Caption := 'Hyperlink Navigation in Layout Item Captions';
end;
cpp
void __fastcall TMyForm::dxLayoutControl1Item1HyperlinkMouseEnter(TObject *Sender,
  TdxHyperlinkEventArgs *AArgs) // Displays the hyperlink target in the form caption
{
  Caption = "Navigate to " + AArgs->URI;
}

void __fastcall TMyForm::dxLayoutControl1Item1HyperlinkMouseLeave(TObject *Sender,
  TdxHyperlinkEventArgs *AArgs) // Displays the predefined string instead of a hyperlink target
{
  Caption = "Hyperlink Navigation in Layout Item Captions";
}

Direct TdxHyperlinkMouseHoverEvent Type References

The following events reference the TdxHyperlinkMouseHoverEvent procedural type:

TdxCustomFormattedLabelProperties.OnHyperlinkMouseEnterAllows you to execute custom code when the mouse pointer moves into a hyperlink area defined in the formatted label.TdxCustomFormattedLabelProperties.OnHyperlinkMouseLeaveAllows you to execute custom code when the mouse pointer leaves a hyperlink defined in the formatted label.TdxCustomLayoutItem.OnHyperlinkMouseEnterAllows you to execute custom code when the mouse pointer moves into a hyperlink area within the layout item’s caption.TdxCustomLayoutItem.OnHyperlinkMouseLeaveAllows you to execute custom code when the mouse pointer leaves a hyperlink within the layout item’s caption.TdxCustomLayoutControl.OnHyperlinkMouseEnterAllows you to execute custom code when the mouse pointer moves into a hyperlink area within a layout item caption.TdxCustomLayoutControl.OnHyperlinkMouseLeaveAllows you to execute custom code when the mouse pointer leaves a hyperlink within a layout item caption. See Also

TdxHyperlinkClickEvent Procedural Type

TdxShowHyperlinkHintEvent Procedural Type

BBCode-Inspired Text Formatting Markup

cxControls Unit