+ if (myActiveWidget)
+ emit propertyPanelActivated();
+ else
+ emit propertyPanelDeactivated();
+ myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
+ myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
+ return true;
+}
+
+void XGUI_PropertyPanel::setFocusOnOkButton()
+{
+ QToolButton* anOkBtn = findButton(PROP_PANEL_OK);
+ ModuleBase_Tools::setFocus(anOkBtn, "XGUI_PropertyPanel::setFocusOnOkButton()");
+}
+
+void XGUI_PropertyPanel::setCancelEnabled(bool theEnabled)
+{
+ QToolButton* anCancelBtn = findButton(PROP_PANEL_CANCEL);
+ anCancelBtn->setEnabled(theEnabled);
+}
+
+bool XGUI_PropertyPanel::isCancelEnabled() const
+{
+ QToolButton* anCancelBtn = findButton(PROP_PANEL_CANCEL);
+ return anCancelBtn->isEnabled();
+}
+
+void XGUI_PropertyPanel::setEditingMode(bool isEditing)
+{
+ ModuleBase_IPropertyPanel::setEditingMode(isEditing);
+ foreach(ModuleBase_ModelWidget* aWgt, myWidgets) {
+ aWgt->setEditingMode(isEditing);
+ }
+}
+
+void XGUI_PropertyPanel::setupActions(XGUI_ActionsMgr* theMgr)
+{
+ QStringList aButtonNames;
+ aButtonNames << PROP_PANEL_OK << PROP_PANEL_CANCEL << PROP_PANEL_HELP << PROP_PANEL_PREVIEW;
+ QList<XGUI_ActionsMgr::OperationStateActionId> aActionIds;
+ aActionIds << XGUI_ActionsMgr::Accept << XGUI_ActionsMgr::Abort << XGUI_ActionsMgr::Help
+ << XGUI_ActionsMgr::Preview;
+ for (int i = 0; i < aButtonNames.size(); ++i) {
+ QToolButton* aBtn = findButton(aButtonNames.at(i).toStdString().c_str());
+ QAction* anAct = theMgr->operationStateAction(aActionIds.at(i));
+ aBtn->setDefaultAction(anAct);
+ }
+}
+
+ModuleBase_ModelWidget* XGUI_PropertyPanel::preselectionWidget() const
+{
+ return myPreselectionWidget;
+}
+
+void XGUI_PropertyPanel::setPreselectionWidget(ModuleBase_ModelWidget* theWidget)
+{
+ myPreselectionWidget = theWidget;
+}
+
+
+void XGUI_PropertyPanel::closeEvent(QCloseEvent* theEvent)
+{
+ ModuleBase_Operation* aOp = myOperationMgr->currentOperation();
+ if (aOp) {
+ if (myOperationMgr->canStopOperation(aOp)) {
+ myOperationMgr->abortOperation(aOp);
+ if (myOperationMgr->hasOperation())
+ theEvent->ignore();
+ else
+ theEvent->accept();
+ } else
+ theEvent->ignore();
+ } else
+ ModuleBase_IPropertyPanel::closeEvent(theEvent);