mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 18:10:43 +01:00
fix problem with screen menu bar issues
This commit is contained in:
@@ -96,7 +96,7 @@ public class Base {
|
||||
|
||||
// int editorCount;
|
||||
// Editor[] editors;
|
||||
java.util.List<Editor> editors =
|
||||
java.util.List<Editor> editors =
|
||||
Collections.synchronizedList(new ArrayList<Editor>());
|
||||
// ArrayList editors = Collections.synchronizedList(new ArrayList<Editor>());
|
||||
Editor activeEditor;
|
||||
@@ -168,20 +168,20 @@ public class Base {
|
||||
"p { font: 11pt \"Lucida Grande\"; margin-top: 8px }"+
|
||||
"</style> </head>" +
|
||||
"<b>The standard menu bar has been disabled.</b>" +
|
||||
"<p>Due to an Apple bug, the Processing menu bar is " +
|
||||
"unusable when run on Mac OS X 10.5 (Leopard). " +
|
||||
"<p>Due to an Apple bug, the Processing menu bar is " +
|
||||
"unusable when run on Mac OS X 10.5 (Leopard). " +
|
||||
"As a workaround, the menu bar will be placed inside " +
|
||||
"the editor window. This setting can be changed in the " +
|
||||
"Preferences window.</p>" +
|
||||
"</html>";
|
||||
// String warning =
|
||||
// "Due to an Apple bug, the Processing menu bar is\n" +
|
||||
// "unusable when run on Mac OS X 10.5 (Leopard).\n" +
|
||||
// "Due to an Apple bug, the Processing menu bar is\n" +
|
||||
// "unusable when run on Mac OS X 10.5 (Leopard).\n" +
|
||||
// "As a workaround, the menu bar is placed inside\n" +
|
||||
// "the editor window.";
|
||||
Object[] options = { "OK", "More Info" };
|
||||
int result = JOptionPane.showOptionDialog(new Frame(),
|
||||
warning,
|
||||
warning,
|
||||
"Menu Bar Problem",
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
JOptionPane.WARNING_MESSAGE,
|
||||
@@ -196,10 +196,10 @@ public class Base {
|
||||
if (result == 1) { // More Info
|
||||
Base.openURL("http://dev.processing.org/bugs/show_bug.cgi?id=786");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
System.setProperty("apple.laf.useScreenMenuBar", menubar);
|
||||
}
|
||||
System.setProperty("apple.laf.useScreenMenuBar", menubar);
|
||||
}
|
||||
|
||||
// Set the look and feel before opening the window
|
||||
@@ -212,7 +212,7 @@ public class Base {
|
||||
System.err.println(e.getMessage());
|
||||
//e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
// Create a location for untitled sketches
|
||||
untitledFolder = createTempFolder("untitled");
|
||||
untitledFolder.deleteOnExit();
|
||||
@@ -396,7 +396,7 @@ public class Base {
|
||||
String path = editor.getSketch().getMainFilePath();
|
||||
// In case of a crash, save untitled sketches if they contain changes.
|
||||
// (Added this for release 0158, may not be a good idea.)
|
||||
if (path.startsWith(untitledPath) &&
|
||||
if (path.startsWith(untitledPath) &&
|
||||
!editor.getSketch().isModified()) {
|
||||
continue;
|
||||
}
|
||||
@@ -561,7 +561,7 @@ public class Base {
|
||||
activeEditor.handleOpenInternal(path);
|
||||
activeEditor.untitled = true;
|
||||
return true;
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
activeEditor.statusError(e);
|
||||
return false;
|
||||
@@ -707,12 +707,12 @@ public class Base {
|
||||
|
||||
//if (editorCount == 1) {
|
||||
if (editors.size() == 1) {
|
||||
// For 0158, when closing the last window /and/ it was already an
|
||||
// For 0158, when closing the last window /and/ it was already an
|
||||
// untitled sketch, just give up and let the user quit.
|
||||
// if (Preferences.getBoolean("sketchbook.closing_last_window_quits") ||
|
||||
// (editor.untitled && !editor.getSketch().isModified())) {
|
||||
Object[] options = { "OK", "Cancel" };
|
||||
String prompt = Base.isMacOS() ?
|
||||
String prompt = Base.isMacOS() ?
|
||||
"<html> " +
|
||||
"<head> <style type=\"text/css\">"+
|
||||
"b { font: 13pt \"Lucida Grande\" }"+
|
||||
@@ -731,7 +731,7 @@ public class Base {
|
||||
options,
|
||||
options[0]);
|
||||
if (result == JOptionPane.YES_OPTION) {
|
||||
|
||||
|
||||
// This will store the sketch count as zero
|
||||
editors.remove(editor);
|
||||
storeSketches();
|
||||
@@ -792,7 +792,7 @@ public class Base {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Attempt to close each open sketch in preparation for quitting.
|
||||
@@ -805,7 +805,7 @@ public class Base {
|
||||
// Update to the new/final sketch path for this fella
|
||||
storeSketchPath(editor, index);
|
||||
index++;
|
||||
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user