Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MRemoteCaller
Inherited By:
None.
Purpose:
A cursor-tracking sprite is a sprite that follows the system cursor across the screen. Icons or other small graphics that the user drags with the mouse are good candidates for cursor-tracking sprites. As the user moves the mouse or an equivalent input device, the cursor-tracking sprite's entire graphic (not just its outline) moves continuously.
This version of TCursorTrackingSprite contains a subset of the eventual application programming interface. TCursorTrackingSprite is a surrogate for a single-system sprite that tracks the single-system cursor. When multiple cursors are supported, you will be able to construct cursor-tracking sprites that track any of the system cursors. For now, when multiple TCursorTrackingSprites are created, they all refer to the same graphic that tracks the single-system cursor. For example, if one TCursorTrackingSprite sets the graphic and then another TCursorTrackingSprite sets the graphic to a second graphic, then, when the first TCursorTrackingSprite invokes CopyGraphic to copy the graphic, the graphic returned by CopyGraphic is the second one. Destroying a TCursorTrackingSprite sets the sprite graphic to NIL only if there are no more TCursorTrackingSprites left.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None. This class is not designed to support derived classes at this time.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TCursorTrackingSprite (const TCursor *)
- TCursorTrackingSprite ()
Interface Category:
API.
Purpose:
- TCursorTrackingSprite is a surrogate for a single-system sprite that tracks the single-system cursor. When multiple cursors are supported, you will be able to construct cursor-tracking sprites that track any of the system cursors. For now, the TCursor* parameter is ignored.
- Default constructor.
Calling Context:
- Call this function directly.
- Only for internal use by Resurrect. Developers should treat as protected.
Parameters:
- const TCursor * -A pointer to the cursor object that this cursor-tracking sprite follows (ignored in this version).
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TCursorTrackingSprite ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetGraphic (const MDrawable & graphic)
Interface Category:
API.
Purpose:
Sets the graphic of the cursor-tracking sprite. The graphic is positioned so that the point 0,0 within the graphic is aligned with the hot spot of the cursor (the point 0,0 within the cursor's graphic). The programmer might have to translate a graphic prior to the SetGraphic call if it isn't already aligned correctly.
Calling Context:
Call this function directly.
Parameters:
- const MDrawable & graphic -The graphic to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual MDrawable * CopyGraphic () const
Interface Category:
API.
Purpose:
Returns a copy of the current graphic displayed by the cursor-tracking sprite.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a new MDrawable that is owned by the caller.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TGPoint GetLocation () const
Interface Category:
API.
Purpose:
Returns the current location of the cursor in world coordinates.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a TGPoint containing the current location of the cursor.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.