()
| 5837 | } |
| 5838 | |
| 5839 | void waitForUser() { |
| 5840 | IJ.wait(50); |
| 5841 | if (waitForUserDialog!=null && waitForUserDialog.isShowing()) |
| 5842 | interp.error("Duplicate call"); |
| 5843 | String title = "Action Required"; |
| 5844 | String text = " Click \"OK\" to continue "; |
| 5845 | if (interp.nextToken()=='(') { |
| 5846 | title = getFirstString(); |
| 5847 | if (interp.nextToken()==',') |
| 5848 | text = getLastString(); |
| 5849 | else { |
| 5850 | text = title; |
| 5851 | title = "Action Required"; |
| 5852 | interp.getRightParen(); |
| 5853 | } |
| 5854 | } |
| 5855 | waitForUserDialog = new WaitForUserDialog(title, text); |
| 5856 | Interpreter instance = Interpreter.getInstance(); |
| 5857 | interp.waitingForUser = true; |
| 5858 | waitForUserDialog.show(); |
| 5859 | interp.waitingForUser = false; |
| 5860 | Interpreter.setInstance(instance); // works around bug caused by use of drawing tools |
| 5861 | if (waitForUserDialog.escPressed() || IJ.escapePressed()) |
| 5862 | throw new RuntimeException(Macro.MACRO_CANCELED); |
| 5863 | } |
| 5864 | |
| 5865 | void abortDialog() { |
| 5866 | if (waitForUserDialog!=null && waitForUserDialog.isVisible()) |
no test coverage detected