Sign in Join
FPDoc Onlineexperiment

TValueListEditor.GetDefaultEditor function

Member of TValueListEditorprotectedIn unit ValEdit

Gets the editor control for the specified column number.

Declaration

pascal
function GetDefaultEditor(Column: Integer): TWinControl; override

Arguments

Column

Column number for the editor control.

Function result

Editor control for the specified column number.

Description

GetDefaultEditor is a TWinControl function used to get the editor control for the specified column number. The return value is the TWinControl used as the editor for the cell in the specified column number.

GetDefaultEditor saves the current contents in Cells for the selected Row number to allow use of RestoreCurrentRow. GetDefaultEditor calls the inherited method to enable the logic implemented in the ancestor class.

KeyOptions is used to determine if the VK_Delete key needs to be be handled in the editor control. EditorOptions is updated to include or exclude the value EO_HOOKKEYDOWN based on the presence of KeyDelete in KeyOptions.

When Column contains 1 (the Value column), the item definition in ItemProps is used to configure the default editor. Its EditStyle is applied by calling the EditorByStyle method. For a PickList-style editor, pick list values in the item definition are assigned to the combo-box editor control and its drop-down row count is set to the value in DropDownRows. The OnGetPickList event handler is signalled (when assigned) to get user-defined values in the editor control. The read-only status for the editor is updated to reflect the value in the item definition.

When Column contains 0 (the Key column), the editor is marked as read-only when KeyOptions does not include the value KeyEdit.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.