Hello,

I'm testing the new version of qooxdoo 0.8.

The method placeToMouse work well with a widget added to the root
application
but inside a layout, the position mouse or the widget isn't correct.


How can I move a widget with the mouse inside a layout ?

Thank for your help. 

Sebastien

See the code :

qx.Class.define("test.Application",
{
  extend : qx.application.Standalone,



  /*
 
*****************************************************************************
     MEMBERS
 
*****************************************************************************
  */

  members :
  {
    /**
     * This method contains the initial application code and gets called 
     * during startup of the application
     */
    main: function()
    {
      this.base(arguments);
          
          var draw = new qx.ui.container.Composite(new qx.ui.layout.Basic());
          draw.set({width : 520,height:420, decorator : "main"});
      
      var bt1 = new test.Button("Button 1");
      qx.event.Registration.removeAllListeners(bt1);
 
      bt1.addListener("mousedown", function(e) { 
        this.__moveStart = true;
        this.capture();
      }, bt1,true);
      bt1.addListener("mouseup", function (e) {
        this.__moveStart = false;
        this.releaseCapture();
      }, bt1);
      bt1.addListener("mousemove", function (e) {
        if ( this.__moveStart ) {
                this.placeToMouse(e);
        }
      }, bt1);

      
          draw.add(bt1);

      var bt2 = new test.Button("Button 2");
      qx.event.Registration.removeAllListeners(bt2);
 
      bt2.addListener("mousedown", function(e) { 
        this.__moveStart = true;
        this.capture();
      }, bt2,true);
      bt2.addListener("mouseup", function (e) {
        this.__moveStart = false;
        this.releaseCapture();
      }, bt2);
      bt2.addListener("mousemove", function (e) {
        if ( this.__moveStart ) {
                this.placeToMouse(e);
        }
      }, bt2);

          this.getRoot().add(bt2,{left:620,top:20});      
      this.getRoot().add(draw,{left:20,top:20});
    }


  }
});

qx.Class.define("test.Button",
{

  extend : qx.ui.form.Button,
  include :
  [
     qx.ui.core.MPlacement
    
  ]
})
  
-- 
View this message in context: 
http://www.nabble.com/qx.ui.core.MPlacement-methode-placeToMouse-don%27t-work-well-inside-a-layout.-tp21092138p21092138.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to