File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,7 @@ void createHandle () {
226
226
* @see org.eclipse.swt.widgets.Widget#hookKeyDown()
227
227
*/
228
228
void hookKeyDown () {
229
+
229
230
textHandle .onkeydown = new RunnableCompatibility () {
230
231
public void run () {
231
232
boolean verifyHooked = false ;
@@ -278,10 +279,19 @@ void hookModify() {
278
279
/*
279
280
* TODO: Maybe pasting string into Text component should be limited.
280
281
*/
281
- textHandle .onchange = new RunnableCompatibility () {
282
+ /*
283
+ * I have changed, the change event to onkeyup. I think change is
284
+ * just fired after the blur.
285
+ */
286
+ textHandle .onkeyup = new RunnableCompatibility () {
282
287
public void run () {
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 ))) {
285
295
toReturn (true );
286
296
return ;
287
297
}
@@ -293,14 +303,14 @@ public void run() {
293
303
toReturn (true );
294
304
return ;
295
305
}
296
- if (!newText .equals (oldText )) {
306
+ // if (!newText.equals (oldText)) {
297
307
Event e = new Event ();
298
308
e .type = SWT .Modify ;
299
309
e .item = Text .this ;
300
310
e .widget = Text .this ;
301
311
sendEvent (e );
302
312
toReturn (e .doit );
303
- }
313
+ // }
304
314
}
305
315
}
306
316
};
You can’t perform that action at this time.
0 commit comments