From: Michael P. <mp...@ph...> - 2001-02-19 12:09:46
|
As has been done with the dragBoundry code, I suggest that we set up a "handle" boundry for a drag event. It would involve testing to see where on the layer the mouse clicks and stopping the event if it is outside the handle boundry. I'm willing to put together the code, I'm just seeing if anyone has any comments / stones : ) -- Michael Pemberton mp...@ph... ICQ: 12107010 |
From: Michael B. <mb...@st...> - 2001-02-19 13:36:37
|
> As has been done with the dragBoundry code, I suggest that we set up a > "handle" boundry for a drag event. It would involve testing to see where > on the layer the mouse clicks and stopping the event if it is outside > the handle boundry. > > I'm willing to put together the code, I'm just seeing if anyone has any > comments / stones : ) you're lucky, because you don't have to do it yourself. i did this just yesterday and it was intended to be posted this evening (CET). i attached the modified dragevent.js-file. there's one line added in DragEvent.lyrListener.onmousedown, the additional code is at the end of the document. sample code: myLayer = new DynLayer(null,100,100,100,100,'red'); DynAPI.document.addChild(myLayer); area = new DragArea('rect',0,100,20,0); DragEvent.addDragArea(myLayer, area); DragEvent.enableDragEvents(myLayer); at the moment, two different DragArea-types are supported: new DragArea('rect',t,r,b,l) new DragArea('circle',centerX,centerY,radius); multiple DragAreas can be added, to a layer if you need more complex areas, you can add them yourself, it shouldn't be too difficult to understand the code. -- Michael Buerge |
From: Michael P. <mp...@ph...> - 2001-02-19 13:39:52
Attachments:
drag.zip
|
I've attached the code. I've also made a few alterations to the dragBoundry (eg. points to the parent instead of setting the value to "parent") Hope this comes in handy to someone other than me. : ) Michael Pemberton wrote: > As has been done with the dragBoundry code, I suggest that we set up a > "handle" boundry for a drag event. It would involve testing to see where > on the layer the mouse clicks and stopping the event if it is outside > the handle boundry. > > I'm willing to put together the code, I'm just seeing if anyone has any > comments / stones : ) > -- > Michael Pemberton > mp...@ph... > ICQ: 12107010 > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev -- Michael Pemberton mp...@ph... ICQ: 12107010 |
From: Michael P. <mp...@ph...> - 2001-02-19 13:56:23
|
I was too quick with my earlier post. the attached version works correctly and also contains an example page. Michael, I posted it at the same time as downloading your post. However, after looking at your code, it is create for use as an extension but is adds almost too much code that is not commonly used. This is very useful for something such as an image map or such. Variety is the spice of life. Michael Pemberton wrote: > As has been done with the dragBoundry code, I suggest that we set up a > "handle" boundry for a drag event. It would involve testing to see where > on the layer the mouse clicks and stopping the event if it is outside > the handle boundry. > > I'm willing to put together the code, I'm just seeing if anyone has any > comments / stones : ) > -- > Michael Pemberton > mp...@ph... > ICQ: 12107010 > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev -- Michael Pemberton mp...@ph... ICQ: 12107010 |
From: Michael B. <mb...@st...> - 2001-02-19 16:19:14
|
> I was too quick with my earlier post. the attached version works correctly > and also contains an example page. > > Michael, I posted it at the same time as downloading your post. However, > after looking at your code, it is create for use as an extension but is adds > almost too much code that is not commonly used. you're right on that. maybe it could be split into an extension for the DragEvent, that you could load only if needed. all that would have to be left in dragevent.js-file is the one line in DragEvent.lyrListener.onmousedown . > This is very useful for something such as an image map or such. > Variety is the spice of life. true! -- Michael Buerge |
From: Michael P. <mp...@ph...> - 2001-02-19 14:04:11
Attachments:
drag.zip
|
Tonight is not my night. here's the code. -- Michael Pemberton mp...@ph... ICQ: 12107010 |
From: Doug M. <do...@cr...> - 2001-02-19 22:37:48
|
I'll second that nothion. ----- Original Message ----- From: "Michael Pemberton" <mp...@ph...> To: <dyn...@li...> Sent: Monday, February 19, 2001 4:07 AM Subject: [Dynapi-Dev] Drag Event suggestions > As has been done with the dragBoundry code, I suggest that we set up a > "handle" boundry for a drag event. It would involve testing to see where > on the layer the mouse clicks and stopping the event if it is outside > the handle boundry. > > I'm willing to put together the code, I'm just seeing if anyone has any > comments / stones : ) > -- > Michael Pemberton > mp...@ph... > ICQ: 12107010 > > > > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev --- Outgoing mail is certified Virus Free by AVG Free Edition Download at: http://www.grisoft.com/html/us_index.cfm Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.231 / Virus Database: 112 - Release Date: 2/12/01 |