Method XbpWindow():setTrackPointer() Foundation

Switches automatic mouse pointer tracking on or off.

:setTrackPointer( <lTrack> ) --> lSuccess
<lTrack> contains a logical value that specifies whether automatic tracking of the mouse pointer is enabled for the Xbase Part. If the value .T. (true) is assigned to this parameter, pointer tracking is enabled. Otherwise, the feature is disabled. By default, automatic tracking is disabled, see notes below.

This method returns .T. (true) if the method succeeds. In case of an error, :setTrackPointer() returns .F. (false),


The method :setTrackPointer() enables or disables automatic tracking of the mouse pointer for an Xbase Part. If this feature is enabled, the xbeM_Enter and xbeM_Leave notifications are automatically generated when the mouse is moved into or out of the display rectangle of the object. This can be used to give visual feedback as to which Xbase Part would be activated if the mouse was clicked at a certain position.

The method :setTrackPointer() must be used if either xbeM_Enter or xbeM_Leave notifications should be processed via the event callback methods :enter() and/or :leave(). If a code block is assigned to one of the callback slots :enter or :leave, mouse pointer tracking is implicitly enabled. If an application needs to implement custom processing for either notification, :setTrackPointer() should be called to ensure that the respective notifications are generated, regardless of whether a code block is assigned to one of the callback slots.

With modern user interfaces, the :enter() and :leave()events play an important role for implementing visual effects. The Windows Vista Aero interface frequently uses fade effects to indicate that a certain element is sensitive to mouse events. Similarly, :enter() and :leave() events are processed by many Xbase Parts, especially if a visual style is assigned and the application is run in themed mode. Usage of said events is an implementation detail and may vary with the respective operating system used. It is recommended to always assume pointer tracking to be disabled by default, and to explicitly enable this feature using :setTrackPointer() under the conditions documented.

Usage with ActiveX: The :setTrackPointer() method cannot be used with ActiveX controls. If an ActiveX control supports similar functionality, the corresponding COM/ActiveX methods or interfaces must be used instead.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.