// does nothing if previously detected object is equal to the current one
if (myMainSel->OnePicked()->Selectable() == myLastPicked)
{
- return AIS_SOD_OnlyOneDetected;
+ return myLastPicked->State() == 1
+ ? AIS_SOD_Selected
+ : AIS_SOD_OnlyOneDetected;
}
// Previously detected object is unhilighted if it is not selected or hilighted
toUpdateViewer = Standard_True;
}
- if (myLastPicked->State() == 1)
- {
- aStatus = AIS_SOD_Selected;
- }
+ aStatus = myLastPicked->State() == 1
+ ? AIS_SOD_Selected
+ : AIS_SOD_OnlyOneDetected;
}
}
else
}
myLastinMain.Nullify();
+ myLastPicked.Nullify();
}
if (toUpdateViewer)
}
}
- myLastPicked.Nullify();
mylastmoveview = theView;
return aStatus;
}
const Standard_Integer theYPMax)
{
#define IS_FULL_INCLUSION Standard_True
- if (myView.IsNull())
+ if (myView.IsNull()
+ || Abs (theXPMax - theXPMin) < 2
+ || Abs (theYPMax - theYPMin) < 2)
{
return;
}
const Standard_Integer theXPMax,
const Standard_Integer theYPMax)
{
- if (myView.IsNull())
+ if (myView.IsNull()
+ || Abs (theXPMax - theXPMin) < 2
+ || Abs (theYPMax - theYPMin) < 2)
{
return;
}
int X_ButtonPress = 0; // Last ButtonPress position
int Y_ButtonPress = 0;
Standard_Boolean IsDragged = Standard_False;
-Standard_Boolean DragFirst;
+Standard_Boolean DragFirst = Standard_False;
//==============================================================================
}
break;
case WM_LBUTTONUP:
- IsDragged = Standard_False;
- if( !DragFirst )
+ if (!DragFirst)
{
HDC hdc = GetDC( hwnd );
SelectObject( hdc, GetStockObject( HOLLOW_BRUSH ) );
SetROP2( hdc, R2_NOT );
Rectangle( hdc, X_ButtonPress, Y_ButtonPress, X_Motion, Y_Motion );
ReleaseDC( hwnd, hdc );
-
- const Handle(ViewerTest_EventManager) EM =
- ViewerTest::CurrentEventManager();
- if ( fwKeys & MK_SHIFT )
- EM->ShiftSelect( min( X_ButtonPress, X_Motion ), max( Y_ButtonPress, Y_Motion ),
- max( X_ButtonPress, X_Motion ), min( Y_ButtonPress, Y_Motion ));
- else
- EM->Select( min( X_ButtonPress, X_Motion ), max( Y_ButtonPress, Y_Motion ),
- max( X_ButtonPress, X_Motion ), min( Y_ButtonPress, Y_Motion ));
+ VT_ProcessButton1Release (fwKeys & MK_SHIFT);
}
+ IsDragged = Standard_False;
return ViewerWindowProc( hwnd, Msg, wParam, lParam );
case WM_LBUTTONDOWN: