When DragAppearance.TARGET is set on an object in a FlowLayout, the dragged object only displays while inside the boundaries of the containing canvas. When the object is dragged "outside" the FlowLayout boundaries it disappears thus making it difficult to drop onto another object. The drop will work but it is impossible to see where the canvas is being dropped because it disappears.
Here is the test code that demonstrates this problem.
Here is the test code that demonstrates this problem.
Code:
[B]public[/B] [B]class[/B] DragAppearanceTargetFailCase [B]extends[/B] VLayout { [B]public[/B] DragAppearanceTargetFailCase() { setBorder("blue"); setWidth(200); setHeight(100); FlowLayout flowLayout = createFlowLayout(); addMember(flowLayout); Container failObject = addContainer(flowLayout); flowLayout.addTile(failObject); } [B]private[/B] FlowLayout createFlowLayout() { FlowLayout flowLayout = [B]new[/B] FlowLayout(); flowLayout.setCanAcceptDrop([B]true[/B]); flowLayout.setDropTypes("DROP_TYPE"); flowLayout.setBorder("2px solid blue"); flowLayout.setMargin(10); [B]return[/B] flowLayout; } [B]private[/B] Container addContainer(FlowLayout flowLayout) { String containerColor = "red"; Container box = [B]new[/B] Container(containerColor); box.setHeight(25); box.setWidth(100); box.setCanDragReposition([B]true[/B]); box.setCanDrop([B]true[/B]); box.setBackgroundColor(containerColor); box.setID(containerColor); flowLayout.addTile(box); [B]return[/B] box; } [B]public[/B] [B]class[/B] Container [B]extends[/B] VLayout { [B]public[/B] Container(String id) { setID(id + "container"); setWidth(1); setHeight(1); setMembersMargin(3); setCanDragReposition([B]true[/B]); setCanDrop([B]true[/B]); setDragAppearance(DragAppearance.[B][I]TARGET[/I][/B]); setDragType("DROP_TYPE"); } } }
Comment