FlexPainterInit.js 1.2 KB

12345678910111213141516171819202122232425
  1. /**
  2. * Adds a menu for this action to Examples/Math Examples/FlexPainter.
  3. */
  4. // Based on both Math Examples and other snips
  5. function init(basePath) {
  6. // Prevent FlexPainter to be loaded without PRO resources
  7. if (!hasPlugin("PROTOOLS")) { return; };
  8. // -> Continue with PRO resources
  9. var action = new RGuiAction(qsTr("&FlexPainter"), RMainWindowQt.getMainWindow());
  10. var tip = qsTranslate("FlexPainter", "Paints over selection mimicking a roller stamp");
  11. action.setRequiresDocument(true);
  12. action.setRequiresSelection(true);
  13. action.setScriptFile(basePath + "/FlexPainter.js");
  14. action.setIcon(basePath + "/FlexPainter.svg");
  15. action.setDefaultShortcut(new QKeySequence("f,p"));
  16. action.setDefaultCommands(["flexpainter", "fp"]); // A list array separated by comma + space
  17. action.setStatusTip(tip); // Overtakes and displays left in the Status Bar
  18. action.setToolTip(tip); // Displays aside near Toolbars
  19. action.setNoState(true); // Indicates whether this action is stateless (i.e. terminates in beginEvent).
  20. action.setGroupSortOrder(79700);
  21. action.setSortOrder(300);
  22. action.setWidgetNames(["MathExamplesMenu"]);
  23. };