One other thing... Have you looked at the mouseevent codes (mouse_xxxjs)? The MouseEvent._eventHandler() contains some codes that will prevent form elements from being dragged. Inside the mouse_ie.js file you'll also see a new piece of code that enables selection of text inside the textarea if the layer is drag-able.
So in that case we can either more the code from MouseEvent._eventHandler() to dragevent.js or remove the code from drag events. What do you think? -- Raymond Irving --- Benoit Marchant <[EMAIL PROTECTED]> wrote: > Well, I think it did before I modified the code. In > dynapi2, there the > following: > > DynMouseEvent.EventMethod=function(e) { > var dynobject=this.lyrobj; > if(is.def) { > if (is.ie) var e=dynobject.frame.event > e.cancelBubble=true; > > if (DynAPI.wasDragging && e.type=="click") { > DynAPI.wasDragging=false; > return false; > } > } > .... > > to avoid sending onclick after a dragend. We can re > do the same, the > wasDragging is still set in dragevent.js > I can't think of a case where it would be bad to > receive both. But if > we need to do it, we know what to do ! > > So I'll go on and commit the changes. > > Benoit > > On Wednesday, March 12, 2003, at 01:36 PM, Raymond > Irving wrote: > > > > > Yep! It works fine on my machine with the > exeception > > of one thing... > > > > The onclick event is been triggered at the end of > a > > drag. Is that by design? > > > > -- > > Raymond Irving > > > > > > --- Benoit Marchant <[EMAIL PROTECTED]> wrote: > >> Thanks Raymond, that should fix the ondragend > >> issue, but listeners > >> would still receive an ondragstart and maybe an > >> ondragmove. > >> The only way I see to do it "right" would be to > >> bring back the logic > >> from dynapi2. > >> I've brought back t he fix to be able to use form > >> elements in draggable > >> layers. > >> > >> Here it is. Please test in on your machines > >> > >> > > > >> ATTACHMENT part 2 application/octet-stream > > x-unix-mode=0755; name=dragevent.js > > > > --------------------------------- > > DynAPI Examples - Drag > > Eventdynapi.library.setPath('../src/ > > > ');dynapi.library.include('dynapi.api');dynapi.library.include('dynapi. > > > > library');dynapi.library.include('dynapi.debug');dynapi.library.include > > > ('DragEvent');var > > p = dynapi.document.addChild(new > > DynLayer(null,50,90,200,200,'silver'))var > > a=p.addChild(new > > > DynLayer(null,10,10,20,20,'red'))DragEvent.enableDragEvents(a);DragEven > > > t.setDragBoundary(a, > > {left:5, right:5, top:5, bottom:5});var p2 = > > dynapi.document.addChild(new > > > DynLayer(null,300,90,200,200,'silver'))p2.setHTML(' > > [input] ');DragEvent.enableDragEvents(p2);var > > dragevents = {};dragevents.onclick = function(e) { > var > > o = e.getSource(); > document.frm.click.value = > > 'onclick'; document.frm.dragstart.value = ''; > > document.frm.drag.value = > '';}dragevents.ondragstart = > > function(e) { var o = e.getSource(); > > document.frm.dragstart.value = e.type; > > document.frm.click.value = > '';}dragevents.ondragmove = > > dragevents.ondragend = function(e) { var o = > > e.getSource(); if(e.type == 'ondragend') > > document.frm.dragstart.value = ''; > > document.frm.drag.value = > > > e.type;}a.addEventListener(dragevents);dynapi.onLoad(function() > > { str = '// Try these tests:\n\n'+ > > 'p.setSize(150,350);\n'+ > '//p.setSize(200,200);\n'; > > dynapi.debug.setEvaluate(str);});Click: [input] > > Drag Start: [input] > > Drag: [input] > dynapi.document.insertAllChildren();> > >> > >> if it's working fine, I'll commit to cvs. > >> > >> Benoit > >> > >> On Tuesday, March 11, 2003, at 08:39 PM, Raymond > >> Irving wrote: > >> > >>> Notes my comments below: > >>> > >>> --- Benoit Marchant <[EMAIL PROTECTED]> wrote: > >>>> Hi > >>>> > >>>> I mentioned it before, but I'm pretty sure we > >> need > >>>> to address this. If > >>>> you click on a layer that's dragable, you will > >> both > >>>> get ondragend and > >>>> onclick called. If you have an event handler on > >> both > >>>> events doing > >>>> different things, you're screwed ! > >>>> I believe, tell me if that's wrong, that the > >>>> ondragend event should no > >>>> be sent if just a click happens. To fix that, > we > >> can > >>>> either add the > >>>> test that was in dynapi2 for that reason, or do > >>>> something else, maybe > >>>> set a "dragmoved" flag in dragevent.onmousemove > >> that > >>>> we could check in > >>>> dragevent on mouseup ? > >>> > >>> See the attached file. I just did a quick fixed. > >> I've > >>> not tested the file but it should work. I've > used > >> a > >>> .wasDragged flag to check if the layer was > draged > >>> > >>> -- > >>> Raymond Irving > >>> > >>> > >>>> > >>>> Benoit > >>>> > >>>> > >>>> > >>>> > >>> > >> > > > ------------------------------------------------------- > >>>> This SF.net email is sponsored by:Crypto > >> Challenge > >>>> is now open! > >>>> Get cracking and register here for some mind > >>>> boggling fun and > >>>> the chance of winning an Apple iPod: > >>>> > >>> > >> > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > >>>> _______________________________________________ > >>>> Dynapi-Dev mailing list > >>>> [EMAIL PROTECTED] > >>>> > >>> > >> > > > http://www.mail-archive.com/[EMAIL PROTECTED]/ > >>> > >>> > >>> > __________________________________________________ > >>> Do you Yahoo!? > >>> Yahoo! Web Hosting - establish your business > >> online > >>> http://webhosting.yahoo.com<dragevent.zip> > > > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! Web Hosting - establish your business > online > > http://webhosting.yahoo.com > === message truncated === __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com ------------------------------------------------------- This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/[EMAIL PROTECTED]/