/// The method called when widget is deactivated
virtual void deactivate();
+ /// Opportunity to do something after the active widget of the property panel changed
+ virtual void updateAfterDeactivation() {}
+ /// Opportunity to do something after the active widget of the property panel changed
+ virtual void updateAfterActivation() {}
+
/// The method called if widget should be activated always
virtual bool needToBeActiated() { return false; }
myWorkshop->module()->activateCustomPrs(myFeature,
ModuleBase_IModule::CustomizeHighlightedObjects, true);
clearSelectedHistory();
- myWorkshop->updateCommandStatus();
}
//********************************************************************
myWorkshop->module()->deactivateCustomPrs(ModuleBase_IModule::CustomizeHighlightedObjects, true);
clearSelectedHistory();
+}
+
+//********************************************************************
+void ModuleBase_WidgetMultiSelector::updateAfterDeactivation()
+{
+ // restore previous Undo/Redo workshop state
+ myWorkshop->updateCommandStatus();
+}
+
+//********************************************************************
+void ModuleBase_WidgetMultiSelector::updateAfterActivation()
+{
+ // fill Undo/Redo actions with current information
myWorkshop->updateCommandStatus();
}
}
}
-//********************************************************************
-void ModuleBase_WidgetMultiSelector::updateSelectionModesAndFilters(bool toActivate)
-{
- myWorkshop->updateCommandStatus(); // update enable state of Undo/Redo application actions
- ModuleBase_WidgetSelector::updateSelectionModesAndFilters(toActivate);
-}
-
//********************************************************************
bool ModuleBase_WidgetMultiSelector::isValidSelectionCustom(const ModuleBase_ViewerPrsPtr& thePrs)
{
/// The methiod called when widget is deactivated
virtual void deactivate();
+ /// Update Undo/Redo actions state
+ virtual void updateAfterDeactivation();
+
+ /// Update Undo/Redo actions state
+ virtual void updateAfterActivation();
+
/// Set the given wrapped value to the current widget
/// This value should be processed in the widget according to the needs
/// \param theValues the wrapped selection values
virtual bool processAction(ModuleBase_ActionType theActionType,
const ActionParamPtr& theParam = ActionParamPtr());
- /// Activate or deactivate selection and selection filters
- virtual void updateSelectionModesAndFilters(bool toActivate);
-
/// Checks the widget validity. By default, it returns true.
/// \param thePrs a selected presentation in the view
/// \return a boolean value
return false;
}
std::string aPreviosAttributeID;
+ ModuleBase_ModelWidget* aDeactivatedWidget = NULL, *anActivatedWidget = NULL;
if(myActiveWidget) {
aPreviosAttributeID = myActiveWidget->attributeID();
myActiveWidget->processValueState();
myActiveWidget->deactivate();
myActiveWidget->setHighlighted(false);
+ aDeactivatedWidget = myActiveWidget;
}
if(theWidget) {
emit beforeWidgetActivated(theWidget);
theWidget->setHighlighted(true);
theWidget->activate();
+ anActivatedWidget = theWidget;
}
myActiveWidget = theWidget;
myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
+ if (aDeactivatedWidget)
+ aDeactivatedWidget->updateAfterDeactivation();
+ if (anActivatedWidget)
+ anActivatedWidget->updateAfterActivation();
+
if (!anIsNoMoreWidgets && myActiveWidget)
{
// restore widget selection should be done after selection modes of widget activating