/// \return State of editing mode flag
bool isEditingMode() const { return myIsEditing; }
+ /// Set focus on the Ok button
+ virtual void setFocusOnOkButton() = 0;
+
/// Set Enable/Disable state of Cancel button
/// \param theEnabled Enable/Disable state of Cancel button
virtual void setCancelEnabled(bool theEnabled) = 0;
}
}
+void XGUI_PropertyPanel::setFocusOnOkButton()
+{
+ QToolButton* anOkBtn = findChild<QToolButton*>(PROP_PANEL_OK);
+ anOkBtn->setFocus();
+}
+
void XGUI_PropertyPanel::setCancelEnabled(bool theEnabled)
{
QToolButton* anCancelBtn = findChild<QToolButton*>(PROP_PANEL_CANCEL);
/// Activate the next from current widget in the property panel
virtual void activateNextWidget();
+ /// Set focus on the Ok button
+ virtual void setFocusOnOkButton();
+
/// Set Enable/Disable state of Cancel button
/// \param theEnabled Enable/Disable state of Cancel button
virtual void setCancelEnabled(bool theEnabled);
aViewAct->setEnabled(true);
myPropertyPanel->show();
myPropertyPanel->raise();
+
+ // The next code is necessary to made the property panel the active window
+ // in order to operation manager could process key events of the panel.
+ // otherwise they are ignored. It happens only if the same(activateWindow) is
+ // not happend by property panel activation(e.g. resume operaion of Sketch)
+ myPropertyPanel->activateWindow();
+ myPropertyPanel->setFocus();
}
//******************************************************
///<! Do not allow to show empty property panel
aViewAct->setEnabled(false);
myPropertyPanel->hide();
+
+ // the property panel is active window of the desktop, when it is
+ // hidden, it is undefined which window becomes active. By this reason
+ // it is defined to perform the desktop as the active window.
+ // in SALOME mode, workstack made the PyConsole the active window,
+ // set the focus on it. As a result, shortcuts of the application, like
+ // are processed by this console. For example Undo actions.
+ // It is possible that this code is to be moved to NewGeom package
+ QMainWindow* aDesktop = isSalomeMode() ? salomeConnector()->desktop() : myMainWindow;
+ aDesktop->activateWindow();
+ aDesktop->setFocus();
}
//******************************************************