MeasureDistance

- Abort mode via ESCAPE added

BoxZoom, BoxSelection and BoxElementSelection
- Change the cursor to give the user feedback about active mode.
- Abort mode via ESCAPE
This commit is contained in:
uLeonis
2020-12-21 17:32:14 +01:00
parent 3b449e1ce9
commit 96f2ba2cb5
10 changed files with 299 additions and 45 deletions

View File

@@ -224,12 +224,25 @@ void ViewProvider::eventCallback(void * ud, SoEventCallback * node)
// holding the mouse button while using some SoDragger.
// Therefore, we shall ignore ESC while any mouse button is
// pressed, until this Coin bug is fixed.
Gui::TimerFunction* func = new Gui::TimerFunction();
func->setAutoDelete(true);
Gui::Document* doc = Gui::Application::Instance->activeDocument();
func->setFunction(boost::bind(&Document::resetEdit, doc));
QTimer::singleShot(0, func, SLOT(timeout()));
if (!press) {
// react only on key release
// Let first selection mode terminate
Gui::Document* doc = Gui::Application::Instance->activeDocument();
Gui::View3DInventor* view = static_cast<Gui::View3DInventor*>(doc->getActiveView());
if (view)
{
Gui::View3DInventorViewer* viewer = view->getViewer();
if (viewer->isSelecting())
{
return;
}
}
Gui::TimerFunction* func = new Gui::TimerFunction();
func->setAutoDelete(true);
func->setFunction(boost::bind(&Document::resetEdit, doc));
QTimer::singleShot(0, func, SLOT(timeout()));
}
}
else if (press) {
FC_WARN("Please release all mouse buttons before exiting editing");