diff --git a/processing/app/KjcEngine.java b/processing/app/KjcEngine.java index ab22e982e..271b6cd7f 100644 --- a/processing/app/KjcEngine.java +++ b/processing/app/KjcEngine.java @@ -190,7 +190,7 @@ public class KjcEngine extends PdeEngine { index = s.indexOf(' '); name = s.substring(0, index); tempClass = name; - + // and we're running inside if (kjc) { // if running inside processing... index = program.indexOf(EXTENDS); // ...and extends BApplet @@ -213,12 +213,15 @@ public class KjcEngine extends PdeEngine { // spew out a bunch of java imports for (int i = 0; i < imports.length; i++) { writer.print("import " + imports[i] + ".*; "); + // add serial if running inside pde + if (kjc) writer.print("import javax.comm.*;"); if (!kjc) writer.println(); } if (!kjc) writer.println(); writer.print("public class " + name + " extends " + - ((kjc && !usingExternal) ? "KjcApplet" : "BApplet") + " {"); + ((kjc && !usingExternal) ? + "KjcApplet" : "BApplet") + " {"); } if (programType == BEGINNER) { if (!kjc) writer.println(); diff --git a/processing/app/PdeBase.java b/processing/app/PdeBase.java index be6186e0f..052b566da 100644 --- a/processing/app/PdeBase.java +++ b/processing/app/PdeBase.java @@ -5,6 +5,7 @@ import java.io.*; import java.net.*; import java.util.*; import java.util.zip.*; +import javax.comm.*; public class PdeBase implements ActionListener { @@ -30,6 +31,8 @@ public class PdeBase implements ActionListener { } }; + Menu serialMenu; + static final String WINDOW_TITLE = "Proce55ing"; // the platforms @@ -223,20 +226,16 @@ public class PdeBase implements ActionListener { item.setEnabled(false); menu.add(item); menu.addActionListener(this); - menubar.add(menu); + + //menu.addSeparator(); + serialMenu = new Menu("Serial Port"); + menu.add(serialMenu); + buildSerialMenu(); + + menubar.add(menu); // add the sketch menu frame.setMenuBar(menubar); - /* - Menu fileMenu = new Menu("File"); - MenuItem mi; - goodies.add(new MenuItem("Save QuickTime movie...")); - goodies.add(new MenuItem("Quit")); - goodies.addActionListener(this); - menubar.add(goodies); - frame.setMenuBar(menubar); - */ - Insets insets = frame.getInsets(); Toolkit tk = Toolkit.getDefaultToolkit(); Dimension screen = tk.getScreenSize(); @@ -267,27 +266,15 @@ public class PdeBase implements ActionListener { // the directories above it class SketchbookMenuListener implements ActionListener { - //PdeEditor editor; String path; - public SketchbookMenuListener(/*PdeEditor editor,*/ String path) { - //this.editor = editor; + public SketchbookMenuListener(String path) { this.path = path; } public void actionPerformed(ActionEvent e) { - //if (e.getActionCommand().equals(NEW_SKETCH_ITEM)) { - //editor.handleNew(); - - //} else { - //editor.sketchbookOpen(path + File.separator + e.getActionCommand()); - //} - //System.out.println("got action in skbkmenulistener " + e); String name = e.getActionCommand(); - //System.out.println("calling editor.skOpen on " + path + " " + name); - //editor.skOpen(path, name); editor.skOpen(path + File.separator + name, name); - //File.separator + name + ".pde"); } } @@ -471,6 +458,64 @@ public class PdeBase implements ActionListener { } + class SerialMenuListener implements ItemListener /*, ActionListener*/ { + //public SerialMenuListener() { } + + public void itemStateChanged(ItemEvent e) { + int count = serialMenu.getItemCount(); + for (int i = 0; i < count; i++) { + ((CheckboxMenuItem)serialMenu.getItem(i)).setState(false); + } + CheckboxMenuItem item = (CheckboxMenuItem)e.getSource(); + item.setState(true); + String name = item.getLabel(); + //System.out.println(item.getLabel()); + PdeBase.properties.put("serial.port", name); + //System.out.println("set to " + get("serial.port")); + } + + /* + public void actionPerformed(ActionEvent e) { + System.out.println(e.getSource()); + String name = e.getActionCommand(); + PdeBase.properties.put("serial.port", name); + System.out.println("set to " + get("serial.port")); + //editor.skOpen(path + File.separator + name, name); + // need to push "serial.port" into PdeBase.properties + } + */ + } + + protected void buildSerialMenu() { + // get list of names for serial ports + // have the default port checked (if present) + + SerialMenuListener listener = new SerialMenuListener(); + String defaultName = get("serial.port", "unspecified"); + //boolean found; + + try { + Enumeration portList = CommPortIdentifier.getPortIdentifiers(); + while (portList.hasMoreElements()) { + CommPortIdentifier portId = + (CommPortIdentifier) portList.nextElement(); + + if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { + //if (portId.getName().equals(port)) { + String name = portId.getName(); + CheckboxMenuItem mi = + new CheckboxMenuItem(name, name.equals(defaultName)); + //mi.addActionListener(listener); + mi.addItemListener(listener); + serialMenu.add(mi); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void actionPerformed(ActionEvent event) { String command = event.getActionCommand(); //System.out.println(command); diff --git a/processing/build/windows/dist/Proce55ing.exe b/processing/build/windows/dist/Proce55ing.exe index 8e5084d77..93a3225d9 100755 Binary files a/processing/build/windows/dist/Proce55ing.exe and b/processing/build/windows/dist/Proce55ing.exe differ diff --git a/processing/build/windows/launcher/.cvsignore b/processing/build/windows/launcher/.cvsignore index 1edae2c96..738a5cd6f 100644 --- a/processing/build/windows/launcher/.cvsignore +++ b/processing/build/windows/launcher/.cvsignore @@ -1,4 +1,5 @@ Debug +Release launcher.dsw launcher.ncb launcher.opt diff --git a/processing/build/windows/launcher/launcher.dsp b/processing/build/windows/launcher/launcher.dsp index 0797c76d2..c84e59404 100644 --- a/processing/build/windows/launcher/launcher.dsp +++ b/processing/build/windows/launcher/launcher.dsp @@ -36,24 +36,24 @@ RSC=rc.exe # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" -# PROP Use_MFC 6 +# PROP Use_MFC 5 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 /nologo /subsystem:windows /machine:I386 +# ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"Release/Proce55ing.exe" !ELSEIF "$(CFG)" == "Launcher - Win32 Debug" @@ -79,7 +79,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"Proce55ing.exe" /pdbtype:sept +# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/Proce55ing.exe" /pdbtype:sept !ENDIF diff --git a/processing/done.txt b/processing/done.txt index 717a3ed0b..a12a29483 100644 --- a/processing/done.txt +++ b/processing/done.txt @@ -1,4 +1,17 @@ 0039 BUGS WITH CODE + +// font problems +BFont font; +font = loadFont("Univers76.vlw.gz"); +//font = loadFont("Bodoni.vlw.gz"); +//BFont font = loadFont("Univerx76.vlw.gz"); +setFont(font); +String happy = "FontTest"; +//float happyWidth = font.stringWidth(happy); +//text(happy, (width - happyWidth)/2, 10); +text(happy, 20, 50); + +// float issues //BFont font1; //BFont font2; //font1 = loadFont("Univers76.vlw.gz"); @@ -62,6 +75,15 @@ X float f = 0.3; and fill(0.3, 0.2, 0.1); X windows needs to work from the .exe X also included run.bat just in case X test the gcc executable, and tweak dist script accordingly +X add 'readme.txt' to dist.sh.. change notes to revisions +X add examples to dist.sh scripts +X separate shared script to cleanup? +X or small script to remove CVS directories from a tree +X check osname under win98 and linux +X information on how to submit bugs to p5-bugs@proce55ing.net +X include release number, platform, and a copy of the code +X proce55ing thinks the following numbers are a double: +X float a = .5; float b = 0.5; 0037 diff --git a/processing/todo.txt b/processing/todo.txt index bc9897a6e..dbb1ea33b 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -6,15 +6,18 @@ X much reworking for run/present modes X run/present modes are getting confused X [esc] to exit presentation mode X remove 'edit' menu because it's worthless +X build 'release' version of app that doesn't need MFC42D.dll +X check on linefeeds and other errors with bbs on web site +X serial +X some method for getting list of serial ports +X pde menu item for listing serial ports available +o could just println them to the console +X import javax.comm stuff as standard in kjc (but not export) +X can't get fonts to load - tested working ok +X bagel complaint: could not load font Univerx76.vlw.gz +X why the x? what's going on? -bagel -a _ serial -a _ some method for getting list of serial ports -a _ pde menu item for listing serial ports available -a _ could just println them to the console -a _ import javax.comm stuff as standard in kjc (not in applet) - pde a _ move background() out of draw() for draw mode apps a _ click on project name to quickly go to rename mode @@ -29,8 +32,10 @@ macos9 a _ apple control keys register as edit events in buffer a _ use Toolkit.getShortcutKeymask() to figure out what's up a _ set file type/creator for .pde files.. TEXTPde1 +a _ try using serial macosx +a _ try using serial a _ test presentation mode for window sizing status macos @@ -44,45 +49,16 @@ a _ URLConnection.setUseCaches(false) a _ parent.obj.close() on the url a _ check to see if lines for error messages are off -windwows -a _ build 'release' version of app, wants MFC42D.dll +windows a _ splash screen.. check win95 book for simple code -release -a _ add 'readme.txt' to dist.sh.. change notes to revisions -a _ add examples to dist.sh scripts -a _ separate shared script to cleanup? -a _ or small script to remove CVS directories from a tree -a _ check osname under win98 and linux -a _ information on how to submit bugs to p5-bugs@proce55ing.net -a _ include release number, platform, and a copy of the code - web / docs +a _ finish writing 'readme.txt' a _ change download/index.html to not describe dates but process a _ "this is alpha, we're heading to beta with series of sm releases" -a _ check on linefeeds and other errors with bbs on web site -a _ online discussion/talk system (gets people using the site too) -a _ online signup cgi for people to add themselves to the list -a _ see about setting up simple bug tracker/feature system -a _ queue for people reporting things externally -a _ bugzilla but simpler -a _ would also be nice for people to be able to vote on features a _ document serial a bit more in release notes -a _ can't get fonts to load -a _ bagel complaint: could not load font Univerx76.vlw.gz -a _ why the x? what's going on? -BFont font; -font = loadFont("Univers76.vlw.gz"); -//font = loadFont("Bodoni.vlw.gz"); -//BFont font = loadFont("Univerx76.vlw.gz"); -setFont(font); -String happy = "FontTest"; -//float happyWidth = font.stringWidth(happy); -//text(happy, (width - happyWidth)/2, 10); -text(happy, 20, 50); - a _ this code is not performing correctly BImage b; // declare variable "b" of type BImage b = loadImage("image.gif"); @@ -119,10 +95,6 @@ rect(20, 20, 50, 50); fill(rr); rect(50, 50, 50, 50); -a _ proce55ing thinks the following numbers are a double: -float a = .5; -float b = 0.5; - //////////////////////////////////////////////////////////////////// @@ -134,6 +106,7 @@ b _ projectX, projectY, .. or projectedX ? BAGEL / high & time consuming +b _ color won't set for fonts b _ alpha b _ concave/complex polygon shtuff b _ eventually POLYGON auto-detects convex/concave polygon @@ -283,6 +256,11 @@ b _ lockup when something missing from classpath on dynamic load b _ but makes no error.. peditorconsole probably swallowing it b _ change writeJava/start functions to be combined in kjc b _ but the rest inside PdeEditor that takes care of launching/placing +b _ online signup cgi for people to add themselves to the list +b _ see about setting up simple bug tracker/feature system +b _ queue for people reporting things externally +b _ bugzilla but simpler +b _ would also be nice for people to be able to vote on features PDE / medium