MODULEBASE_EXPORT virtual void activateSelectionFilters
(const SelectMgr_ListOfFilter& theSelectionFilters) = 0;
- /// Activate or deactivate selection and selection filters like the widget is active
- /// \param theWidget a source widget of selection modes/filters
- MODULEBASE_EXPORT virtual void activateSelectionAndFilters(ModuleBase_ModelWidget* theWidget) = 0;
-
protected:
ModuleBase_IWorkshop* myWorkshop; ///< active workshop
};
std::cout << "PartSet_SketcherReentrantMgr::deleteInternalFeature: "
<< myInternalFeature->data()->name() << std::endl;
#endif
- if (myInternalActiveWidget) {
- ModuleBase_WidgetSelector* aWSelector =
- dynamic_cast<ModuleBase_WidgetSelector*>(myInternalActiveWidget);
- if (aWSelector)
- myWorkshop->selectionActivate()->activateSelectionAndFilters(aWSelector);
+ if (myInternalActiveWidget)
myInternalActiveWidget = 0;
- }
delete myInternalWidget;
myInternalWidget = 0;
void XGUI_ActiveControlMgr::onSelectorDeactivated()
{
XGUI_ActiveControlSelector* aSelector = qobject_cast<XGUI_ActiveControlSelector*>(sender());
- if (!aSelector)
+ if (!aSelector || aSelector != myActiveSelector || !myActiveSelector)
return;
+ myActiveSelector->setActive(false);
myActiveSelector = NULL;
- aSelector->setActive(false);
-
XGUI_ActiveControlSelector* aSelectorToBeActivated = 0;
for (int i = 0, aCount = mySelectors.count(); i < aCount; i++)
{
emit noMoreWidgets(aPreviosAttributeID);
}
}
- emit propertyPanelActivated();
+ if (myActiveWidget)
+ emit propertyPanelActivated();
+ else
+ emit propertyPanelDeactivated();
myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
return true;
//********************************************************************
void XGUI_PropertyPanelSelector::setActive(const bool& isActive)
{
- if (isActive) {
- if (myWidgetToBeActivated)
- myPanel->activateWidget(myWidgetToBeActivated, true);
+ if (isActive && myWidgetToBeActivated) {
+ // e.g. widget sketch label
+ myPanel->activateWidget(myWidgetToBeActivated, true);
+ myWidgetToBeActivated = NULL;
return;
}
- ModuleBase_ModelWidget* aWidget = myPanel->activeWidget();
- if (aWidget && aWidget->needToBeActiated())
- {
- myWidgetToBeActivated = aWidget;
+
+ if (!isActive) { // on deactivating, store previous active widget
+ ModuleBase_ModelWidget* aWidget = myPanel->activeWidget();
+ if (aWidget && aWidget->needToBeActiated())
+ {
+ myWidgetToBeActivated = aWidget;
+ }
+ myPanel->activateWidget(NULL, false);
}
- myPanel->activateWidget(NULL, false);
}
//********************************************************************
}
}
-//**************************************************************
-void XGUI_SelectionActivate::activateSelectionAndFilters(ModuleBase_ModelWidget* theWidget)
-{
- // activate selection modes
- QIntList aModes;
- getSelectionModes(theWidget, aModes);
- activateObjects(aModes, getDisplayer()->displayedObjects(), true);
-
- // activate selection filters
- SelectMgr_ListOfFilter aSelectionFilters;
- getSelectionFilters(theWidget, aSelectionFilters);
- activateSelectionFilters(aSelectionFilters);
-}
-
//**************************************************************
void XGUI_SelectionActivate::getSelectionModes(ModuleBase_ModelWidget* theWidget,
QIntList& theModes)
XGUI_EXPORT void deactivateTrihedronInSelectionModes();
protected:
- /// Activate or deactivate selection and selection filters like the widget is active
- /// \param theWidget a source widget of selection modes/filters
- virtual void activateSelectionAndFilters(ModuleBase_ModelWidget* theWidget);
-
/// Returns selection modes of the widget
/// \param theWidget model widget
/// \param theModes selection modes