diff --git a/processing/app/PdeCode.java b/processing/app/PdeCode.java index 3c6e0ec3a..96aa0e404 100644 --- a/processing/app/PdeCode.java +++ b/processing/app/PdeCode.java @@ -73,6 +73,9 @@ public class PdeCode { //history.record(s, PdeHistory.SAVE); try { + System.out.println("saving to " + file); + System.out.println("stuff to save: " + program); + System.out.println("-------"); PdeBase.saveFile(program, file); } catch (Exception e) { diff --git a/processing/app/PdeEditor.java b/processing/app/PdeEditor.java index 83af6ca6b..655b2ff33 100644 --- a/processing/app/PdeEditor.java +++ b/processing/app/PdeEditor.java @@ -1377,6 +1377,7 @@ public class PdeEditor extends JFrame // so that checkModified2 will just do nothing checking = 0; } + message("Done Saving."); buttons.clear(); } diff --git a/processing/app/PdeEditorHeader.java b/processing/app/PdeEditorHeader.java index 42951b28b..8284b7f1d 100644 --- a/processing/app/PdeEditorHeader.java +++ b/processing/app/PdeEditorHeader.java @@ -369,19 +369,21 @@ public class PdeEditorHeader extends JComponent /*implements MouseListener*/ { menu.add(unhide); - menu.addSeparator(); + if (sketch != null) { + menu.addSeparator(); - ActionListener jumpListener = new ActionListener() { - public void actionPerformed(ActionEvent e) { - //System.out.println("jump to " + e.getActionCommand()); - System.out.println("jump to " + e); - } - }; - for (int i = 0; i < sketch.codeCount; i++) { - item = new JMenuItem(sketch.code[i].name); - //item.setActionCommand(files[i]); - item.addActionListener(jumpListener); - menu.add(item); + ActionListener jumpListener = new ActionListener() { + public void actionPerformed(ActionEvent e) { + //System.out.println("jump to " + e.getActionCommand()); + System.out.println("jump to " + e); + } + }; + for (int i = 0; i < sketch.codeCount; i++) { + item = new JMenuItem(sketch.code[i].name); + //item.setActionCommand(files[i]); + item.addActionListener(jumpListener); + menu.add(item); + } } } diff --git a/processing/app/PdeSketch.java b/processing/app/PdeSketch.java index b1e22ba9c..c5288e3f0 100644 --- a/processing/app/PdeSketch.java +++ b/processing/app/PdeSketch.java @@ -199,9 +199,6 @@ public class PdeSketch { } } - // set the main file to be the current tab - current = code[0]; - // cheap-ass sort of the rest of the files // it's a dumb, slow sort, but there shouldn't be more than ~5 files for (int i = 1; i < codeCount; i++) { @@ -217,6 +214,10 @@ public class PdeSketch { code[i] = temp; } } + + // set the main file to be the current tab + //current = code[0]; + setCurrent(0); } @@ -226,6 +227,7 @@ public class PdeSketch { //public void setCurrentModified(boolean what) { //public void setModified(boolean what) { public void setModified() { + System.out.println("setting modified for " + current.program); //modified = true; current.modified = true; //editor.header.repaint(); @@ -261,6 +263,11 @@ public class PdeSketch { * Save all code in the current sketch. */ public void save() throws IOException { + // get the current text area + if (current.modified) { + current.program = editor.getText(); + } + // check if the files are read-only. // if so, need to first do a "save as". if (modified && isReadOnly()) { @@ -272,7 +279,7 @@ public class PdeSketch { } for (int i = 0; i < codeCount; i++) { - code[i].save(); + if (code[i].modified) code[i].save(); } calcModified(); } @@ -286,6 +293,8 @@ public class PdeSketch { public void saveAs() { System.err.println("need to save ass here. code not yet finished."); + + // mark all files as modified so that it will save them } @@ -365,6 +374,8 @@ public class PdeSketch { // and i'll personally make a note of the change //current = which; + + editor.header.rebuild(); } diff --git a/processing/build/shared/lib/buttons.gif b/processing/build/shared/lib/buttons.gif index af46dfc71..f03ec8f90 100644 Binary files a/processing/build/shared/lib/buttons.gif and b/processing/build/shared/lib/buttons.gif differ diff --git a/processing/build/shared/lib/pde.properties b/processing/build/shared/lib/pde.properties index 253b8d9d2..91c6b74c0 100644 --- a/processing/build/shared/lib/pde.properties +++ b/processing/build/shared/lib/pde.properties @@ -89,7 +89,7 @@ buttons.status.color = #333322 # settings for the tabs at the top # actual tab images are stored in the lib/ folder -header.bgcolor = #333322 +header.bgcolor = #4C4C3E header.text.selected.color = #ffffff header.text.unselected.color = #999988 header.text.font = SansSerif,plain,12