diff --git a/processing/app/PdeBase.java b/processing/app/PdeBase.java index d8c9f4934..8053b81cc 100644 --- a/processing/app/PdeBase.java +++ b/processing/app/PdeBase.java @@ -22,6 +22,31 @@ public class PdeBase implements ActionListener { static final String WINDOW_TITLE = "Proce55ing"; + // the platforms + static final int WINDOWS = 0; + static final int MACOS9 = 1; + static final int MACOSX = 2; + static final int LINUX = 3; + static int platform; + + static final String platforms[] = { + "windows", "macos9", "macosx", "linux" + }; + + static { + if (System.getProperty("mrj.version") != null) { // running on a mac + //System.out.println(UIManager.getSystemLookAndFeelClassName()); + //System.out.println(System.getProperty("mrj.version")); + //System.out.println(System.getProperty("os.name")); + platform = (System.getProperty("os.name").equals("Mac OS X")) ? + MACOSX : MACOS9; + + } else { + //System.out.println("unknown OS"); + System.out.println(System.getProperty("os.name"); + } + } + static public void main(String args[]) { PdeBase app = new PdeBase(); diff --git a/processing/app/PdeEditorStatus.java b/processing/app/PdeEditorStatus.java index 5a965330e..f073be598 100644 --- a/processing/app/PdeEditorStatus.java +++ b/processing/app/PdeEditorStatus.java @@ -4,8 +4,8 @@ import java.awt.event.*; public class PdeEditorStatus extends Panel implements ActionListener /*, Runnable*/ { - static Color bgColor[]; - static Color fgColor[]; + static Color bgcolor[]; + static Color fgcolor[]; static final int NOTICE = 0; static final int ERROR = 1; @@ -17,14 +17,14 @@ public class PdeEditorStatus extends Panel static final int CANCEL = 3; static final int OK = 4; - static final String PROMPT_YES = "yes"; - static final String PROMPT_NO = "no"; - static final String PROMPT_CANCEL = "cancel"; - static final String PROMPT_OK = "ok"; + static final String PROMPT_YES = "Yes"; + static final String PROMPT_NO = "No"; + static final String PROMPT_CANCEL = "Cancel"; + static final String PROMPT_OK = "Ok"; static final String NO_MESSAGE = ""; static final int BUTTON_WIDTH = 66; - static final int BUTTON_HEIGHT = 20; + static final int BUTTON_HEIGHT = 24; //20; PdeEditor editor; @@ -53,24 +53,24 @@ public class PdeEditorStatus extends Panel this.editor = editor; empty(); - if (bgColor == null) { - bgColor = new Color[4]; - bgColor[0] = PdeBase.getColor("editor.status.notice.bgcolor", + if (bgcolor == null) { + bgcolor = new Color[4]; + bgcolor[0] = PdeBase.getColor("editor.status.notice.bgcolor", new Color(102, 102, 102)); - bgColor[1] = PdeBase.getColor("editor.status.error.bgcolor", + bgcolor[1] = PdeBase.getColor("editor.status.error.bgcolor", new Color(102, 26, 0)); - bgColor[2] = PdeBase.getColor("editor.status.prompt.bgcolor", + bgcolor[2] = PdeBase.getColor("editor.status.prompt.bgcolor", new Color(204, 153, 0)); - bgColor[3] = PdeBase.getColor("editor.status.prompt.bgcolor", + bgcolor[3] = PdeBase.getColor("editor.status.prompt.bgcolor", new Color(204, 153, 0)); - fgColor = new Color[4]; - fgColor[0] = PdeBase.getColor("editor.status.notice.fgcolor", + fgcolor = new Color[4]; + fgcolor[0] = PdeBase.getColor("editor.status.notice.fgcolor", new Color(255, 255, 255)); - fgColor[1] = PdeBase.getColor("editor.status.error.fgcolor", + fgcolor[1] = PdeBase.getColor("editor.status.error.fgcolor", new Color(255, 255, 255)); - fgColor[2] = PdeBase.getColor("editor.status.prompt.fgcolor", + fgcolor[2] = PdeBase.getColor("editor.status.prompt.fgcolor", new Color(0, 0, 0)); - fgColor[3] = PdeBase.getColor("editor.status.prompt.fgcolor", + fgcolor[3] = PdeBase.getColor("editor.status.prompt.fgcolor", new Color(0, 0, 0)); } } @@ -127,6 +127,9 @@ public class PdeEditorStatus extends Panel this.message = message; response = 0; + //yesButton.setBackground(bgcolor[mode]); + //noButton.setBackground(bgcolor[mode]); + //cancelButton.setBackground(bgcolor[mode]); yesButton.setVisible(true); noButton.setVisible(true); cancelButton.setVisible(true); @@ -154,6 +157,8 @@ public class PdeEditorStatus extends Panel //this.editRename = rename; response = 0; + //okButton.setBackground(bgcolor[mode]); + //cancelButton.setBackground(bgcolor[mode]); okButton.setVisible(true); cancelButton.setVisible(true); editField.setText(dflt); @@ -186,6 +191,12 @@ public class PdeEditorStatus extends Panel noButton = new Button(PROMPT_NO); cancelButton = new Button(PROMPT_CANCEL); okButton = new Button(PROMPT_OK); + + yesButton.setBackground(bgcolor[PROMPT]); + noButton.setBackground(bgcolor[PROMPT]); + cancelButton.setBackground(bgcolor[PROMPT]); + okButton.setBackground(bgcolor[PROMPT]); + setLayout(null); yesButton.addActionListener(this); @@ -308,16 +319,16 @@ public class PdeEditorStatus extends Panel if (font == null) { font = PdeBase.getFont("editor.status.font", new Font("SansSerif", Font.PLAIN, 10)); - //font = new Font("SansSerif", Font.PLAIN, 10); g.setFont(font); metrics = g.getFontMetrics(); ascent = metrics.getAscent(); } - g.setColor(bgColor[mode]); + g.setColor(bgcolor[mode]); g.fillRect(0, 0, imageW, imageH); - g.setColor(fgColor[mode]); + g.setColor(fgcolor[mode]); + g.setFont(font); // needs to be set each time on osx g.drawString(message, PdeEditor.INSET_SIZE, (sizeH + ascent) / 2); screen.drawImage(offscreen, 0, 0, null); diff --git a/processing/todo.txt b/processing/todo.txt index e54f8dea4..45623a932 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -3,10 +3,14 @@ X editor.buttons.bgcolor default value was wrong X sketch.properties exception when closing on linux and mac X urlstr was garbage because of windows-specific code X test build macos9 version with JDK13 flag turned off +X make buttons taller by 4 pixels (looking bad on macos9/macosx) +X change to uppercase (looks dumb on mac, and casey doesn't like) +X set background color of buttons in EditorStatus +X check splash screen and icons into cvs -_ check splash screen and icons into cvs _ get icon in macos9/macosx/windows formats - +_ macosx.. editor.status.font needs to be size 12 +_ introduce pde.properties_OSNAME _ background() not working _ imageMode() is gone @@ -40,16 +44,6 @@ _ box is not opaque _ size() not being called in setup is gonna cause lots of headaches - -dist directories contain only the files specific to that platform -(those are the ones checked into cvs) - when dist.sh is run: - 1) a copy of the dist dir is created, renamed 'processing-nnnn' - 2) the remaining files are added (buttons.gif, pde.properties) - 3) files are lf converted (i.e. notes.txt) - -_ make buttons taller by 4 pixels (looking bad on macos9/macosx) -_ change to uppercase (looks dumb on mac, and casey doesn't like) _ save window position (only during session) of sketch run window _ present mode should hide editor frame _ present mode doesn't work for draw() @@ -57,14 +51,10 @@ _ present mode doesn't work for draw() _ get macutils to build under cygwin. argh. _ get to build under macosx? -_ make.bat in root of 'app' should jump to build/windows/make.bat -_ dist.bat should be inside build dir -_ and will build for each platform in turn _ macos may be superior platform for building _ retain unix file permissions for linux _ resource fork goodness for the mac _ hhmmm -_ comm.jar now needs to be in CLASSPATH for build environment _ for jgl version of bagel, jgl.jar needs to be in classpath _ perl should be ok to be cygwin perl.. try deinstalling activestate @@ -653,3 +643,12 @@ little guys: rm, cp, mv, tcsh build jikes for cygwin ./configure, make, make install add $cygwin/usr/local/bin to path + +dist directories contain only the files specific to that platform +(those are the ones checked into cvs) + when dist.sh is run: + 1) a copy of the dist dir is created, renamed 'processing-nnnn' + 2) the remaining files are added (buttons.gif, pde.properties) + 3) files are lf converted (i.e. notes.txt) +_ comm.jar now needs to be in CLASSPATH for build environment +