djo / XScalaWT (http://coconut-palm-software.com/the_new_visual_editor/doku.php)

XScalaWT is the merging of XSWT and Glimmer using Scala as a source language rather than XML. The result is a strongly-typed DSL for creating SWT GUIs using Scala. License: Eclipse Public License

Clone this repository (size: 70.3 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/djo/xscalawt/
commit 52: 88ce5e7f1ef7
parent 51: 2f720f0d519c
branch: default
Added remaining MousListener support
djo
12 months ago

Changed (Δ426 bytes):

Up to file-list src/com/coconut_palm_software/xscalawt/XScalaWT.scala:

@@ -344,15 +344,25 @@ object XScalaWT {
344
344
  }
345
345
  
346
346
  // MouseListener-----------------------------------------------------------------
347
348
  def addMouseListener[T <: {def addMouseListener(l : MouseListener)}](l : MouseListener)(subject:T) = {
349
    subject.addMouseListener(l)
350
  }
347
351
  
348
  private class MouseListenerForwarder(l : (MouseEvent => Unit)) extends MouseAdapter {
352
  class _MouseListenerForwarder(l : (MouseEvent => Unit)) extends MouseAdapter {
349
353
    override def mouseDown(e : MouseEvent) = l(e)
350
354
  }
351
355
  
356
  def addMouseListener[T <: {def addMouseListener(l : MouseListener)}](l : (MouseEvent => Unit))(subject:T) = {
357
    subject.addMouseListener(new _MouseListenerForwarder(l))
358
  }
359
  
352
360
  implicit def mouseFunc2addMouseListener[T <: {def addMouseListener(l : MouseListener)}](func : (MouseEvent => Unit))(subject:T) {
353
    subject.addMouseListener(new MouseListenerForwarder(func))
361
    subject.addMouseListener(new _MouseListenerForwarder(func))
354
362
  }
355
363
  
364
  implicit def func2MouseListener[T <: (MouseEvent => Unit)](func : T) = new _MouseListenerForwarder(func)
365
  
356
366
  // ModifyListener-----------------------------------------------------------------
357
367
  
358
368
  def addModifyListener[T <: {def addModifyListener(l : ModifyListener)}](l : ModifyListener)(subject : T) =