bool aWasDragging = myIsDragging;
myIsDragging = false;
- if (myModule->sketchReentranceMgr()->processMouseReleased(theWnd, theEvent))
+ if (myModule->sketchReentranceMgr()->processMouseReleased(theWnd, theEvent)) {
return;
-
+ }
// if mouse is pressed when it was over view and at release the mouse is out of view, do nothing
- if (!myIsMouseOverViewProcessed)
+ if (!myIsMouseOverViewProcessed) {
return;
-
+ }
- ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
ModuleBase_IViewer* aViewer = aWorkshop->viewer();
- if (!aViewer->canDragByMouse())
- return;
- ModuleBase_Operation* aOp = getCurrentOperation();
+ //if (!aViewer->canDragByMouse())
+ // return;
+ ModuleBase_OperationFeature* aOp =
+ dynamic_cast<ModuleBase_OperationFeature*>(getCurrentOperation());
if (aOp) {
- if (isNestedSketchOperation(aOp)) {
- // Only for sketcher operations
- if (aWasDragging) {
- if (myDragDone) {
- /// the previous selection is lost by mouse release in the viewer(Select method), but
- /// it is still stored in myCurrentSelection. So, it is possible to restore selection
- /// It is important for drag(edit with mouse) of sketch entities.
- restoreSelection(myCurrentSelection);
- myCurrentSelection.clear();
+ bool aStartNoDragOperation = !aViewer->canDragByMouse() && aOp->isEditOperation();
+ if (aStartNoDragOperation || myNoDragMoving) {
+ // Process edit operation without dragging
+ if (myCurrentSelection.size() > 0)
+ myNoDragMoving = !myNoDragMoving;
+ else
+ myNoDragMoving = false;
+ if (myNoDragMoving)
+ return;
+ else {
+ restoreSelection(myCurrentSelection);
+ myCurrentSelection.clear();
+ }
+ }
+ else {
+ if (isNestedSketchOperation(aOp)) {
+ // Only for sketcher operations
+ if (aWasDragging) {
+ if (myDragDone) {
+ /// the previous selection is lost by mouse release in the viewer(Select method), but
+ /// it is still stored in myCurrentSelection. So, it is possible to restore selection
+ /// It is important for drag(edit with mouse) of sketch entities.
+ restoreSelection(myCurrentSelection);
+ myCurrentSelection.clear();
+ }
}
}
}
action("SHOW_ONLY_CMD")->setEnabled(true);
action("SHADING_CMD")->setEnabled(true);
action("WIREFRAME_CMD")->setEnabled(true);
+
+ foreach(ObjectPtr aObj, aObjects) {
+ FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
+ if (!aFeature->isInHistory()) {
+ canBeDeleted = false;
+ break;
+ }
+ }
+ action("DELETE_CMD")->setEnabled(canBeDeleted);
}
+ if (hasFeature && myWorkshop->canMoveFeature())
+ action("MOVE_CMD")->setEnabled(true);
} // end multi-selection
// Check folder management commands state if only features are selected