SmartGwtEE 3.0 Eval from 11/10/2011
Have 2 VLayouts side by side. The left VLayout has a SectionStack with draggable widgets (the code for these are below). The right VLayout is just a simple VLayout for now where I would like to eventually drop items dragged over from the left VLayout's SectionStack.
Issue #1:
Despite following the examples and the docs, I can't get any DropHandlers to fire except for the DropOverHandler. I've tried setting my DraggablePieces to canDragReposition(true) and canDrag(true) and the result is the same for both.
Issue #2:
FIXED by setting Cursor on all members in Draggable Layout.
The drag cursor does not work for my DraggablePieces. The drag cursor shows correctly only if the mouse pointer is EXACTLY on the border of the DraggablePiece. I suspect it has something to do with the Img and Label inside of the Piece taking up all the internal space and their cursors not being set correctly. The bigger problem, however, is that if I use canDragReposition instead of canDrag, the cursor only shows up on the border until the piece is actually dragged anywhere and then it doesn't even show up on the border any more. If set to canDrag instead of canDragReposition, it always shows up but only on the border - even when moved. *EDIT* Setting cursor on the Img and Label fixes the one problem but the cursor still ceases to function correctly on the border... even when I set the cursor to Cursor.MOVE on the entire DraggablePiece (which extends HLayout).
Issue #3:
DraggablePieces moved from the SectionStack cause the SectionStack to no longer function correctly. The sections that my DraggablePieces are in will no longer fully collapse because the DraggablePiece that was moved is always visible.
Issue #4:
My SectionStack isn't animating when sections expand/collapse. Tried on IE and Firefox. Tried both visibility modes.
rightVLayout code
DraggableProgramPiece code
leftVLayout and SectionStack code
I have 3 Sections in the SectionStack (with 1 of them being shown above) and other DraggableProgramPieces but I can't show the code for those because the names would give some stuff away that I can't share. They are exactly the same except for the names and images are different.
Have 2 VLayouts side by side. The left VLayout has a SectionStack with draggable widgets (the code for these are below). The right VLayout is just a simple VLayout for now where I would like to eventually drop items dragged over from the left VLayout's SectionStack.
Issue #1:
Despite following the examples and the docs, I can't get any DropHandlers to fire except for the DropOverHandler. I've tried setting my DraggablePieces to canDragReposition(true) and canDrag(true) and the result is the same for both.
Issue #2:
FIXED by setting Cursor on all members in Draggable Layout.
The drag cursor does not work for my DraggablePieces. The drag cursor shows correctly only if the mouse pointer is EXACTLY on the border of the DraggablePiece. I suspect it has something to do with the Img and Label inside of the Piece taking up all the internal space and their cursors not being set correctly. The bigger problem, however, is that if I use canDragReposition instead of canDrag, the cursor only shows up on the border until the piece is actually dragged anywhere and then it doesn't even show up on the border any more. If set to canDrag instead of canDragReposition, it always shows up but only on the border - even when moved. *EDIT* Setting cursor on the Img and Label fixes the one problem but the cursor still ceases to function correctly on the border... even when I set the cursor to Cursor.MOVE on the entire DraggablePiece (which extends HLayout).
Issue #3:
DraggablePieces moved from the SectionStack cause the SectionStack to no longer function correctly. The sections that my DraggablePieces are in will no longer fully collapse because the DraggablePiece that was moved is always visible.
Issue #4:
My SectionStack isn't animating when sections expand/collapse. Tried on IE and Firefox. Tried both visibility modes.
rightVLayout code
Code:
final VLayout rightVLayout = new VLayout(); rightVLayout.setSize("66%", "100%"); rightVLayout.setShowEdges(true); rightVLayout.setCanAcceptDrop(true); rightVLayout.setCanDropComponents(false); rightVLayout.addDropOverHandler(new DropOverHandler() { public void onDropOver(DropOverEvent event) { // if (willAcceptDrop()) rightVLayout.setBackgroundColor("#ffff80"); } }); rightVLayout.addDropOutHandler(new DropOutHandler() { public void onDropOut(DropOutEvent event) { rightVLayout.setBackgroundColor("#ffffff"); } }); rightVLayout.addDropHandler(new DropHandler() { public void onDrop(DropEvent event) { SC.say("Dropped a " + ((DraggableProgramPiece) EventHandler.getDragTarget()).getName()); } });
Code:
public class DraggableProgramPiece extends HLayout { private String name; public DraggableProgramPiece(String imgSrc, String pieceName, int height) { super(); name = pieceName; Img img = new Img(); img.setSrc(imgSrc); img.setSize(height + "px", height + "px"); Label label = new Label(pieceName); label.setSize("*", height +"px"); label.setStyleName("DraggablePieceLabel"); this.setSize("100%", height +"px"); this.setStyleName("DraggablePiece"); this.addMember(img); this.addMember(label); // this.setCanDragReposition(true); this.setCanDrag(true); this.setCanDrop(true); this.setDragAppearance(DragAppearance.TARGET); this.setDragOpacity(60); } public String getName() { return name; } }
Code:
VLayout leftVLayout = new VLayout(); leftVLayout.setSize("34%", "100%"); // vl2.setShowEdges(true); // vl2.setPadding(8); // vl2.setMembersMargin(8); SectionStack signalSectionStack = new SectionStack(); signalSectionStack.setAnimateSections(true); signalSectionStack.setItemStartIndent(8); signalSectionStack.setItemEndIndent(8); signalSectionStack.setMembersMargin(8); signalSectionStack.setCanReorderSections(false); signalSectionStack.setCanResizeSections(false); signalSectionStack.setSize("100%", "100%"); DraggableProgramPiece msg1 = new DraggableProgramPiece("64/sms.png", "SMS", 48); DraggableProgramPiece msg2 = new DraggableProgramPiece("64/mail.png", "Email", 48); DraggableProgramPiece msg3 = new DraggableProgramPiece("64/heart.png", "Favorite", 48); DraggableProgramPiece msg4 = new DraggableProgramPiece("64/link.png", "Portal", 48); leftVLayout.addMember(signalSectionStack); page4Layout.addMember(leftVLayout); page4Layout.addMember(rightVLayout);
Comment