[Igarden-commit] Garden/source/PlanTool WarningOverlay.cpp, 1.4.2.5, 1.4.2.6 WarningOverlay.h, 1.1,
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2008-04-17 10:52:07
|
Update of /cvsroot/igarden/Garden/source/PlanTool In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv20763/source/PlanTool Modified Files: Tag: Release_branch_v1 WarningOverlay.cpp WarningOverlay.h Log Message: Fixed the display of plan warnings overlap warning didn't take plan scale into account plant size warning flickered Index: WarningOverlay.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/WarningOverlay.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** WarningOverlay.h 24 Jan 2005 12:38:05 -0000 1.1 --- WarningOverlay.h 17 Apr 2008 10:51:12 -0000 1.1.2.1 *************** *** 51,57 **** --- 51,60 ---- void RaiseWarningWindow(Element *elem, PlanView* parent, infoPopupType_t type, planPoint_t point, long index = 0); void RemoveWarningWindow(); + static void MouseMovedCallback(Element *element, void *ref); yaaf::InfoPopupView* _curInfoView; yaaf::XGPopWindow* _popWindow; + bool _oneFound; // For callback + planPoint_t _point; // For callback }; Index: WarningOverlay.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/WarningOverlay.cpp,v retrieving revision 1.4.2.5 retrieving revision 1.4.2.6 diff -C2 -d -r1.4.2.5 -r1.4.2.6 *** WarningOverlay.cpp 19 Mar 2008 01:57:32 -0000 1.4.2.5 --- WarningOverlay.cpp 17 Apr 2008 10:51:10 -0000 1.4.2.6 *************** *** 125,128 **** --- 125,148 ---- } + void WarningOverlay::MouseMovedCallback(Element *element, void *ref) + { + WarningOverlay *overlay = reinterpret_cast<WarningOverlay*>(ref); + long index; + + if(element->IsOverWarning(overlay->_point, overlay->_view->GetScale())) + { + // On warning + if(overlay->_popWindow == NULL) + overlay->RaiseWarningWindow(element, overlay->_view, kWarningOnly, overlay->_point); + overlay->_oneFound = true; + } + else if(element->IsOverOverlap(overlay->_point, overlay->_scale, index)) + { + if(overlay->_popWindow == NULL) + overlay->RaiseWarningWindow(element, overlay->_view, kOverlapOnly, overlay->_point, index); + overlay->_oneFound = true; + } + } + //---------------------------------------------------- // void WarningOverlay::MouseMoved( planPoint_t point ) *************** *** 131,173 **** void WarningOverlay::MouseMoved(planPoint_t point) { ! long n, count; ! Element *elem; ! bool found, oneFound = false; ! XGDynArray<Element*> results; ! found = _view->GetLayout()->GetElementsAtPoint(point, _view, results); ! if(found && results.Length() != 0) ! { ! count = results.Length(); ! for(n = 0; n < count; n++) ! { ! elem = results[n]; ! // printf("over item %ld,%ld\n", point.xOffset, point.yOffset); ! if(elem->IsOverWarning(point, _view->GetScale())) ! { ! // On warning ! RaiseWarningWindow(elem, _view, kWarningOnly, point); ! oneFound = true; ! } ! } ! ! if(!oneFound) ! { ! for(n = 0; n < count; n++) ! { ! long index; ! ! elem = results[n]; ! if(elem->IsOverOverlap(point, index)) ! { ! RaiseWarningWindow(elem, _view, kOverlapOnly, point, index); ! oneFound = true; ! } ! } ! if(!oneFound) ! RemoveWarningWindow(); ! } ! } ! else RemoveWarningWindow(); } --- 151,166 ---- void WarningOverlay::MouseMoved(planPoint_t point) { ! planRectangle_t rect; ! rect.xOffset = point.xOffset - (20*_scale); ! rect.xSize = (40*_scale); ! rect.yOffset = point.yOffset - (20*_scale); ! rect.ySize = (40*_scale); ! _oneFound = false; ! _point = point; ! ! _view->GetLayout()->ExecuteForEachElementWithin(MouseMovedCallback, this, rect); ! ! if(!_oneFound) RemoveWarningWindow(); } |