# HG changeset patch # User Jacob Carlborg # Date 1244676052 -7200 # Node ID 834420cb1486d51c227a553fd561b890986f5e8d # Parent 0ba75290f8ce846b8a4481ae70c97376ed464413 Delete, arrow keys and backspace are now working in text fields diff -r 0ba75290f8ce -r 834420cb1486 dwt/internal/cocoa/OS.d --- a/dwt/internal/cocoa/OS.d Wed Jun 10 21:52:31 2009 +0200 +++ b/dwt/internal/cocoa/OS.d Thu Jun 11 01:20:52 2009 +0200 @@ -79,7 +79,7 @@ /*static this (){ Library.loadLibrary("swt-pi"); //$NON-NLS-1$ }*/ - + public static const int VERSION; static this () { int [1] response; diff -r 0ba75290f8ce -r 834420cb1486 dwt/widgets/Display.d --- a/dwt/widgets/Display.d Wed Jun 10 21:52:31 2009 +0200 +++ b/dwt/widgets/Display.d Thu Jun 11 01:20:52 2009 +0200 @@ -3973,7 +3973,7 @@ } else if (sel is OS.sel_insertText_) { widget.insertText (id, sel, arg0); } else if (sel is OS.sel_doCommandBySelector_) { - widget.doCommandBySelector (id, sel, cast(char*) arg0); + widget.doCommandBySelector (id, sel, cast(objc.SEL) arg0); } else if (sel is OS.sel_highlightSelectionInClipRect_) { widget.highlightSelectionInClipRect (id, sel, arg0); } else if (sel is OS.sel_reflectScrolledClipView_) { diff -r 0ba75290f8ce -r 834420cb1486 dwt/widgets/Text.d --- a/dwt/widgets/Text.d Wed Jun 10 21:52:31 2009 +0200 +++ b/dwt/widgets/Text.d Thu Jun 11 01:20:52 2009 +0200 @@ -1379,12 +1379,12 @@ oldText = new_String ([character]); } wchar[] newText = verifyText (oldText, start, end, nsEvent); - if (newText is null) return false; + //if (newText is null) return false; // DWT extension, empty strings could be null if (charCount - (end - start) + newText.length () > textLimit) { return false; } - result = newText is oldText; - if (newText !is oldText || hiddenText !is null) { + result = newText == oldText; // DWT extension, Use "==" instead of "is" because newText can be null + if (newText != oldText || hiddenText !is null) { if ((style & DWT.SINGLE) !is 0) { insertEditText (newText); } else { @@ -1499,7 +1499,7 @@ void setEditText (wchar[] string) { wchar [] buffer; - if ((style & DWT.PASSWORD) && echoCharacter !is '\0') { + if (((style & DWT.PASSWORD) is 0) && echoCharacter !is '\0') { hiddenText = string; buffer = new wchar [Math.min(hiddenText.length (), textLimit)]; for (int i = 0; i < buffer.length; i++) buffer [i] = echoCharacter;