Skip to main content

In-place Editors

  • 2 minutes to read

The ExpressBars Suite allows you to incorporate unbound editors into toolbars and menus. It includes several built-in toolbar editors, and additionally provides a specially designed editor container bar item (TcxBarEditItem). This item can contain editors supplied by the ExpressEditors Library, as well as their descendants.

Unlike standard bar edit items, a TcxBarEditItem allows you to apply a paint style to its underlying in-place editor (font, text color, and background color). Refer to the Editor Style and StyleControllers topic to learn more.

The following image shows a bar containing three bar edit items.

There are two ways to embed ExpressEditors into toolbars:

  • Specify the editor type via the TcxBarEditItem properties.

  • Use repository items.

Specify the Editor Type

At design time, you can embed ExpressEditors into toolbars using the toolbar context menu. The following methods can be used:

  • Select Add cxEditItem and choose the editor type from the submenu;

  • Select Add Item | TcxBarEditItem and then specify the editor type using the item’s Properties property.

At runtime, the editor type can be specified via the bar item’s PropertiesClass or PropertiesClassName property. You can then access the editor’s settings via the item’s Properties property.

The following example shows how to display a text editor within a TcxBarEditItem and make it read-only.

// ...
uses
  cxTextEdit;
// ...
  cxBarEditItem.PropertiesClassName := 'TcxTextEditProperties';
  TcxTextEditProperties(cxBarEditItem.Properties).ReadOnly := True;

Use Repository Items

A TcxBarEditItem can be bound to an editor stored in an edit repository. To do this, use the RepositoryItem property.

See Also