Sign in Join
FPDoc Onlineexperiment

TCustomMaskEdit.TextChanged procedure

Member of TCustomMaskEditprotectedIn unit MaskEdit

Performs actions when the value in the Text property has been changed.

Declaration

pascal
procedure TextChanged; override

Description

TextChanged is an overridden procedure used to respond to a change in the value for the Text property. Its purpose is to avoid leaving the control in an invalid state when:

  • A Cut, Paste, or Clear operation from an Operating System context menu. We try to catch and handle these messages.
  • Dragging selected text in the control with the mouse.

If one of these operations happen, then the internal logic for cursor positioning and character insertion can be invalid. So, we simply restore the text value from an internal member used to track the current text value.

The inherited TextChanged method is called when IsMasked is False, or when an internal update to the control value is performed. Otherwise, RealSetTextWhileMasked is called followed by SetCursorPos.

See also

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