0 Replies Latest reply on Mar 22, 2008 2:16 PM by ctzn99

    Bug with using DragManager in WIndowedApplication

    ctzn99 Level 1
      Ok according to this article there are three scenarios for using a combination of windows and drag managers but, I have a fourth scenario where I want to use a WindowedApplication and the Flex DragManager thus allowing me to further use List.calculateDropIndex which you can't use if you try to use the NativeDragManager because calculateDropIndex uses a regular event object as it's parameter.

      For the most part this works, i can drag files from the desktop to my app and have the index calculated properly and all the feed back and drag events work correctly. BUT if i try to drag something like a canvas thats in the flex app to the same list then none of the feed back works correctly meaning that ANYTHING that can be dragged within the app can be dragged onto the list. NOTE: this only seems to happen when dragging onto List based controls such as List or Tree.

      I've built about as simple a sample as I can and I'm hoping that someone else can confirm that there is a bug (even if they don't have an answer or workaround), i've already filed a bug report but this is driving me crazy as I'm stuck building my app until I can resolve this... it's critical that I can both drag items within app around and drag files from outside the app into the app.

      If you test this here is what SHOULD happen:
      1) Drag a file from desktop to the white list of animals and the yellow canvas and you should see copy cursor feed back.
      2) Drag the blue canvas over the yellow canvas and you should see copy cursor feedback.
      3) Drag the blue canvas over the white animal list and you should see copy cursor feedback.

      In step 3 what actually happens is you don't see any feedback.

      Thanks in advance to anyone who tries this out and confirms that it's bugged or not.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" width="508" height="183" xmlns:local="*" showStatusBar="false">
      <mx:Script>
      <![CDATA[
      import mx.controls.Tree;
      import mx.core.IUIComponent;
      import mx.events.DragEvent;
      import mx.core.DragSource;
      import mx.managers.DragManager;

      [Bindable] private var sampleData:XML =
      <files>
      <file label="cats"/>
      <file label="dogs"/>
      <file label="mice"/>
      <file label="birds"/>
      <file label="elephants"/>
      </files>;

      private function moveItem(event:MouseEvent):void
      {
      DragManager.doDrag(IUIComponent(event.currentTarget), new DragSource(), event);
      }

      private function dragEnter(event:DragEvent):void
      {
      DragManager.acceptDragDrop(IUIComponent(event.target));
      }

      private function dragOver(event:DragEvent):void
      {
      DragManager.showFeedback(DragManager.COPY);
      }
      ]]>
      </mx:Script>
      <mx:Canvas width="74" height="66" mouseMove="moveItem(event);" backgroundColor="#96A7F9" x="10" y="10"/>
      <mx:Canvas borderColor="#F000FF" backgroundColor="#F6FCB9" width="196" height="162"
      dragEnter="dragEnter(event);"
      dragOver="dragOver(event);" x="92" y="10"/>
      <mx:List id="myList" width="196" labelField="@label" left="296" top="10"
      dataProvider="{sampleData.file}"
      dragEnter="dragEnter(event);"
      dragOver="dragOver(event);" height="162"/>
      </mx:WindowedApplication>