Added generic signal binding for toolkit controls in JavaScript 50/51650/2
authorRichard Huang <r.huang@samsung.com>
Wed, 11 Nov 2015 17:30:50 +0000 (17:30 +0000)
committerRichard Huang <r.huang@samsung.com>
Wed, 11 Nov 2015 18:36:33 +0000 (18:36 +0000)
commit5beb9bdb5ed4cf321bf1492f94fdaed69d70cc2c
treea0b669b1c60bea6cc93d41eb2377b9237db72af6
parentaf4073fd7a4f946e26110ecd608ef8e748c078aa
Added generic signal binding for toolkit controls in JavaScript

This should cover generic use cases where the signal callback only needs to
be aware of who emits the signal and do not need to return any parameter.

This will work for most of control signals without specific binding.

For example, for button, you can do:

  var button = new dali.Control("PushButton");
  button.name = "myButton";
  button.connect("pressed", app.onButtonPressed);
  button.connect("released", app.onButtonReleased);

  app.onButtonPressed = function( button ) {
    console.log(button.name + " Pressed!!!");
  }

  app.onButtonReleased = function( button ) {
    console.log(button.name + " Released!!!");
  }

  button.disconnect("pressed", app.onButtonPressed);
  button.disconnect("released", app.onButtonReleased);

Change-Id: I3144ca274cc07e68d81ba78cc606e5367ea5419b
plugins/dali-script-v8/src/signals/signal-manager.cpp