Update of MFC samples for problem "Mouse selection issue is repeatable on all your...
authorbugmaster <>
Wed, 20 Apr 2011 14:01:48 +0000 (14:01 +0000)
committerbugmaster <bugmaster@opencascade.com>
Mon, 5 Mar 2012 15:27:40 +0000 (19:27 +0400)
samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp
samples/mfc/standard/09_Animation/src/AnimationDoc.cpp
samples/mfc/standard/Common/OCC_3dBaseDoc.cpp

index 71d886f..b4c658c 100755 (executable)
@@ -680,8 +680,8 @@ void CViewer3dView::OnMouseMove(UINT nFlags, CPoint point)
                     GetDocument()->ShiftDragEvent(myXmax,myYmax,0,myView);
            else
              GetDocument()->DragEvent(myXmax,myYmax,0,myView);
-                  DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True);
-          break;
+           DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True);
+           break;
          case CurAction3d_DynamicZooming :
               myView->Zoom(myXmax,myYmax,point.x,point.y); 
               // save the current mouse coordinate in min \n";
@@ -856,9 +856,11 @@ void CViewer3dView::DrawRectangle(const Standard_Integer  MinX    ,
 
     if ( m_IsVisible && !Draw) // move or up  : erase at the old position 
     {
-     clientDC.MoveTo(StoredMinX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMaxY); 
+     clientDC.MoveTo(StoredMinX,StoredMinY); 
+     clientDC.LineTo(StoredMinX,StoredMaxY); 
      clientDC.LineTo(StoredMaxX,StoredMaxY); 
-        clientDC.LineTo(StoredMaxX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMinY);
+          clientDC.LineTo(StoredMaxX,StoredMinY); 
+     clientDC.LineTo(StoredMinX,StoredMinY);
      m_IsVisible = false;
     }
 
@@ -869,13 +871,16 @@ void CViewer3dView::DrawRectangle(const Standard_Integer  MinX    ,
 
     if (Draw) // move : draw
     {
-     clientDC.MoveTo(StoredMinX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMaxY); 
+     clientDC.MoveTo(StoredMinX,StoredMinY); 
+     clientDC.LineTo(StoredMinX,StoredMaxY); 
      clientDC.LineTo(StoredMaxX,StoredMaxY); 
-        clientDC.LineTo(StoredMaxX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMinY);
+          clientDC.LineTo(StoredMaxX,StoredMinY); 
+     clientDC.LineTo(StoredMinX,StoredMinY);
      m_IsVisible = true;
    }
 
-    if (m_Pen) clientDC.SelectObject(aOldPen);
+    if (m_Pen) 
+      clientDC.SelectObject(aOldPen);
 }
 
 void CViewer3dView::OnModifyChangeBackground() 
index 7d29171..3c527c4 100755 (executable)
@@ -198,7 +198,7 @@ void CAnimationDoc::DragEvent(const Standard_Integer  x        ,
       theButtonDownY=y;
     }
 
-       if (TheState == 0)
+       if (TheState == 1)
          myAISContext->Select(theButtonDownX,theButtonDownY,x,y,aView);  
 }
 
index 9238998..711fd28 100755 (executable)
@@ -82,9 +82,10 @@ void OCC_3dBaseDoc::DragEvent(const Standard_Integer  x        ,
       theButtonDownX=x;
       theButtonDownY=y;
     }
-
-       if (TheState == 0)
-         myAISContext->Select(theButtonDownX,theButtonDownY,x,y,aView);  
+       if (TheState == 1)
+  {
+     myAISContext->Select(theButtonDownX,theButtonDownY,x,y,aView);
+  }
 }
 
 //-----------------------------------------------------------------------------------------
@@ -94,7 +95,7 @@ void OCC_3dBaseDoc::InputEvent(const Standard_Integer  x     ,
                                                   const Standard_Integer  y     ,
                                    const Handle(V3d_View)& aView ) 
 {
-    myAISContext->Select(); 
+   myAISContext->Select(); 
 }
 
 //-----------------------------------------------------------------------------------------