Marvin Applet Events

User 4ceb4fe234

18-04-2008 06:30:18

Dear everybody,





just a simple question. I've a web page with an integrated MarvinView applet. On double-click on the applet, the Sketcher is launched. This works pretty good.





Now my question: Is it possible to perform a user-defined action when the applet is double clicked?





Thanks in advance





Helge

ChemAxon 909aee4527

22-04-2008 13:48:31

Hi Helge,





yes, the listenpropertychange applet parameter can be used. The name of the property fired when msketch opens is "windowOpened".


There is an example that shows this parameter in use along with listing all property change events: http://www.chemaxon.com/test/example-view-propertychange.html





Another parameter that can be interesting: http://www.chemaxon.com/marvin/help/developer/viewman.html#parameters.editable





I'm not sure if you wish to disable opening the msketch window or just listening to this property change.


Please tell us if you need more help!





Kind regards,


Judit

User 4ceb4fe234

23-04-2008 05:28:00

Dear Judit,.





this is very interesting and may work as a workaround for our purposes. What I exactly want to do is to to some JavaScript action when the MarvinView Applet is DoubleClicked, e.g. jump to another site or open a browser window, etc.





But as far as I can see it is only possible to start MarvinSketch (or -View) on DoubleClick or to ignore the DoubleClick completely. The event "DoubleClick" itself is not reported via "listenpropertychanged", correct?





As a first workaround I'll tyr to implement a "listenpropertychanged" handler that handles the "selectedIndex" event with the paramers "detachable" and "editable" set to false and 0, respectively. This enables me to react on single clicks.





However, it would be very nice get feedback about the DoubleClick event. Do you see a chance to get it?





Thanks in advance!





Helge

ChemAxon 7c2d26e5cf

24-04-2008 22:26:09

Can you describe in more detail what you would like to do by double-click.


I am not sure that passing mouse events for JavaScript would be the best way.


I have to think over this question.

ChemAxon 909aee4527

04-07-2008 13:44:06

Dear Helge,





a new applet parameter "listenmouseevent" will be introduced in Marvin 5.1, that works similarly to "listenpropertychange" and reports all mouse events including double click.


An applet example will also be available that shows the usage of both parameters.





The following links will only be available after the release (hopefully early next week, but I cannot promise):


http://www.chemaxon.com/marvin/examples/applets/view/listeners.html


http://www.chemaxon.com/marvin/help/developer/viewman.html#parameters.listenmouseevent





Combining this with mview_param("detachable", "false"); should allow to perform a user-defined action on double click.





Please tell us if you prefer the changes in the 5.0 series, and we will make it available with the 5.0.7 release as soon as possible.





Kind regards,


Judit

ChemAxon 909aee4527

29-07-2008 07:19:23

Dear Helge,





the listenmouseevent parameter is available with Marvin 5.0.7.


The links I gave in the previous post do work now.





Regards,


Judit