Ivan Garcia schrieb:
I've tried many things but the mouse when dropping appears all the time as FORBIDDEN icon.

The tutorial and demos only show how to drag from and to a TreeVirtual but not from a ListView to a TreeVirtual, is this possible ?

Hello,

there is no DragAndDropSupport mixin for the table class yet, but it is not so difficult to emulate:

table.addEventListener("dragstart";function()
{
                var target = event.getTarget();
   
          // allow drag only in pane area
          // this needs a more sophisticated check
          switch ( target.getParent().classname )
          {
            case "qx.ui.table.pane.Header":
            case "qx.ui.basic.ScrollBar":
              return;
          }
   
          // we fake a virtual tree node drag data object to make this compatible
          // to the MDragAndDropSupport mixin
          // todo: this needs a transparent API!!
          var nodeData = {
              sourceWidget : this,
              nodeData : [ {
                  data : {
                      [... custom properties ...]
                      MDragAndDropSupport : { type : "... type information for the MDragAndDropSupport mixin ..." }
                  }
              } ]
          };
          event.addData("treevirtualnode", nodeData );
         
          // add actions
          event.addAction("move");
          event.addAction("copy");
         
          // start drag session
          event.startDrag();
}

The current implementation of the framework has a bug that is still unresolved (http://bugzilla.qooxdoo.org/show_bug.cgi?id=644) which prevents the drag & drop mechanism  from functioning properly without the following hack:

    qx.ui.core.Widget.prototype.supportsDrop = function (dragCache)
        {
      var supportsDropMethod = this.getSupportsDropMethod();
      if (supportsDropMethod !== null) {
        return supportsDropMethod.call(this, dragCache);
      }
      return true;
        };
       
        qx.event.handler.DragAndDropHandler.prototype.getDropTarget = qx.core.Variant.select("qx.client",
    {
      "gecko" : function(e)
      {
        var vCurrent = e.getTarget();

//        if (vCurrent == this.__dragCache.sourceWidget) {
//          vCurrent = qx.event.handler.EventHandler.getTargetObject(qx.html.ElementFromPoint.getElementFromPoint(e.getPageX(), e.getPageY()));
//        } else {
          vCurrent = qx.event.handler.EventHandler.getTargetObject(null, vCurrent);
//        }

        while (vCurrent != null)
        {

          if (!vCurrent.supportsDrop(this.__dragCache)) {
            return null;
          }

          if (this.supportsDrop(vCurrent)) {
            return vCurrent;
          }

          vCurrent = vCurrent.getParent();
        }

        return null;
      },

      "default" : function(e)
      {
        var vCurrent = e.getTarget();

        while (vCurrent != null)
        {
          if (!vCurrent.supportsDrop(this.__dragCache)) {
            return null;
          }

          if (this.supportsDrop(vCurrent)) {
            return vCurrent;
          }

          vCurrent = vCurrent.getParent();
        }

        return null;
      }
    });

So there is still alot to do to polish this in the framework...

Christian




-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to