From: <bal...@us...> - 2003-11-04 21:11:04
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1:/tmp/cvs-serv20532/gemrb/plugins/Core Modified Files: EventMgr.cpp Log Message: Bug Fixed: OnMouseUp Event Bug now is totally removed Index: EventMgr.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/EventMgr.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** EventMgr.cpp 4 Nov 2003 20:56:27 -0000 1.14 --- EventMgr.cpp 4 Nov 2003 21:11:00 -0000 1.15 *************** *** 23,31 **** } } ! windows.push_back(win); ! if(windows.size() == 1) ! topwin.push_back(0); ! else ! SetOnTop(windows.size()-1); lastW = win; lastF = NULL; --- 23,42 ---- } } ! bool found = false; ! for(unsigned int i = 0; i < windows.size(); i++) { ! if(windows[i] == NULL) { ! windows[i] = win; ! SetOnTop(i); ! found = true; ! break; ! } ! } ! if(!found) { ! windows.push_back(win); ! if(windows.size() == 1) ! topwin.push_back(0); ! else ! SetOnTop(windows.size()-1); ! } lastW = win; lastF = NULL; *************** *** 36,42 **** topwin.clear(); std::vector<Window*>::iterator m; ! while(windows.size() != 0) { ! m = windows.begin(); ! windows.erase(m); } lastW = NULL; --- 47,52 ---- topwin.clear(); std::vector<Window*>::iterator m; ! for(m = windows.begin(); m != windows.end(); ++m) { ! (*m) = NULL; } lastW = NULL; *************** *** 53,60 **** for(m = windows.begin(); m != windows.end(); ++m) { pos++; if((*m)->WindowID == WindowID) { if(lastW == (*m)) lastW = NULL; ! windows.erase(m); lastF = NULL; break; --- 63,73 ---- for(m = windows.begin(); m != windows.end(); ++m) { pos++; + if((*m) == NULL) + continue; if((*m)->WindowID == WindowID) { if(lastW == (*m)) lastW = NULL; ! //windows.erase(m); ! (*m) = NULL; lastF = NULL; break; *************** *** 97,100 **** --- 110,115 ---- m = windows.begin(); m+=(*t); + if((*m) == NULL) + continue; if(!(*m)->Visible) continue; *************** *** 138,141 **** --- 153,158 ---- m = windows.begin(); m+=(*t); + if((*m) == NULL) + continue; if(!(*m)->Visible) continue; *************** *** 180,194 **** for(t = topwin.begin(); t != topwin.end(); ++t) { Window * w = windows[(*t)]; ! if(w == NULL) { ! printf("DANGER WILL ROBINSON!! The Top Most Window is NULL\n"); ! return; ! } if((x>=w->XPos) && (x <= (w->XPos+w->Width)) && (y>=w->YPos) && (y<=(w->YPos+w->Height))) { printf("Broadcasting MouseUp Event on Window %d of %d\n", i, topwin.size()); Control * ctrl = NULL; int c = 0; - int lastWinArraySize = topwin.size(); do { ! if(topwin.size() != lastWinArraySize) break; ctrl = w->GetControl(c++); --- 197,212 ---- for(t = topwin.begin(); t != topwin.end(); ++t) { Window * w = windows[(*t)]; ! if(w == NULL) //{ ! //printf("DANGER WILL ROBINSON!! The Top Most Window is NULL\n"); ! //return; ! //} ! continue; if((x>=w->XPos) && (x <= (w->XPos+w->Width)) && (y>=w->YPos) && (y<=(w->YPos+w->Height))) { printf("Broadcasting MouseUp Event on Window %d of %d\n", i, topwin.size()); Control * ctrl = NULL; int c = 0; do { ! w = windows[(*t)]; ! if(w == NULL) break; ctrl = w->GetControl(c++); |