hi guys and gals, another quick one here, i have my coil object that is created when i left click onto the view of my program, now this coil take the x and y co-ordinate from the left click and then stores them and with the code i have then draws the coil. this is fine no problem here, what i was thinking is this when i left click over a already drawn coil i then give the user the ability to drag and drop the coil to a new location, to be honest im not quite sure how to do this, would i have to use on mouse move refresh the page with the invalidate->this function like i do when i use the left click like in the code i will show below
CODE
void CCoilsView::OnLButtonDown(UINT nFlags, CPoing point)
{
CCoilsDoc* pDoc= GetDocument();
int d=point.x;
int f=point.y;
temp=CheckCoils2(d,f);
if (temp==-1){
pDoc->n=pDoc->n+1;
CView::OnLButtonDown(nFlags, point);
pDoc->mycoil[pDoc->n-1].x=point.x;
pDoc->mycoil[pDoc->n-1].y=point.y;
pDoc->mycoil[pDoc->n-1].rot=0;
pDoc->mycoil[pDoc->n-1].thicl=2;
this->invalidate();
}
}
now when the invalidate is called ondraw has a function in it which draws the coil for me thats fine so i guess im wondering how would i go about selecting that object and changing the mouse co-ordintates everytime i drag it??? so it redraws as i drag as well?? if you understand what im trying to get to all i need to know is how to be able to change the point.x and point.y on mouse move??? cause i can always call the function again and again cant i??
thanks
dan
This post has been edited by didgy58: 15 Mar, 2008 - 03:47 AM