mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fixes for 107, properly handle undo/redo setting sketch mod, and set sketch mod on context menu actions
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2004-05 Ben Fry and Casey Reas
|
||||
Copyright (c) 2004-06 Ben Fry and Casey Reas
|
||||
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
||||
+11
-23
@@ -4,7 +4,7 @@
|
||||
Editor - main editor panel for the processing development environment
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2004-05 Ben Fry and Casey Reas
|
||||
Copyright (c) 2004-06 Ben Fry and Casey Reas
|
||||
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -790,7 +790,7 @@ public class Editor extends JFrame
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
textarea.cut();
|
||||
sketch.setModified();
|
||||
sketch.setModified(true);
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
@@ -807,7 +807,7 @@ public class Editor extends JFrame
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
textarea.paste();
|
||||
sketch.setModified();
|
||||
sketch.setModified(true);
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
@@ -898,11 +898,17 @@ public class Editor extends JFrame
|
||||
undoItem.setEnabled(true);
|
||||
undoItem.setText(undo.getUndoPresentationName());
|
||||
putValue(Action.NAME, undo.getUndoPresentationName());
|
||||
if (sketch != null) {
|
||||
sketch.setModified(true); // 0107
|
||||
}
|
||||
} else {
|
||||
this.setEnabled(false);
|
||||
undoItem.setEnabled(false);
|
||||
undoItem.setText("Undo");
|
||||
putValue(Action.NAME, "Undo");
|
||||
if (sketch != null) {
|
||||
sketch.setModified(false); // 0107
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -927,7 +933,6 @@ public class Editor extends JFrame
|
||||
|
||||
protected void updateRedoState() {
|
||||
if (undo.canRedo()) {
|
||||
this.setEnabled(true);
|
||||
redoItem.setEnabled(true);
|
||||
redoItem.setText(undo.getRedoPresentationName());
|
||||
putValue(Action.NAME, undo.getRedoPresentationName());
|
||||
@@ -1861,33 +1866,15 @@ public class Editor extends JFrame
|
||||
mess = mess.substring(javaLang.length());
|
||||
}
|
||||
error(mess);
|
||||
|
||||
//buttons.clearRun();
|
||||
buttons.clear();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public void finished() {
|
||||
running = false;
|
||||
buttons.clearRun();
|
||||
message("Done.");
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
public void message(String msg) {
|
||||
status.notice(msg);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public void messageClear(String msg) {
|
||||
status.unnotice(msg);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// ...................................................................
|
||||
|
||||
|
||||
@@ -1895,7 +1882,6 @@ public class Editor extends JFrame
|
||||
* Returns the edit popup menu.
|
||||
*/
|
||||
class TextAreaPopup extends JPopupMenu {
|
||||
//protected ReferenceKeys referenceItems = new ReferenceKeys();
|
||||
String currentDir = System.getProperty("user.dir");
|
||||
String referenceFile = null;
|
||||
|
||||
@@ -1910,6 +1896,7 @@ public class Editor extends JFrame
|
||||
cutItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
textarea.cut();
|
||||
sketch.setModified(true);
|
||||
}
|
||||
});
|
||||
this.add(cutItem);
|
||||
@@ -1926,6 +1913,7 @@ public class Editor extends JFrame
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
textarea.paste();
|
||||
sketch.setModified(true);
|
||||
}
|
||||
});
|
||||
this.add(item);
|
||||
|
||||
@@ -114,7 +114,7 @@ public class EditorListener {
|
||||
if (!editor.sketch.modified) {
|
||||
if ((code == KeyEvent.VK_BACK_SPACE) || (code == KeyEvent.VK_TAB) ||
|
||||
(code == KeyEvent.VK_ENTER) || ((c >= 32) && (c < 128))) {
|
||||
editor.sketch.setModified();
|
||||
editor.sketch.setModified(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -329,7 +329,7 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
editor.textarea.setSelectedText(replaceField.getText());
|
||||
//editor.setSketchModified(true);
|
||||
//editor.sketch.setCurrentModified(true);
|
||||
editor.sketch.setModified();
|
||||
editor.sketch.setModified(true);
|
||||
|
||||
// don't allow a double replace
|
||||
replaceButton.setEnabled(false);
|
||||
|
||||
+5
-3
@@ -715,8 +715,10 @@ public class Sketch {
|
||||
/**
|
||||
* Sets the modified value for the code in the frontmost tab.
|
||||
*/
|
||||
public void setModified() {
|
||||
current.modified = true;
|
||||
public void setModified(boolean state) {
|
||||
//System.out.println("setting modified to " + state);
|
||||
//new Exception().printStackTrace();
|
||||
current.modified = state;
|
||||
calcModified();
|
||||
}
|
||||
|
||||
@@ -1092,7 +1094,7 @@ public class Sketch {
|
||||
buffer.append('\n');
|
||||
buffer.append(editor.getText());
|
||||
editor.setText(buffer.toString(), 0, 0); // scroll to start
|
||||
setModified();
|
||||
setModified(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -919,7 +919,7 @@ public class AutoFormat {
|
||||
// replace with new bootiful text
|
||||
// selectionEnd hopefully at least in the neighborhood
|
||||
editor.setText(formattedText, selectionEnd, selectionEnd);
|
||||
editor.sketch.setModified();
|
||||
editor.sketch.setModified(true);
|
||||
|
||||
// warn user if there are too many parens in either direction
|
||||
if (paren != 0) {
|
||||
|
||||
@@ -7,6 +7,21 @@ releases will be super crusty.
|
||||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
ABOUT REV 0107 - 2 March 2006
|
||||
|
||||
More tweaks to "Save" to try an iron out further bugs, though these
|
||||
are more minor than the others.
|
||||
|
||||
+ cut/paste from the context menu (right-click) in the editor wasn't
|
||||
properly setting a sketch as modified.
|
||||
|
||||
+ set/unset the sketch's modified state as undo happens.
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=248
|
||||
|
||||
|
||||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
ABOUT REV 0106 - 1 March 2006
|
||||
|
||||
Fix for another major bug where sketches don't save properly if you
|
||||
|
||||
@@ -645,6 +645,7 @@ _ http://dev.processing.org/bugs/show_bug.cgi?id=127
|
||||
|
||||
PGraphicsGL
|
||||
|
||||
_ move to new implementation of jsr231 with new classes and launcher
|
||||
_ make a note about the anti-aliasing types in the faq
|
||||
_ y may be flipped in modelX/Y/Z stuff on opengl
|
||||
_ opengl doesn't work in applets
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
0107 pde
|
||||
X fix yet another save bug, context menu paste/cut not setting modified
|
||||
X undoing to the code's original state won't unset it as "modified"
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=248
|
||||
|
||||
_ fix linux dist script.. not sure what's going on
|
||||
_ no relative paths, etc
|
||||
|
||||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
_ antlr.jar in the classpath will cause trouble..
|
||||
_ jogl jar files, or jogl install will cause trouble
|
||||
_ /System/Library/Extensions or /Library/Extensions
|
||||
|
||||
_ finish updates for osx and opengl
|
||||
_ http://developer.apple.com/qa/qa2005/qa1295.html
|
||||
@@ -339,8 +347,6 @@ _ http://processing.org/bugs/show_bug.cgi?id=51
|
||||
_ code coloring is imperfect because it's not based on a parser
|
||||
_ i.e. mousePressed() is red but mouseMoved() is brown
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=113
|
||||
_ undoing to the code's original state won't unset it as "modified"
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=248
|
||||
|
||||
|
||||
PDE / Editor Buttons
|
||||
|
||||
Reference in New Issue
Block a user