mirror of
https://github.com/processing/processing4.git
synced 2026-02-04 06:09:17 +01:00
X set bg/fg color of text editing area
X add option for running with external editor X sets text area to not editable, changes color X gets new text on each run.. calls handleOpen2 or whatever X disables save.. save as ? X organizing directories, save to other directories blows up X for now, disallow the / or : characters X there was a bug that required a noop() b/c of jikes or 1.3 problems X is problem w/ beautify that it has no menu event handler? X write event handler, and make sure it doesn't work for external ed
This commit is contained in:
@@ -218,7 +218,10 @@ public class PdeEditorStatus extends Panel
|
||||
editField = new TextField();
|
||||
editField.addActionListener(this);
|
||||
editField.addKeyListener(new KeyAdapter() {
|
||||
protected void noop() { }
|
||||
|
||||
public void keyPressed(KeyEvent event) {
|
||||
//System.out.println("got event " + event + " " + KeyEvent.VK_SPACE);
|
||||
int c = event.getKeyChar();
|
||||
int code = event.getKeyCode();
|
||||
|
||||
@@ -238,13 +241,17 @@ public class PdeEditorStatus extends Panel
|
||||
(code == KeyEvent.VK_HOME) ||
|
||||
(code == KeyEvent.VK_END) ||
|
||||
(code == KeyEvent.VK_SHIFT)) {
|
||||
//System.out.println("nothing to see here");
|
||||
noop();
|
||||
|
||||
} else if (code == KeyEvent.VK_ESCAPE) {
|
||||
unedit();
|
||||
editor.buttons.clear();
|
||||
event.consume();
|
||||
|
||||
} else if (c == ' ') {
|
||||
//} else if (c == ' ') {
|
||||
} else if (code == KeyEvent.VK_SPACE) {
|
||||
//System.out.println("got a space");
|
||||
// if a space, insert an underscore
|
||||
//editField.insert("_", editField.getCaretPosition());
|
||||
/* tried to play nice and see where it got me
|
||||
@@ -264,15 +271,18 @@ public class PdeEditorStatus extends Panel
|
||||
int end = editField.getSelectionEnd();
|
||||
editField.setText(t.substring(0, start) + "_" +
|
||||
t.substring(end));
|
||||
editField.setCaretPosition(start+1);
|
||||
event.consume();
|
||||
|
||||
} else if (c == '_') {
|
||||
noop();
|
||||
// everything fine
|
||||
|
||||
} else if (((code >= 'A') && (code <= 'Z')) &&
|
||||
(((c >= 'A') && (c <= 'Z')) ||
|
||||
((c >= 'a') && (c <= 'z')))) {
|
||||
// everything fine, catches upper and lower
|
||||
noop();
|
||||
|
||||
} else if ((c >= '0') && (c <= '9')) {
|
||||
if (editField.getCaretPosition() == 0) {
|
||||
|
||||
Reference in New Issue
Block a user