From 288d9604ae6b64829e5fc56b262dee5f424d3180 Mon Sep 17 00:00:00 2001 From: benfry Date: Sun, 24 Dec 2006 02:29:38 +0000 Subject: [PATCH] handle next/prev line with up/down arrow with/without shift --- app/syntax/InputHandler.java | 19 ++++++++++++++++--- core/todo.txt | 15 ++------------- todo.txt | 2 ++ 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/app/syntax/InputHandler.java b/app/syntax/InputHandler.java index 2c4093ab5..ad1a44c4f 100644 --- a/app/syntax/InputHandler.java +++ b/app/syntax/InputHandler.java @@ -786,8 +786,14 @@ public abstract class InputHandler extends KeyAdapter if(line == textArea.getLineCount() - 1) { - textArea.getToolkit().beep(); - return; + //textArea.getToolkit().beep(); + int doc = textArea.getDocumentLength(); + if (select) { + textArea.select(textArea.getMarkPosition(), doc); + } else { + textArea.setCaretPosition(doc); + } + return; } int magic = textArea.getMagicCaretPosition(); @@ -944,7 +950,14 @@ public abstract class InputHandler extends KeyAdapter if(line == 0) { - textArea.getToolkit().beep(); + if (select) { + if (textArea.getSelectionStart() != 0) { + textArea.select(textArea.getMarkPosition(), 0); + } + } else { + textArea.setCaretPosition(0); + } + //textArea.getToolkit().beep(); return; } diff --git a/core/todo.txt b/core/todo.txt index 395093628..2ff2ff1c7 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -63,19 +63,8 @@ _ use gradients in a class for the svg lib for now _ don't add api to main p5 stuff (though maybe setPaint/noPaint api?) _ gradient-painted lines and fills _ java2d will do both line and fill, illusfarter only does fills -import java.awt.geom.*; -Color c = new Color(0x00FFFF00, true); -GradientPaint gradient = - new GradientPaint(0,0,Color.red,100,100,c); -GeneralPath gp = new GeneralPath(); -gp.moveTo(10, 10); -gp.lineTo(100, 90); -gp.lineTo(20, 50); -gp.closePath(); -Graphics2D g2 = ((PGraphicsJava2D)g).g2; -g2.setPaint(gradient); -//g2.draw(gp); -g2.fill(gp); +_ gradients not supported in java2d +_ http://dev.processing.org/bugs/show_bug.cgi?id=371 _ tint() and noTint() switching problem in P2D _ this should be a quick fix diff --git a/todo.txt b/todo.txt index 09f8b0ba7..e878a4c6f 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,6 @@ 0124 pde +X handle next/prev line with up/down arrow, with/without shift down +X properly go to the beginning or ending of the document _ 'code' folder being ignored on export to application _ http://dev.processing.org/bugs/show_bug.cgi?id=469