Skip to content

Commit 0f48619

Browse files
committed
stop button (issue processing#561) and unexpected token void (issue processing#551)
1 parent e11b291 commit 0f48619

File tree

3 files changed

+32
-30
lines changed

3 files changed

+32
-30
lines changed

app/src/processing/app/EditorToolbar.java

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,6 @@
3535
*/
3636
public abstract class EditorToolbar extends JComponent implements MouseInputListener, KeyListener {
3737

38-
// /** Rollover titles for each button. */
39-
// static final String title[] = {
40-
// "Run", "Stop", "New", "Open", "Save", "Export"
41-
// };
42-
//
43-
// /** Titles for each button when the shift key is pressed. */
44-
// static final String titleShift[] = {
45-
// "Present", "Stop", "New Editor Window", "Open in Another Window", "Save", "Export to Application"
46-
// };
47-
48-
49-
// static final int BUTTON_COUNT = title.length;
5038
/** Width of each toolbar button. */
5139
static final int BUTTON_WIDTH = 27;
5240
/** Height of each toolbar button. */
@@ -279,6 +267,20 @@ public void paintComponent(Graphics screen) {
279267
}
280268
}
281269

270+
271+
protected void checkRollover(int x, int y) {
272+
Button over = findSelection(x, y);
273+
if (over != null) {
274+
// if (state[sel] != ACTIVE) {
275+
if (over.state != ACTIVE) {
276+
// setState(sel, ROLLOVER, true);
277+
over.setState(ROLLOVER, true);
278+
// currentRollover = sel;
279+
rollover = over;
280+
}
281+
}
282+
}
283+
282284

283285
public void mouseMoved(MouseEvent e) {
284286
if (!isEnabled()) return;
@@ -310,17 +312,7 @@ public void mouseMoved(MouseEvent e) {
310312
rollover = null;
311313
}
312314
}
313-
// int sel = findSelection(x, y);
314-
Button over = findSelection(x, y);
315-
if (over != null) {
316-
// if (state[sel] != ACTIVE) {
317-
if (over.state != ACTIVE) {
318-
// setState(sel, ROLLOVER, true);
319-
over.setState(ROLLOVER, true);
320-
// currentRollover = sel;
321-
rollover = over;
322-
}
323-
}
315+
checkRollover(x, y);
324316
}
325317

326318

@@ -442,6 +434,10 @@ public void mousePressed(MouseEvent e) {
442434
popup.show(this, x, y);
443435
}
444436

437+
// Need to reset the rollover here. If the window isn't active,
438+
// the rollover wouldn't have been updated.
439+
// http://code.google.com/p/processing/issues/detail?id=561
440+
checkRollover(x, y);
445441
if (rollover != null) {
446442
//handlePressed(rollover);
447443
handlePressed(e, buttons.indexOf(rollover));

app/src/processing/mode/java/preproc/PdePreprocessor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,10 @@ static String substituteUnicode(String program) {
373373
}
374374

375375
private static final Pattern PUBLIC_CLASS =
376-
Pattern.compile("(^|;)\\s*public\\s+class", Pattern.MULTILINE);
376+
Pattern.compile("(^|;)\\s*public\\s+class\\s+\\S+\\s+extends\\s+PApplet", Pattern.MULTILINE);
377+
// Can't only match any 'public class', needs to be a PApplet
378+
// http://code.google.com/p/processing/issues/detail?id=551
379+
//Pattern.compile("(^|;)\\s*public\\s+class", Pattern.MULTILINE);
377380

378381
private static final Pattern FUNCTION_DECL =
379382
Pattern.compile("(^|;)\\s*((public|private|protected|final|static)\\s+)*" +

todo.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
0195 (pre)
2+
X Sketch restarts automatically after pressing stop button on PDE
3+
X problem with window focus issues
4+
X http://code.google.com/p/processing/issues/detail?id=561
5+
X 'unexpected token void' for any type of error
6+
X (due to fallback in preprocessor)
7+
X 'public' keyword in class declarations breaks syntax checker
8+
X http://code.google.com/p/processing/issues/detail?id=551
29

310
earlier
411
X Unsatisfied Link Error running OPENGL on 64-bit ubuntu
@@ -13,10 +20,6 @@ _ this might be the same as arduino?
1320

1421

1522
regressions
16-
_ from jer: 'unexpected token void' for any type of error
17-
_ (due to fallback in preprocessor)
18-
_ 'public' keyword in class declarations breaks syntax checker
19-
_ http://code.google.com/p/processing/issues/detail?id=551
2023
_ strange window flicker when first opened
2124
_ test libraries on android
2225
_ test .java files on desktop version
@@ -60,8 +63,6 @@ http://stackoverflow.com/questions/1611357/how-to-make-a-jar-file-that-include-d
6063

6164
_ p5 assets need to be licensed differently from the source
6265

63-
DO NOT USE "JVMArchs". It is deprecated, and manually overrides the natural architecture launching and ordering that LaunchServices does, including accommodating the 32-bit checkbox in the Get Info window.
64-
6566
_ casey's vote:
6667
_ Standard, Android, JavaScript, Jython
6768
_ or: Processing, Android, Processing.js, Processing.py
@@ -1421,6 +1422,8 @@ _ http://dev.processing.org/bugs/show_bug.cgi?id=1513
14211422

14221423
DIST / Mac OS X
14231424

1425+
_ the word from apple on Info.plist setup
1426+
DO NOT USE "JVMArchs". It is deprecated, and manually overrides the natural architecture launching and ordering that LaunchServices does, including accommodating the 32-bit checkbox in the Get Info window.
14241427
_ instead of "show sketch folder" method, use:
14251428
The com.apple.eio.FileManager now has two new desktop interaction methods, revealInFinder(File) and moveToTrash(File). You can use revealInFinder() to open a Finder window in the parent directory of of a file and select it. You can use moveToTrash() to move a file to the most appropriate Trash directory for the volume that contains that file.
14261429
_ setup() and draw() are not bold on osx (10.4)

0 commit comments

Comments
 (0)