[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'ValEdit' (#lcl)

TValueListEditor

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

A visual grid control for editing Key-Value pairs.

Declaration

Source position: valedit.pas line 120

type TValueListEditor = class(TCustomStringGrid)

protected

  class procedure WSRegisterClass; override;

  

Registers the class type for the widget set.

  procedure SetFixedCols(); override;

  

Sets the value for the FixedCols property.

  procedure ShowColumnTitles;

  

Assigns and displays the column titles for the Key and Value columns.

  procedure AdjustRowCount; virtual;

  

Sets the number of visible rows for the control.

  procedure ColRowExchanged(); override;

  

Exchanges row values at the specified positions.

  procedure ColRowDeleted(); override;

  

Performs actions needed when a row is deleted in the control.

  procedure DefineCellsProperty(); override;

  

Not used in the current implementation.

  procedure InvalidateCachedRow;

  

Resets the last edited row number for the control.

  procedure GetAutoFillColumnInfo(); override;

  

Gets the display priority for an auto-fill column.

  function GetEditText(); override;

  

Gets the value used in the editor for the specified cell.

  function GetCells(); override;

  

Gets the value in Cells at the specified row and column numbers.

  function GetDefaultEditor(); override;

  

Gets the editor control for the specified column number.

  function GetRowCount;

  

Gets the value for the RowCount property.

  procedure KeyDown(); override;

  

Provides support for special keys used in the control.

  procedure KeyPress(); override;

  

Handles special key presses for the control.

  procedure LoadContent(); override;

  

Loads configuration and content from the specified XML configuration file.

  procedure ResetDefaultColWidths; override;

  

Resets grid columns to their default widths.

  procedure SaveContent(); override;

  

Saves configuration and content in the control to the specified XML configuration file.

  procedure SetCells(); override;

  

Sets the value in the Cells property at the specified position.

  procedure SetColCount(); override;

  

Sets the value for the ColCount property.

  procedure SetEditText(); override;

  

Sets the cell value at the specified position.

  procedure SetFixedRows(); override;

  

Sets the value in the FixedRows property.

  procedure SetRowCount();

  

Sets the value in the RowCount property.

  procedure Sort();

  

Sorts column values in the control.

  procedure TitlesChanged();

  

Event handler signalled when TitleCaptions is changed.

  function ValidateEntry(); override;

  

Validates data entered in a cell in the control.

public

  constructor Create(); override;

  

Constructor for the class instance.

  destructor Destroy; override;

  

Destructor for the class instance.

  procedure Clear;

  

Removes the content in the control.

  procedure DeleteColRow();

  

Deletes the column or row at the specified position.

  procedure DeleteRow(); override;

  

Deletes the row at the specified position.

  procedure DeleteCol(); override;

  

Prevents column deletion in control.

  function FindRow();

  

Locates the row with the specified Key name.

  procedure InsertColRow();

  

Inserts a column or a row at the specified position.

  function InsertRow();

  

Inserts a row at the specified position.

  procedure InsertRowWithValues();

  

Inserts a row with the specified values at the specified position.

  procedure ExchangeColRow(); override;

  

Swaps the columns or rows at the specified positions.

  function IsEmptyRow();

  

Indicates if the specified row is empty.

  procedure LoadFromCSVStream(); override;

  

Loads the content for the control from the comma-separated values in the specified stream.

  procedure MoveColRow();

  

Moves the specified column or row to the new position.

  function RestoreCurrentRow;

  

Restores pre-editing values in the current row.

  property Modified: Boolean;

  

Indicates if changes have been made to items in the control.

  property Keys []: string; [rw]

  

Provides indexed access to Key names in the control.

  property Values []: string; [rw]

  

Provides indexed access to Values stored in the control.

  property ItemProps []: TItemProp; [rw]

  

Provides indexed access to item definitions in the control.

published

  property Align: TAlign;

  

Specifies the placement of the control on its Parent control.

  property AlternateColor: TColor;

  

Color used for the background in alternate rows in the grid.

  property Anchors: TAnchors;

  

The set of anchor definitions for this control.

  property AutoAdvance: TAutoAdvance;

  

Direction used when automatically moving the selection to the next selectable cell.

  property AutoEdit: Boolean;

  

Indicates if edit mode is automatically entered when a cell is selected.

  property BiDiMode: TBiDiMode;

  

Indicates whether text controls use in bi-directional reading.

  property BorderSpacing: TControlBorderSpacing;

  

Determines the inner and outer border spacing for this control.

  property BorderStyle: TBorderStyle;

  

Indicates the border style displayed around the control.

  property Color: TColor;

  

The background color for the control.

  property Constraints: TSizeConstraints;

  

Contains the minimum and maximum Width and Height for the control.

  property DefaultColWidth: Integer;

  

Default width used for grid columns.

  property DefaultDrawing: Boolean;

  

Indicates if the default drawing mechanism is used to draw the background and text for cells.

  property DefaultRowHeight: Integer;

  

Default row height for newly created grid rows.

  property DragCursor: TCursor;

  

The cursor shape shown during a drag operation.

  property DragKind: TDragKind;

  

Indicates the action performed for a drag operation: drag-and-drop or drag-and-dock.

  property DragMode: TDragMode;

  

Determines how a drag operation is started for the control.

  property Enabled: Boolean;

  

Determines whether the control responds to mouse or keyboard input.

  property ExtendedSelect: Boolean;

  

Indicates whether a selection can extend beyond the visible boundary for the grid.

  property FixedColor: TColor;

  

The color used for the fixed cells in the grid.

  property FixedCols: Integer;

  

The number of fixed columns in the grid.

  property Flat: Boolean;

  

Indicates if cells are displayed using a Flat appearance.

  property Font: TFont;

  

The font to be used for text display in this control.

  property GridLineWidth: Integer;

  

Width (thickness) for grid lines drawn on the control.

  property HeaderHotZones: TGridZoneSet;

  

Contains the grid zones which are hot-lighted (hovered) on the control.

  property HeaderPushZones: TGridZoneSet;

  

Contains the grid zones which are drawn in a "pushed" state on the control.

  property MouseWheelOption: TMouseWheelOption;

  

Sets the mouse wheel behavior for the grid control.

  property ParentBiDiMode: Boolean;

  

Indicates whether the BiDiMode settings in the Parent control are used.

  property ParentColor: Boolean;

  

Uses the Color from the Parent control, when enabled.

  property ParentFont: Boolean;

  

Indicates if the Font from the Parent control is used in the control.

  property ParentShowHint: Boolean;

  

If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.

  property PopupMenu: TPopupMenu;

  

A context-sensitive menu that pops up when the right mouse button is clicked over this control.

  property RowCount: Integer; [rw]

  

Gets the number of rows for the control.

  property ScrollBars: TScrollStyle;

  

Scrollbars displayed for the grid control.

  property ShowHint: Boolean;

  

Enables Hint display for the control.

  property TabOrder: TTabOrder;

  

Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key.

  property TabStop: Boolean;

  

Allows the user to navigate to / from the control by pressing the Tab or Shift+Tab keys.

  property TitleFont: TFont;

  

The font used for text in a column title.

  property TitleImageList: TImageList;

  

The list with images displayed in column titles.

  property TitleStyle: TTitleStyle;

  

The drawing style used for the fixed column titles.

  property UseXORFeatures: Boolean;

  

When True, the dotted focus rectangle is painted using an XOR raster operation.

  property Visible: Boolean;

  

Allows the control, and all of its children, to be displayed or hidden.

  property VisibleColCount: Integer;

  

The number of visible columns in the grid control.

  property VisibleRowCount: Integer;

  

The number of visible rows in the grid control.

  property OnBeforeSelection: TOnSelectEvent;

  

Event handler signalled before changing the Selection in the grid control.

  property OnButtonClick: TOnSelectEvent;

  

Event handler signalled when a button-style cell Editor control is clicked.

  property OnChangeBounds: TNotifyEvent;

  

Event handler signalled when the Bounds for the control have been changed.

  property OnCheckboxToggled: TToggledCheckboxEvent;

  

Event handler signalled when the value for a check box cell is toggled.

  property OnClick: TNotifyEvent;

  

Notification handler for mouse clicks.

  property OnColRowDeleted: TGridOperationEvent;

  

Event handler signalled when a grid column or row is deleted.

  property OnColRowExchanged: TGridOperationEvent;

  

Event handler signalled when a column or row has been exchanged with another.

  property OnColRowInserted: TGridOperationEvent;

  

Event handler signalled when a column or row is inserted into the grid.

  property OnColRowMoved: TGridOperationEvent;

  

Event handler signalled when a column or row in the grid is moved.

  property OnCompareCells: TOnCompareCells;

  

Event handler signalled to compare the content in cells

  property OnContextPopup: TContextPopupEvent;

  

Invoked when a context-sensitive pop-up menu is requested.

  property OnDragDrop: TDragDropEvent;

  

Event handler signalled when an object is dropped onto the control.

  property OnDragOver: TDragOverEvent;

  

Event handler signalled when a control is dragged over the control instance.

  property OnDblClick: TNotifyEvent;

  

Event handler signalled when a mouse double click occurs in the control.

  property OnDrawCell: TOnDrawCell;

  

Event handler signalled to draw a cell in the grid control.

  property OnEditButtonClick: TNotifyEvent; deprecated ;

  

Deprecated.

  property OnEditingDone: TNotifyEvent;

  

Event handler signalled when editing is completed for the control.

  property OnEndDock: TEndDragEvent;

  

Event handler signalled for the end of a drag-dock operation.

  property OnEndDrag: TEndDragEvent;

  

Event handler signalled for the end of a drag-drop operation.

  property OnEnter: TNotifyEvent;

  

Event handler signalled when the control receives focus.

  property OnExit: TNotifyEvent;

  

Event handler signalled when the control loses focus.

  property OnGetEditMask: TGetEditEvent;

  

Event handler signalled to get the edit mask used for a grid cell.

  property OnGetEditText: TGetEditEvent;

  

Event handler signalled to get the value for a cell editor in the grid.

  property OnHeaderClick: THdrEvent;

  

Event handler signalled when the fixed header for a column or row is clicked.

  property OnHeaderSized: THdrEvent;

  

Event handler signalled when a column or row header has been resized.

  property OnHeaderSizing: THeaderSizingEvent;

  

Event handler signalled when a column or row header sizing action is started.

  property OnKeyDown: TKeyEvent;

  

Event handler signalled for key down keyboard events.

  property OnKeyPress: TKeyPressEvent;

  

Event handler signalled for character data entered by the user.

  property OnKeyUp: TKeyEvent;

  

Event handler signalled when a key up event has occurred for the control.

  property OnMouseDown: TMouseEvent;

  

Event handler signalled when a mouse down event is handled for the control.

  property OnMouseEnter: TNotifyEvent;

  

Event handler signalled when the mouse pointer has entered the control.

  property OnMouseLeave: TNotifyEvent;

  

Event handler signalled when the mouse pointer has left the control.

  property OnMouseMove: TMouseMoveEvent;

  

Event handler signalled when the mouse pointer is moved in the control.

  property OnMouseUp: TMouseEvent;

  

Event handler signalled when a mouse up event is handled for the control.

  property OnMouseWheel: TMouseWheelEvent;

  

Event handler for mouse wheel turned.

  property OnMouseWheelDown: TMouseWheelUpDownEvent;

  

Event handler signalled for a downward movement of the mouse wheel.

  property OnMouseWheelUp: TMouseWheelUpDownEvent;

  

Event handler signalled for an upward movement of the mouse wheel.

  property OnMouseWheelHorz: TMouseWheelEvent;

  

Event handler signalled for a horizontal movement of the mouse wheel.

  property OnMouseWheelLeft: TMouseWheelUpDownEvent;

  

Event handler signalled for a leftward movement of the mouse wheel.

  property OnMouseWheelRight: TMouseWheelUpDownEvent;

  

Event handler signalled for a rightward movement of the mouse wheel.

  property OnPickListSelect: TNotifyEvent;

  

Event handler signalled when an item is selected from a pick list-style Editor control.

  property OnPrepareCanvas: TOnPrepareCanvasEvent;

  

Event handler signalled to prepare the Canvas to draw the grid.

  property OnResize: TNotifyEvent;

  

Notification handler for a resize of the control.

  property OnSelectEditor: TSelectEditorEvent;

  

Event handler signalled to select an Editor control for the current grid cell.

  property OnSelection: TOnSelectEvent;

  

Event handler signalled when an area is selected in the grid control.

  property OnSelectCell: TOnSelectCellEvent;

  

Event handler signalled when a grid cell is selected.

  property OnSetEditText: TSetEditEvent;

  

Event handler signalled when the text in the cell Editor is assigned.

  property OnShowHint: TControlShowHintEvent;

  

Event handler signalled when a hint window is displayed for the control.

  property OnStartDock: TStartDockEvent;

  

Event handler for the start of a docking operation.

  property OnStartDrag: TStartDragEvent;

  

Event handler signalled for the start of a dragging operation.

  property OnTopLeftChanged: TNotifyEvent;

  

Event handler signalled when the top left cell in the visible area of the control is changed.

  property OnUserCheckboxBitmap: TUserCheckBoxBitmapEvent;

  

Event handler signalled to get the user-defined bitmap used for a check box cell.

  property OnUTF8KeyPress: TUTF8KeyPressEvent;

  

Handler for a character entered by the user.

  property OnValidateEntry: TValidateEntryEvent;

  

Event handler signalled to perform validation for a cell value.

  property DisplayOptions: TDisplayOptions; [rw]

  

Enables or disables display features and behaviors in the control.

  property DoubleBuffered: Boolean;

  

When enabled, it reduces flicker when the control is painted.

  property DropDownRows: Integer; [rw]

  

Number of rows displayed for an item with a PickList editor style.

  property KeyOptions: TKeyOptions; [rw]

  

Controls actions that can be performed for Keys in the control.

  property Options: TGridOptions; [rw]

  

Specifies the options enabled for the Key-Value grid.

  property Strings: TValueListStrings; [rw]

  

Stores the keys, values, and item definitions in the control.

  property TitleCaptions: TStrings; [rw]

  

Title captions used for columns in the control.

  property OnGetPickList: TGetPickListEvent; [rw]

  

Event handler signalled to load values for the PickList in an item.

  property OnStringsChange: TNotifyEvent; [rw]

  

Event handler signalled when values in the Strings property are changed.

  property OnStringsChanging: TNotifyEvent; [rw]

  

Event handler signalled prior to updating the Strings property.

  property OnValidate: TOnValidateEvent; [rw]

  

Not used in the current implementation.

end;

Inheritance

TValueListEditor

  

A visual grid control for editing Key-Value pairs.

|

TCustomStringGrid

  

The base class for TStringGrid.

|

TCustomDrawGrid

  

The base class for a custom-drawn grid control.

|

TCustomGrid

  

Implements the base class for grid controls.

|

TCustomControl

  

The base class for windowed controls which paint themselves.

|

TWinControl

  

Implements a windowed control which can contain other child controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components which have an associated widget.

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

TValueListEditor is a TCustomStringGrid descendant which implements a grid-style editor control for Key-Value pairs. TValueListEditor displays a two column grid where the first column is read-only, and lists the key names. The second column is for editing the associated values for the key names.

TValueListEditor provides properties with the Keys and Values displayed in the rows and columns for the control. The Cells property allows access using the familiar column and row number mechanism used in grid controls. The Strings property allows access to the strings used for the Key and Value in a row.

Remark: Since version 2.2.0, Keys will no longer allow the name/value separator used in the Strings property to be entered as a value in the Key column. When entered, focus is moved to the Value column. If pasted into the Key column, the value is silently discarded.

The ItemProps property is used to configure the cell editors used for the Keys and Values. This includes setting the editor style, edit mask, maximum length for the value, a list of selectable pick list values, and a read-only flag. Descriptive text for the Key name can also be stored in the ItemProps.

Features and behavior for the control can be specified using the Options, DisplayOptions, and KeyOptions properties.

TValueListEditor implements methods used to perform editing actions in the control, including:

See also

TItemPropList

  

Implements a storage container for items added to TValueListEditor.

TItemProp

  

Represents items in the TValueListEditor control.

TCustomStringGrid

  

The base class for TStringGrid.


Version 3.2 Generated 2024-02-25 Home