Contents - Index - Previous - Next


OnDisplayChanged event




Declaration
property OnDisplayChanged: TNotifyEvent;

Description

Occurs in response to any change in the state of the document to alert that the user interface should be updated.

The event is fired when any action occurs in the document, including: 
  •   Initializing a new document or loading an existing one.
  •   Movement of the mouse cursor or the insertion point.
  •   Selection.
     
    You can use this event to update any elements outside the control that reflect the current state of the document. For example, if you are displaying the document's raw HTML in addition to the document as viewed in the control, you can add a handler for this event to update the raw HTML to reflect edits made in the control.

    The event fires whenever the editing context has changed (for example, when the user has selected an element), so you can use the event to update any toolbars or menus that you display for the control. Typically, each time OnDisplayChanged is fired, you make a succession of calls to the control's methods to determine if certain editing facilities should be enabled or disabled. Because the availability of various commands depends on the current editing state, you call the "Can..." methods in a handler for the OnDisplayChanged event. The event is fired whenever the user makes any change whatsoever in the document, including simply moving the mouse cursor or insertion point.

    Note:  The OnDisplayChanged event is fired very frequently (with each user gesture), so if you write a handler for this event, the handler should be as efficient as possible, or it will adversely affect performance of the application.