bool isFirstControl = !theIsNext;
QWidget* aLastFocusControl = myActiveWidget->getControlAcceptingFocus(isFirstControl);
if (aFocusWidget == aLastFocusControl) {
- setActiveWidget(NULL);
+ setActiveWidget(NULL, false);
}
}
aPreviosAttributeID = myActiveWidget->attributeID();
// Avoid activation of already actve widget. It could happen on focusIn event many times
- if (setActiveWidget(theWidget) && theEmitSignal) {
- emit widgetActivated(myActiveWidget);
- if (!myActiveWidget && !isEditingMode()) {
- emit noMoreWidgets(aPreviosAttributeID);
- }
- }
+ setActiveWidget(theWidget, theEmitSignal);
}
-bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget)
+bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget, const bool isEmitSignal)
{
// Avoid activation of already actve widget. It could happen on focusIn event many times
if (theWidget == myActiveWidget) {
theWidget->activate();
}
myActiveWidget = theWidget;
- myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
- myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
#ifdef DEBUG_ACTIVE_WIDGET
std::cout << "myActiveWidget = " << (theWidget ? theWidget->context().c_str() : "") << std::endl;
static Events_ID anEvent = Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION);
Events_Loop::loop()->flush(anEvent);
+ if (isEmitSignal) {
+ emit widgetActivated(myActiveWidget);
+ if (!myActiveWidget && !isEditingMode()) {
+ emit noMoreWidgets(aPreviosAttributeID);
+ }
+ }
+ emit propertyPanelActivated();
+ myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
+ myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
return true;
}
/// \param theObject a sender of the event
void enterClicked(QObject* theObject);
- /// Emits on clear content
+ /// Emits on deactivating property panel (e.g. by clearContent)
void propertyPanelDeactivated();
+ /// Emits on widget activating
+ void propertyPanelActivated();
protected:
/// Makes the widget active, deactivate the previous, activate and hightlight the given one
/// \param theWidget a widget
- bool setActiveWidget(ModuleBase_ModelWidget* theWidget);
+ /// \param isEmitSignal flag whether panel signals should be emitted
+ bool setActiveWidget(ModuleBase_ModelWidget* theWidget, const bool isEmitSignal);
/// The parent method that processes the "Tab"/"SHIF + Tab" keyboard events
/// Emits a signal about focus change
/// If theIsNext is true, this function searches forward, if next is false, it searches backward.
XGUI_PropertyPanelSelector::XGUI_PropertyPanelSelector(XGUI_PropertyPanel* thePanel)
: myPanel(thePanel), myWidgetToBeActivated (NULL)
{
- connect(myPanel, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)), this, SIGNAL(activated()));
+ connect(myPanel, SIGNAL(propertyPanelActivated()), this, SIGNAL(activated()));
connect(myPanel, SIGNAL(propertyPanelDeactivated()), this, SIGNAL(deactivated()));
}