[Chameleon] MouseDown Javascript Func

Paul Spencer pspencer at dmsolutions.ca
Mon Jun 27 12:17:07 EDT 2005


Abe,

this touches on what is most likely one of the weakest parts of 
Chameleon's internal architecture and one that I am dying to fix.

Essentially, those functions no longer do anything.  What actually 
happens is that the MapDHTML widget handles all mousedown/mouseup 
handling on behalf of the various widgets (look in MapDHTML.js).

This was necessary to prevent some serious performance problems. 
However, it was implemented as a work-around instead of a real fix, 
since the real fix would have required substiantial changes to the 
javascript object model used by Chameleon, potentially breaking a great 
many things.

What are you trying to do?  I will try to point you into the right 
direction to accomplish it withing the constraints of this somewhat 
broken architecture.

Cheers

Paul

Abe Gillespie wrote:
> In my widget I set the MouseDown Javascript func like so:
> 
> 	function GetJavascriptOnMouseDownFunctions()
> 	{
> 		$funcs = array();
> 		$this->addEventFunc($funcs, "MouseDown");
> 		return $funcs;
> 	}
> 
> 	function addEventFunc(&$funcArray, $funcName)
> 	{
> 		$funcArray[$funcName] = $this->name.$funcName."(e);";
> 	}
> 
> And it shows up in the Javascript section faithfully like:
> 
> 	function CWC2OnMouseDownFunction(e)
> 	{
> 
> 		MyWidgetMouseDown(e);
> 	}
> 
> Where the function is:
> 	function abesLineToolMouseDown(e)
> 	{
> 		alert("Down baby!");
> 	}
> 
> But nothing happens when I indeed mouse-down.  I do get this
> Javascript error ... not sure if it's related or not:
> 
> Error: MapWReleaseMouse is not defined
> 
> Thanks for any help.
> -Abe
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 

-- 
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+


More information about the Chameleon mailing list