mirror of
https://github.com/processing/processing4.git
synced 2026-02-11 17:40:48 +01:00
fix so that both sketchbook menus work
This commit is contained in:
@@ -44,6 +44,7 @@ public class PdeSketchbook {
|
||||
PdeEditor editor;
|
||||
|
||||
JMenu menu;
|
||||
JMenu popup;
|
||||
//File sketchbookFolder;
|
||||
//String sketchbookPath; // canonical path
|
||||
|
||||
@@ -91,6 +92,7 @@ public class PdeSketchbook {
|
||||
if (!sketchbookFolder.exists()) sketchbookFolder.mkdirs();
|
||||
}
|
||||
menu = new JMenu("Sketchbook");
|
||||
popup = new JMenu("Sketchbook");
|
||||
}
|
||||
|
||||
|
||||
@@ -213,30 +215,48 @@ public class PdeSketchbook {
|
||||
|
||||
|
||||
public JPopupMenu getPopupMenu() {
|
||||
return menu.getPopupMenu();
|
||||
//return menu.getPopupMenu();
|
||||
return popup.getPopupMenu();
|
||||
}
|
||||
|
||||
//public void rebuildPopup(JPopupMenu popup) {
|
||||
//rebuildMenu();
|
||||
//popup.
|
||||
//}
|
||||
|
||||
|
||||
/**
|
||||
* Rebuild the menu full of sketches based on the
|
||||
* contents of the sketchbook.
|
||||
*
|
||||
* Creates a separate JMenu object for the popup,
|
||||
* because it seems that after calling "getPopupMenu"
|
||||
* the menu will disappear from its original location.
|
||||
*/
|
||||
public JMenu rebuildMenu() {
|
||||
menu.removeAll();
|
||||
popup.removeAll();
|
||||
|
||||
try {
|
||||
//addSketches(menu, new File(PdePreferences.get("sketchbook.path")));
|
||||
//JMenuItem item = PdeEditor.newJMenuItem("Open...");
|
||||
JMenuItem item = new JMenuItem("Open...");
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
editor.handleOpen(null);
|
||||
}
|
||||
});
|
||||
popup.add(item);
|
||||
popup.addSeparator();
|
||||
|
||||
addSketches(menu, new File(PdePreferences.get("sketchbook.path")));
|
||||
addSketches(popup, new File(PdePreferences.get("sketchbook.path")));
|
||||
|
||||
menu.addSeparator();
|
||||
popup.addSeparator();
|
||||
|
||||
addSketches(menu, examplesFolder);
|
||||
addSketches(popup, examplesFolder);
|
||||
|
||||
} catch (IOException e) {
|
||||
PdeBase.showWarning("Problem while building sketchbook menu",
|
||||
"There was a problem with building the\n" +
|
||||
"sketchbook menu. Things might get a little\n" +
|
||||
"kooky around here.\n", e);
|
||||
//e.printStackTrace();
|
||||
"kooky around here.", e);
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
|
||||
@@ -90,20 +90,14 @@ 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
|
||||
X after using sketchbook menu as popup, disappears from file menu
|
||||
X probably just need to build two
|
||||
X 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
|
||||
|
||||
_ re-implement history
|
||||
_ what happens when the .pde file isn't named
|
||||
_ the same as the enclosing folder?
|
||||
_ maybe put up a window saying no way, and ask:
|
||||
@@ -121,12 +115,18 @@ _ ctrl-5 (at least on xp) is marking the current sketch as modified
|
||||
_ running present mode with a bug in the program hoses things
|
||||
_ make sure the program compiles before starting present mode
|
||||
_ if 'applet.html' is in sketch folder, use that as the template
|
||||
_ re-implement history
|
||||
|
||||
_ 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
|
||||
|
||||
|
||||
now implemented for [url=http://processing.org/discourse/yabb/YaBB.cgi?board=Collaboration;action=display;num=1084285917]megabucket[/url].
|
||||
|
||||
|
||||
discuss with casey
|
||||
_ how should history be handled
|
||||
_ is the sketch folder something that is never seen by the user?
|
||||
_ i.e. flash programs 'import' all data, etc
|
||||
_ same with how imovie works
|
||||
|
||||
Reference in New Issue
Block a user