| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- include("scripts/EAction.js");
- /**
- * \class Interaction
- * \brief Base class for all Interaction menu entries.
- * \ingroup ecma_Interaction
- */
- function Interaction(guiAction) {
- EAction.call(this, guiAction);
- }
- Interaction.prototype = new EAction();
- Interaction.includeBasePath = includeBasePath;
- Interaction.openUrl = function(url) {
- QDesktopServices.openUrl(new QUrl(url));
- };
- Interaction.getMenu = function() {
- var menu = EAction.getMenu(Interaction.getTitle(), "InteractionMenu");
- menu.setProperty("scriptFile", Interaction.includeBasePath + "/Interaction.js");
- return menu;
- };
- Interaction.getToolBar = function() {
- var tb = EAction.getToolBar(Interaction.getTitle(), "InteractionToolBar");
- // if (tb.property("Initialized")!==true) {
- // tb.visible = false;
- // }
- return tb;
- };
- Interaction.getCadToolBarPanel = function() {
- var mtb = EAction.getMainCadToolBarPanel();
- var actionName = "InteractionToolsPanelAction";
- if (!isNull(mtb) && mtb.findChild(actionName)==undefined) {
- var action = new RGuiAction(qsTr("Interaction Tools"), mtb);
- action.setScriptFile(Interaction.includeBasePath + "/Interaction.js");
- action.objectName = actionName;
- action.setRequiresDocument(true);
- // action.setIcon(Data.includeBasePath + "/Data.svg");
- //action.setStatusTip(qsTr("Show layer tools"));
- // action.setDefaultShortcut(new QKeySequence("w,y"));
- action.setNoState();
- action.setDefaultCommands(["InteractionMenu"]);
- action.setGroupSortOrder(20);
- action.setSortOrder(101);
- action.setWidgetNames(["!MainToolsPanel"]);
- }
- var tb = EAction.getCadToolBarPanel(
- Interaction.getTitle(),
- "InteractionToolsPanel",
- true
- );
- return tb;
- };
- Interaction.getToolMatrixPanel = function() {
- RSettings.setValue("Interaction/VisibleInMatrixPanel", false, false);
- return EAction.getToolMatrixPanel(Interaction.getTitle(), "InteractionMatrixPanel", 2000);
- };
- Interaction.getTitle = function() {
- return qsTr("&交互设计");
- };
- Interaction.prototype.getTitle = function() {
- return Interaction.getTitle();
- };
- Interaction.init = function() {
- Interaction.getMenu();
- Interaction.getToolBar();
- Interaction.getCadToolBarPanel();
- Interaction.getToolMatrixPanel();
- };
|