diff --git a/processing/app/PdeEditor.java b/processing/app/PdeEditor.java index 9b5ee1798..8855fe1de 100644 --- a/processing/app/PdeEditor.java +++ b/processing/app/PdeEditor.java @@ -213,12 +213,30 @@ public class PdeEditor extends Panel { // full screen window needs to have method to stop // for now, click on small 'stop' text in lower-lefthand corner // will a label catch mouse events? + //Label label = new Label("stop"); Label label = new Label("stop"); + //label.setBackground(Color.red); + label.addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent e) { + //System.out.println("got stop"); + doStop(); + +#ifdef JDK13 + // move editor to front in case it was hidden + frame.setState(Frame.NORMAL); +#endif + //frame.hide(); + //frame.show(); + } + }); + + //Dimension labelSize = label.getPreferredSize(); + Dimension labelSize = new Dimension(60, 20); presentationWindow.setLayout(null); presentationWindow.add(label); - Dimension labelSize = label.getPreferredSize(); label.setBounds(5, screen.height - 5 - labelSize.height, labelSize.width, labelSize.height); + //System.out.println(labelSize + " " + label.getBounds()); Color presentationBgColor = PdeBase.getColor("run.present.bgcolor", new Color(102, 102, 102)); @@ -232,11 +250,17 @@ public class PdeEditor extends Panel { } ); */ + + // windowActivated doesn't seem to do much, so focus listener better presentationWindow.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent e) { - //System.out.println("activated"); - /*PdeApplication.*/ + //System.out.println("pwindow activated"); + // editor doesn't necessarily have to be on top + //presentationWindow.toBack(); if (frame != null) frame.toFront(); + try { + ((KjcEngine)(runner.engine)).window.toFront(); + } catch (Exception ex) { } } } ); @@ -285,6 +309,12 @@ public class PdeEditor extends Panel { //#endif public void doStop() { + if (presenting) { + presenting = false; // to avoid endless recursion + doClose(); + presentationWindow.hide(); + } + //#ifdef RECORDER // if (!running) return; //#endif @@ -292,15 +322,16 @@ public class PdeEditor extends Panel { buttons.clear(); running = false; - if (presenting) { - presentationWindow.hide(); - presenting = false; - } + //if (presenting) { + //presentationWindow.hide(); + //presenting = false; + //} } // this is the former 'kill' function // may just roll this in with the other code + // -> keep this around for closing the external window public void doClose() { if (running) { //System.out.println("was running, will call doStop()"); diff --git a/processing/app/notes.txt b/processing/app/notes.txt index 24d729948..13bf4606f 100644 --- a/processing/app/notes.txt +++ b/processing/app/notes.txt @@ -1,3 +1,13 @@ +ABOUT REV 0034 + +- fixed the problems with launching applets, implemented frame + around the applet being run, also implemented presentation mode + +- with any luck this one should be a little more stable than some + of these other ones in the 30s series that i keep releasing without + any sensible amount of quality control. + + ABOUT REV 0033 - duplicate and rename now implemented, more (should be all) of