I am writing a program that has two windows. One window draws the shapes you choose in window2 and saves them in a list. When clicking on the second window once the first shape is supposed to move to the spot clicked. If double clicking the second shape and so forth.
As of now everything is working besides for when double or triple clicking on the second window, I not only have the second or third shape moving to the spot clicked but the first as well.
Here is the code that executes when clicking on the second window(W2).
Thank you!
int ReportMousePositionW2(const Position &p)
{
static int clicks=0;
clicks++;
int counter=0;
float x=p.GetXDistance();
float y= p.GetYDistance();
lst.IterBegin();
while(lst.IterEnd()==false)
{
lst.IterNext();
counter++;
}
while(counter<clicks)
clicks=clicks-counter;
lst.IterBegin();
for(int i=0;i<counter-clicks;i++)
lst.IterNext();
lst.getIter()->getInfo()->Erase();
lst.getIter()->getInfo()->SetPosition(x,y);
lst.getIter()->getInfo()->Draw();
return 1;
}