From 9b1c9735e67e7ca2aa7bf76bcdbcd86635da3b5f Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 8 Apr 2015 14:58:47 +0300 Subject: [PATCH] Editor widget is shown if the mouse is over window, otherwise the corresponded double widget accepts the focus. --- src/PartSet/PartSet_SketcherMgr.cpp | 14 ++++++++------ src/PartSet/PartSet_WidgetEditor.cpp | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 359ee319e..e404a2f41 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -157,18 +157,23 @@ PartSet_SketcherMgr::~PartSet_SketcherMgr() void PartSet_SketcherMgr::onEnterViewPort() { - if (!isNestedCreateOperation(getCurrentOperation())) - return; // 1. if the mouse over window, update the next flag. Do not perform update visibility of // created feature because it should be done in onMouseMove(). Some widgets watch // the mouse move and use the cursor position to update own values. If the presentaion is // redisplayed before this update, the feature presentation jumps from reset value to current. myIsMouseOverWindow = true; myIsPropertyPanelValueChanged = false; + + if (!isNestedCreateOperation(getCurrentOperation())) + return; } void PartSet_SketcherMgr::onLeaveViewPort() { + myIsMouseOverViewProcessed = false; + myIsMouseOverWindow = false; + myIsPropertyPanelValueChanged = false; + if (!isNestedCreateOperation(getCurrentOperation())) return; // the method should be performed if the popup menu is called, @@ -176,9 +181,6 @@ void PartSet_SketcherMgr::onLeaveViewPort() if (myIsPopupMenuActive) return; - myIsMouseOverViewProcessed = false; - myIsMouseOverWindow = false; - // 2. if the mouse IS NOT over window, reset the active widget value and hide the presentation ModuleBase_IWorkshop* aWorkshop = myModule->workshop(); XGUI_ModuleConnector* aConnector = dynamic_cast(aWorkshop); @@ -195,7 +197,7 @@ void PartSet_SketcherMgr::onLeaveViewPort() aDisplayer->enableUpdateViewer(isEnableUpdateViewer); // hides the presentation of the current operation feature - myIsPropertyPanelValueChanged = false; + //myIsPropertyPanelValueChanged = false; // the feature is to be erased here, but it is correct to call canDisplayObject because // there can be additional check (e.g. editor widget in distance constraint) FeaturePtr aFeature = getCurrentOperation()->feature(); diff --git a/src/PartSet/PartSet_WidgetEditor.cpp b/src/PartSet/PartSet_WidgetEditor.cpp index 66ed150b8..4857863b5 100644 --- a/src/PartSet/PartSet_WidgetEditor.cpp +++ b/src/PartSet/PartSet_WidgetEditor.cpp @@ -24,8 +24,8 @@ bool PartSet_WidgetEditor::focusTo() { PartSet_Module* aModule = dynamic_cast(myWorkshop->module()); if (aModule->isMouseOverWindow()) - return ModuleBase_WidgetDoubleValue::focusTo(); + return ModuleBase_WidgetEditor::focusTo(); else { - ModuleBase_WidgetEditor::focusTo(); + return ModuleBase_WidgetDoubleValue::focusTo(); } } -- 2.39.2