if (!isActiveMgr())
return isDone;
+ // empty previous attribute means that the Apply/Ok button has focus and the enter
+ // should not lead to start edition mode of the previous operation
+ if (thePreviousAttributeID.empty())
+ return isDone;
+
ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
(myWorkshop->currentOperation());
if (!myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty())
bool isSketchSolverError = module()->sketchMgr()->sketchSolverError();
- // empty previous attribute means that the Apply/Ok button has focus and the enter
- // should not lead to start edition mode of the previous operation
- if (!isSketchSolverError && !thePreviousAttributeID.empty()) {
+ if (!isSketchSolverError) {
myRestartingMode = RM_EmptyFeatureUsed;
isDone = startInternalEdit(thePreviousAttributeID);
}
connect(aWidget, SIGNAL(focusInWidget(ModuleBase_ModelWidget*)),
this, SLOT(activateWidget(ModuleBase_ModelWidget*)));
connect(aWidget, SIGNAL(focusOutWidget(ModuleBase_ModelWidget*)),
- this, SLOT(activateNextWidget(ModuleBase_ModelWidget*)));
+ this, SLOT(onActivateNextWidget(ModuleBase_ModelWidget*)));
connect(aWidget, SIGNAL(keyReleased(QKeyEvent*)),
this, SIGNAL(keyReleased(QKeyEvent*)));
connect(aWidget, SIGNAL(enterClicked()),
}
void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget* theWidget)
+{
+ // it is possible that the property panel widgets have not been visualized
+ // (e.g. on start operation), so it is strictly important to do not check visualized state
+ activateNextWidget(theWidget, false);
+}
+
+void XGUI_PropertyPanel::onActivateNextWidget(ModuleBase_ModelWidget* theWidget)
+{
+ // this slot happens when some widget lost focus, the next widget which accepts the focus
+ // should be shown, so the second parameter is true
+ // it is important for features where in cases the same attributes are used, isCase for this
+ // attribute returns true, however it can be placed in hidden stack widget(extrusion: elements,
+ // sketch multi rotation -> single/full point)
+ activateNextWidget(theWidget, true);
+}
+
+
+void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget* theWidget,
+ const bool isCheckVisibility)
{
// TO CHECK: Editing operation does not have automatical activation of widgets
if (isEditingMode()) {
if (!aValidators->isCase(aCurrentWidget->feature(), aCurrentWidget->attributeID()))
continue; // this attribute is not participated in the current case
+ if (isCheckVisibility) {
+ if (!aCurrentWidget->isVisible())
+ continue;
+ }
if (!aCurrentWidget->isObligatory())
continue; // not obligatory widgets are not activated automatically
isFoundWidget = isFoundWidget || (*anIt) == theWidget;
}
activateWidget(NULL);
+ //focusNextPrevChild(true);
}
//#define DEBUG_TAB_WIDGETS
bool isFirstControl = !theIsNext;
QWidget* aLastFocusControl = myActiveWidget->getControlAcceptingFocus(isFirstControl);
if (aFocusWidget == aLastFocusControl) {
- this->setActiveWidget(NULL);
+ setActiveWidget(NULL);
}
}
*/
virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
+ void onActivateNextWidget(ModuleBase_ModelWidget* theWidget);
+
signals:
void enterClicked();
/// If theIsNext is true, this function searches forward, if next is false, it searches backward.
virtual bool focusNextPrevChild(bool theIsNext);
+ /// Activate the next widget in the property panel
+ /// \param theWidget a widget. The next widget should be activated
+ /// \param isCheckVisibility flag whether the next widget visibility is checked
+ void activateNextWidget(ModuleBase_ModelWidget* theWidget,
+ const bool isCheckVisibility);
+
protected:
/// A method called on the property panel closed
/// \param theEvent a close event