Probably,
the mouse click sholud set the element's marking flag only...
...then, in your
CXXXView::OnDraw(CDC*)
, you could use the flag
to draw the tracker arount the marked element(s) :)
void CYourView::OnMouseDown(UINT uiFlags, CPoint point)
{
CPoint cptAbsoluteViewPosition(point + GetScrollPosition());
CYourDoc* pcDoc(GetDocument);
if (pcDoc) {
CYourDocElementBase* pcElement(pcDoc->FindElementByPos(cptAbsoluteViewPosition));
if (pcElement) {
pcElement->SetMarked(true);
Invalidate();
}
}
CScrollView::OnMouseDown(uiFlags, point);
}
void CYourView::OnDraw(CDC* pDC)
{
POSITION pos(pcDoc->GetFirstElementPos());
while (pos) {
CYourDocElementBase* pcElement(pcDoc->GetNextElement(pos));
if (pcElement) {
CRect crElement(pcElement->GetElemRect());
if () {
pcElement->Draw(pDC);
if (pcElement->IsMarked()) {
}
}
}
}
}