From: <bal...@us...> - 2003-10-28 23:14:48
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1:/tmp/cvs-serv3333/Core Modified Files: EventMgr.cpp Log Message: Back to the Old Method in OnMouseUp Event... using iterators throws an Acces Violation Index: EventMgr.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/EventMgr.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** EventMgr.cpp 28 Oct 2003 23:00:16 -0000 1.9 --- EventMgr.cpp 28 Oct 2003 23:10:14 -0000 1.10 *************** *** 129,167 **** void EventMgr::MouseUp(unsigned short x, unsigned short y, unsigned char Button, unsigned short Mod) { ! /*if(lastW != NULL) { ! if((lastW->XPos <= x) && (lastW->YPos <= y)) { //Maybe we are on the window, let's check ! if((lastW->XPos+lastW->Width >= x) && (lastW->YPos+lastW->Height >= y)) { //Yes, we are on the Window ! //Let's check if we have a Control under the Mouse Pointer ! Control * ctrl = lastW->GetControl(x,y); ! if(ctrl != NULL) { ! if(ctrl->hasFocus) ! ctrl->OnMouseUp(x-lastW->XPos-ctrl->XPos,y-lastW->YPos-ctrl->YPos, Button, Mod); ! } ! return; ! } ! } ! }*/ ! std::vector<Window*>::iterator w; ! for(w = windows.begin(); w != windows.end(); ++w) { ! //for(unsigned int i = 0; i < windows.size(); i++) { ! //if(((*m)->XPos <= x) && ((*m)->YPos <= y)) { //Maybe we are on the window, let's check ! // if(((*m)->XPos+(*m)->Width >= x) && ((*m)->YPos+(*m)->Height >= y)) { //Yes, we are on the Window ! //Let's check if we have a Control under the Mouse Pointer ! // Control * ctrl = (*m)->GetControl(x,y); ! // if(ctrl != NULL) { ! // if(ctrl->hasFocus) Control *ctrl = NULL; int c = 0; do { ! ctrl = (*w)->GetControl(c++); if(ctrl == NULL) break; ! ctrl->OnMouseUp(x-(*w)->XPos-ctrl->XPos,y-(*w)->YPos-ctrl->YPos, Button, Mod); } while(true); - //} - //lastW = *m; - //return; - //} - //} } } --- 129,142 ---- void EventMgr::MouseUp(unsigned short x, unsigned short y, unsigned char Button, unsigned short Mod) { ! for(unsigned int i = 0; i < windows.size(); i++) { ! Window * w = windows[i]; Control *ctrl = NULL; int c = 0; do { ! ctrl = w->GetControl(c++); if(ctrl == NULL) break; ! ctrl->OnMouseUp(x-w->XPos-ctrl->XPos,y-w->YPos-ctrl->YPos, Button, Mod); } while(true); } } |