Hi Arthur,

                     I appreciate your help. I will definitely try the
editable grid & the gwt dnd project. Mean while do you want to take a
look at my immature piece of code where i have tried to implement a
drag & drop that didn't work as expected ? (The draggable object is
moving in the correct direction but not synchronized with the mouse
cursor)

Well the code snippet is ,

"
public class DragListener implements MouseListener{

        private boolean blnFlag = false;
        private Widget w;
        private int x,y;

        public DragListener(Widget w){
                this.w = w;
                DOM.setStyleAttribute(w.getElement(),"position","absolute"); // 
Let
the object float
        }

        public void onMouseDown(Widget sender, int x, int y) {
                DOM.setCapture(w.getElement()); // Will capture mouse events
                blnFlag = true;
                this.x = x - w.getAbsoluteLeft(); // The offset of cursor 
inside the
object area
                this.y = y - w.getAbsoluteTop();
        }

        public void onMouseEnter(Widget sender) {
        }

        public void onMouseLeave(Widget sender) {
        }

        public void onMouseMove(Widget sender, int x, int y) {
                if(blnFlag == true){
                DOM.setIntStyleAttribute(w.getElement(), "left", x - this.x); //
move object
                DOM.setIntStyleAttribute(w.getElement(), "top", y - this.y);
                }
        }

        public void onMouseUp(Widget sender, int x, int y) {
                if(blnFlag == true){
                        blnFlag=false;
                        DOM.releaseCapture(w.getElement());
                DOM.setIntStyleAttribute(sender.getElement(), "left", x - 
this.x);
                DOM.setIntStyleAttribute(sender.getElement(), "top", y - 
this.y);
                        }
        }

}

Thanks,
Hazem


On Dec 17, 6:57 pm, "Arthur Kalmenson" <[email protected]> wrote:
> For an editable grid, take a look at the 
> PagingScrollTable:http://code.google.com/docreader/#p=google-web-toolkit-incubator&s=go...
>
> Drag and drop capabilities can be done with the gwt-dnd 
> project:http://code.google.com/p/gwt-dnd/. I haven't tried it myself.
>
> --
> Arthur Kalmenson
>
> On Wed, Dec 17, 2008 at 12:48 AM, Haz <[email protected]> wrote:
>
> > I am trying to build an editable grid for a spreadsheet application.
> > Can anyone suggest me a grid already available that serves my purpose
> > (the grid should be resizable, editable, multiselectable, scrollable).
>
> > If a good one is not available, i don't mind building one but do you
> > guys know of any in-depth GWT tutorial that would help me build custom
> > widgets with drag & drop capabilities.
>
> > Many Thanks,
> > Hazem
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to