CRectTracker Class

Allows an item to be displayed, moved, and resized in different fashions.

class CRectTracker

Members

Public Constructors

Name

Description

CRectTracker::CRectTracker

Constructs a CRectTracker object.

Public Methods

Name

Description

CRectTracker::AdjustRect

Called when the rectangle is resized.

CRectTracker::Draw

Renders the rectangle.

CRectTracker::DrawTrackerRect

Called when drawing the border of a CRectTracker object.

CRectTracker::GetHandleMask

Called to get the mask of a CRectTrackeritem's resize handles.

CRectTracker::GetTrueRect

Returns width and height of rectangle, including resize handles.

CRectTracker::HitTest

Returns the current position of the cursor related to the CRectTracker object.

CRectTracker::NormalizeHit

Normalizes a hit-test code.

CRectTracker::OnChangedRect

Called when the rectangle has been resized or moved.

CRectTracker::SetCursor

Sets the cursor, depending on its position over the rectangle.

CRectTracker::Track

Allows the user to manipulate the rectangle.

CRectTracker::TrackRubberBand

Allows the user to "rubber-band" the selection.

Public Data Members

Name

Description

CRectTracker::m_nHandleSize

Determines size of resize handles.

CRectTracker::m_nStyle

Current style(s) of the tracker.

CRectTracker::m_rect

Current position (in pixels) of the rectangle.

CRectTracker::m_sizeMin

Determines minimum rectangle width and height.

Remarks

CRectTracker does not have a base class.

Although the CRectTracker class is designed to allow the user to interact with OLE items by using a graphical interface, its use is not restricted to OLE-enabled applications. It can be used anywhere such a user interface is required.

CRectTracker borders can be solid or dotted lines. The item can be given a hatched border or overlaid with a hatched pattern to indicate different states of the item. You can place eight resize handles on either the outside or the inside border of the item. (For an explanation of the resize handles, see GetHandleMask.) Finally, a CRectTracker allows you to change the orientation of an item during resizing.

To use CRectTracker, construct a CRectTracker object and specify which display states are initialized. You can then use this interface to give the user visual feedback on the current status of the OLE item associated with the CRectTracker object.

For more information on using CRectTracker, see the article Trackers.

Inheritance Hierarchy

CRectTracker

Requirements

Header: afxext.h

See Also

Reference

Hierarchy Chart

COleResizeBar Class

CRect Class

CRectTracker::GetHandleMask

Concepts

MFC Sample TRACKER

MFC Sample DRAWCLI