The TRACKER sample is a test application that provides an exhaustive illustration of CRectTracker member functions, styles, and options. For a real-world example that uses CRectTracker, see DRAWCLI, the object-oriented drawing sample application.
| Security Note |
|---|
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. |
Building and Running the Sample
To build and run the TRACKER sample
Open the solution tracker.sln.
On the Build menu, click Build.
On the Debug menu, click Start Without Debugging.
TRACKER initially displays a square with four colored and numbered quadrants. The quadrants are displayed to help you see when the square is inverted horizontally and/or vertically. Initially, the square has no CRectTracker adornments. Try the various toolbar commands, or Edit menu commands, to turn on and off CRectTracker styles, including dotted or solid lines; hatched border, inside or outside the rectangle; and resize handles, inside or outside the rectangle.
Note how the cursor changes shape over parts of the rectangle to indicate what happens if you drag the mouse. Try moving and resizing the rectangle.
Keywords
This sample demonstrates the following keywords:
CBrush::CreateSolidBrush; CDialog::DoModal; CDocument::OnNewDocument; CDocument::SetModifiedFlag; CDocument::UpdateAllViews; CFrameWnd::Create; CFrameWnd::LoadFrame; CGdiObject::DeleteObject; CObject::AssertValid; CObject::Dump; CObject::Serialize; CRect::Height; CRect::IntersectRect; CRect::Width; CRectTracker::Draw; CRectTracker::GetTrueRect; CRectTracker::HitTest; CRectTracker::SetCursor; CRectTracker::Track; CRectTracker::TrackRubberBand; CView::DoPreparePrinting; CView::GetDocument; CView::OnBeginPrinting; CView::OnDraw; CView::OnEndPrinting; CView::OnPreparePrinting; CView::OnUpdate; CWinApp::AddDocTemplate; CWinApp::InitInstance; CWinApp::LoadStdProfileSettings; CWinApp::OnFileNew; CWnd::DoDataExchange; CWnd::InvalidateRect; CWnd::OnCreate; CWnd::OnLButtonDown; CWnd::OnSetCursor; CWnd::ShowWindow; CWnd::UpdateWindow; ExtTextOut; GetTextMetrics; LoadBitmap; MessageBeep; PatBlt; RGB; SelectObject; SetBkMode; SetTextAlign; abs
| Note |
|---|
Some samples, such as this one, have not been modified to reflect the changes in the Visual C++ wizards, libraries, and compiler, but still demonstrate how to complete your desired task. |