Re: Plotting points
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Sat, 04 Feb 2006 21:18:21 -0500
That's code I posted. I assume that the reader has the sense to realize that the variable
has to be declared as a variable of type HCURSOR, and a LoadCursor will be used to
initialize it.
joe
On Sat, 04 Feb 2006 14:44:18 GMT, "Ed" <eddie@xxxxxxxxxx> wrote:
In the code that I received from someone here "dragcursor" comes upJoseph M. Newcomer [MVP]
"Undeclared Identifier" what should it be.
#define DELTA 4
CSize offset;
int dragger;
dc.Polyline(Points, PointCount);
void CMyWnd::OnLButtonDown(UINT flags, CPoint pt)
{
CRect box(pt.x - DELTA, pt.y - DELTA, pt.x + DELTA, pt.y + DELTA);
for(int i = 1; i < PointCount - 1; i++)
{ /* scan */
if(box.PtInRect(Points[i]))
{ /* hit */
SetCursor(dragcursor); // ******** the problem is here ********
SetCapture();
dragger = i;
offset = CSize(pt.x - Points[i].x, pt.y - Points[i].y);
// check my logic on the sign of the offset...
} /* hit */
} /* scan */
}
void CMyWnd::OnMouseMove(UINT flags, CPoint pt)
{
if(GetCapture() != NULL)
{ /* has capture */
Points[dragger].y = pt.y - offset.cy; // check my sign logic here...
Invalidate(); // could make this smarter, exercise for reader
} /* has capture */
}
void CMyWnd::OnLButtonUp(UINT flags, CPoint pt)
{
if(GetCapture() != NULL)
ReleaseCapture();
}
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: Plotting points
- From: Joseph M . Newcomer
- Re: Plotting points
- References:
- Plotting points
- From: Ed
- Plotting points
- Prev by Date: Re: Importing transparently another exe file
- Next by Date: Re: Does every windows which shows itself while working on any Windows O.S ( lets say Windows 2k) a registered one?
- Previous by thread: Re: Plotting points
- Next by thread: Re: Plotting points
- Index(es):