Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6e35f30

Browse files
author
soheil_h_y
committed
1. Modify Listener of text works now.
1 parent0b14817 commit6e35f30

File tree

1 file changed

+15
-5
lines changed
  • sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets

1 file changed

+15
-5
lines changed

‎sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets/Text.java‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ void createHandle () {
226226
* @see org.eclipse.swt.widgets.Widget#hookKeyDown()
227227
*/
228228
voidhookKeyDown() {
229+
229230
textHandle.onkeydown =newRunnableCompatibility() {
230231
publicvoidrun() {
231232
booleanverifyHooked =false;
@@ -278,10 +279,19 @@ void hookModify() {
278279
/*
279280
* TODO: Maybe pasting string into Text component should be limited.
280281
*/
281-
textHandle.onchange =newRunnableCompatibility() {
282+
/*
283+
* I have changed, the change event to onkeyup. I think change is
284+
* just fired after the blur.
285+
*/
286+
textHandle.onkeyup =newRunnableCompatibility() {
282287
publicvoidrun() {
283-
if ((style &SWT.READ_ONLY) !=0
284-
|| (!hooks (SWT.Verify) && !filters (SWT.Verify))) {
288+
if ((style &SWT.READ_ONLY) !=0
289+
/*
290+
* I have changed !hooks (SWT.Verify) && !filters (SWT.Verify)) to
291+
* hooks (SWT.Verify) && !filters (SWT.Verify))
292+
* I do not know what is the rational behind the first.
293+
*/
294+
|| (hooks (SWT.Verify) && !filters (SWT.Verify))) {
285295
toReturn(true);
286296
return ;
287297
}
@@ -293,14 +303,14 @@ public void run() {
293303
toReturn(true);
294304
return ;
295305
}
296-
if (!newText.equals (oldText)) {
306+
//if (!newText.equals (oldText)) {
297307
Evente =newEvent();
298308
e.type =SWT.Modify;
299309
e.item =Text.this;
300310
e.widget =Text.this;
301311
sendEvent(e);
302312
toReturn(e.doit);
303-
}
313+
//}
304314
}
305315
}
306316
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp