add my own templates to the default menu bar

ChemAxon 587f88acea

12-07-2004 12:41:45

I would like to exchange the default templates shown in the menu bar with my own templates. Is that possible?


Or how can I change the default shown templates?


Or how can I start the My Templates automatically by starting the program?





Thanks for help!





Tanja

ChemAxon 7c2d26e5cf

13-07-2004 21:26:35

Hello Tanja,
Quote:
I would like to exchange the default templates shown in the menu bar with my own templates. Is that possible?


Or how can I change the default shown templates?


Or how can I start the My Templates automatically by starting the program?





Thanks for help!





Tanja
You can change the default templates both in Marvin Applets and Beans.





Marvin Applets:


Use the tmpls0 parameter to change the starting templates group on the toolbar.


You can find more details about the "tmpls0" parameter in the documentation:


http://www.chemaxon.com/marvin/doc/dev/sketchman.html#parameters.tmpls





The following example demonstrates howto set templates menu.





Code:
<script LANGUAGE="JavaScript1.1" SRC="../../marvin.js"></script>


<script LANGUAGE="JavaScript1.1">


<!--


msketch_begin("../..", 460, 380);


msketch_param("tmpls0", ":Default:newtemplates.t");


msketch_param("tmpls1", ":Generic:chemaxon/marvin/templates/generic.t");


msketch_param("tmpls2", ":Rings:chemaxon/marvin/templates/rings.t");


msketch_param("tmpls3", ":Amino acids:chemaxon/marvin/templates/aminoacids.t");


msketch_param("tmpls4", ":Polycyclics:chemaxon/marvin/templates/polycyclics.t");


msketch_end();


-->


</script>






If you specify only "tmpls0" parameter, only your templates are available in Templates menu.


To add ChemAxon templates to the Templates menu, set also "tmpls1", "tmpls2", etc. parameters to them.





Marvin Beans:


You can specify default templates when you set the parameters of the sketch panel.


Code:



   sketchPane.setParams("tmpls0=*Default*newtemplates.t\n"+


       "tmpls1=*Rings*chemaxon/marvin/templates/rings.t\n"+


       "tmpls2=*Amino acids*chemaxon/marvin/templates/aminoacids.t\n");








You can find more info about setParams in the documentation:


http://www.chemaxon.com/marvin/doc/api/chemaxon/marvin/beans/MarvinPane.html#setParams(java.lang.String)





The My Templates window is not detachable programatically.





Tamas