Skip to main content

TcxEditRepositoryHyperLinkItem Class

Declaration

TcxEditRepositoryHyperLinkItem = class(
    TcxEditRepositoryItem
)

Remarks

A hyperlink editor is a single-line text editor that displays content as a hyperlink. The editor can invoke the default system web browser to open a hyperlink when a user clicks it.

VCL Editors Library: A Hyperlink Editor Example

The TcxEditRepositoryHyperLinkItem class overrides the Properties property that allows you to access and customize hyperlink editor settings.

Edit Repository Items and Standalone Editors

Edit repository items are useful when you need to share the same settings between multiple editors of the same type. To accomplish this goal, you can assign the same edit repository item to RepositoryItem properties of all target editors.

Edit Repository Items and Container Controls

A container control item (such as a toolbar edit item or a column (or any other data item) in a Data Grid, Vertical Grid, or Tree List control) can embed an in-place editor shipped with the ExpressEditors Library. An in-place editor exists (and, therefore, has its own WinAPI handle) only when the target container control item is being edited. Otherwise, the container control item displays a static editor image for resource usage optimization.

VCL Tree List: An In-Place Date Editor

To create a hyperlink editor repository item at design time, double-click an edit repository component to invoke its collection editor.

VCL Editors Library: An Edit Repository Collection Editor

The collection editor allows you to manage repository items. Click the Add… button to invoke a repository item creation dialog.

VCL Editors Library: An Edit Repository Item Creation Dialog

Select the HyperLink item and click the Ok button to create a hyperlink editor repository item.

The following code example creates a hyperlink editor repository item, customizes editor settings, and assigns the created repository item to two existing unbound hyperlink editors:

uses cxEdit, cxEditRepositoryItems;
// ...
var
  AHyperLinkRepositoryItem: TcxEditRepositoryHyperLinkItem;
  ARepositoryItem: TcxEditRepositoryItem;
begin
  ARepositoryItem := cxEditRepository1.CreateItem(TcxEditRepositoryHyperLinkItem);
  AHyperLinkRepositoryItem := ARepositoryItem as TcxEditRepositoryHyperLinkItem;
  AHyperLinkRepositoryItem.Properties.LinkColor := clMoneyGreen; // Changes the hyperlink color
  AHyperLinkRepositoryItem.Properties.SingleClick := True; // Opens a link in response to a single click on it
  // Assigns the created repository item to two existing unbound hyperlink editors
  cxHyperLinkEdit1.RepositoryItem := AHyperLinkRepositoryItem;
  cxHyperLinkEdit2.RepositoryItem := AHyperLinkRepositoryItem;
end;

To delete all hyperlink editor repository items in a TcxEditRepository component, call its RemoveItems procedure and pass a reference to the TcxEditRepositoryHyperLinkItem class as a parameter.

If you need to delete an individual hyperlink editor repository item, release it directly in code (call the Free procedure in Delphi or use the delete keyword in C++Builder).

Inheritance

See Also