diff --git a/processing/app/PdeEditor.java b/processing/app/PdeEditor.java index 871a81033..21ef36a07 100644 --- a/processing/app/PdeEditor.java +++ b/processing/app/PdeEditor.java @@ -760,7 +760,7 @@ public class PdeEditor extends JFrame public void actionPerformed(ActionEvent e) { // TODO find next should only be enabled after a // search has actually taken place - find.find(); + find.find(true); } }); menu.add(item); diff --git a/processing/app/PdeEditorFind.java b/processing/app/PdeEditorFind.java index 6a9c8d56c..84e68e5b5 100644 --- a/processing/app/PdeEditorFind.java +++ b/processing/app/PdeEditorFind.java @@ -4,8 +4,8 @@ PdeEditorFind - find/replace window for processing Part of the Processing project - http://processing.org - Except where noted, code is written by Ben Fry and - Copyright (c) 2001-03 Massachusetts Institute of Technology + Except where noted, code is written by Ben Fry and is + Copyright (c) 2001-04 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -104,7 +104,7 @@ public class PdeEditorFind extends JFrame implements ActionListener { pain.add(buttons); // 0069 TEMPORARILY DISABLED! - replaceAllButton.setEnabled(false); + //replaceAllButton.setEnabled(false); // to fix ugliness.. normally macosx java 1.3 puts an // ugly white border around this object, so turn it off. @@ -159,7 +159,7 @@ public class PdeEditorFind extends JFrame implements ActionListener { Object source = e.getSource(); if (source == findButton) { - find(); + find(true); } else if (source == replaceButton) { replace(); @@ -175,7 +175,7 @@ public class PdeEditorFind extends JFrame implements ActionListener { // once found, select it (and go to that line) - public void find() { + public void find(boolean wrap) { // in case search len is zero, // otherwise replace all will go into an infinite loop found = false; @@ -196,8 +196,12 @@ public class PdeEditorFind extends JFrame implements ActionListener { int nextIndex = text.indexOf(search, selectionEnd); if (nextIndex == -1) { - nextIndex = text.indexOf(search, 0); - if (nextIndex == -1) { // wrapping + if (wrap) { + // if wrapping, a second chance is ok, start from beginning + nextIndex = text.indexOf(search, 0); + } + + if (nextIndex == -1) { found = false; replaceButton.setEnabled(false); //Toolkit.getDefaultToolkit().beep(); @@ -238,8 +242,11 @@ public class PdeEditorFind extends JFrame implements ActionListener { // keep doing find and replace alternately until nothing more found public void replaceAll() { + // move to the beginning + editor.textarea.select(0, 0); + do { - find(); + find(false); replace(); } while (found); } diff --git a/processing/app/PdeSketchbook.java b/processing/app/PdeSketchbook.java index 3a6f930c6..d6ccf9d9a 100644 --- a/processing/app/PdeSketchbook.java +++ b/processing/app/PdeSketchbook.java @@ -114,7 +114,7 @@ public class PdeSketchbook { if (!startup) { // prompt for the filename and location for the new sketch - FileDialog fd = new FileDialog(new Frame(), + FileDialog fd = new FileDialog(editor, //new Frame(), //"Create new sketch named", "Create sketch folder named:", FileDialog.SAVE); diff --git a/processing/todo.txt b/processing/todo.txt index c3f06413c..a3a895cc8 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -82,11 +82,27 @@ X http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs 040622 monday evening X jikes errors have no newlines because it's a buffered reader X and the newlines are removed when read +X make the filedialog come up with the p5 window on handlenew +X sets the parent frame to the PdeEditor +X find() hangs on replacing "println" with "//println" +X "replace all" should start at the beginning of the buffer, move to end +X after replace all, caret moves to end of document +X http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1076740626 +X http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1080213711 +X http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1083093129 + +_ maybe bring back the prompt option for "new sketch" +_ sometimes nice just to have it create an unnamed sketch quickly +_ shift-new will always prompt with filedialog + +_ bug: after using sketchbook menu as popup, disappears from file menu +_ probably just need to build two +_ the popup from the toolbar needs an "Open..." on it as well _ dashes shouldn't be allowed in filenames for sketches _ actually, lost the naming stuff because now using FileDialog _ this also needs to be checked when building the sketch menu -_ bug: after using sketchbook menu as popup, disappears from file menu + _ re-implement history _ what happens when the .pde file isn't named _ the same as the enclosing folder? @@ -138,15 +154,9 @@ _ or with spaces in the folder name, causes problems for serial notes for release _ quicktime full uninstall/reinstall _ code folder problems -_ find bug _ hm, lots of other bugs from this list.. _ update readme with notes from bboard about "built with processing" -_ find() hangs on replacing "println" with "//println" -_ http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1076740626 -_ http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1080213711 -_ http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1083093129 - _ add mkdmg script to macosx build process _ could significantly speed things up @@ -421,7 +431,6 @@ PDE / Details 1 _ need to tie this to the parser instead 1 _ do a better job of maintaining cursor during beautify - 1 _ find/replace 1 _ add support for hitting 'ESC' 1 _ option to ignore or match case @@ -430,6 +439,7 @@ PDE / Details 1 _ right now, typing works, but no caret, no blue highlight 1 _ and on second find run, should instead select all the find string 1 _ so that typing will replace it directly + 1 _ only enable "find next" in menu after a find has happened 1 _ rename/saveas doesn't properly have its focus set 1 _ the whole thing is selected, but not directly editable