how do I change the background when msketch is detached

User 62a37f4796

11-03-2009 21:41:51

I am trying to create a webpage with several MSketch editors in them.





I am using the following setup:











Code:
          msketch_param("detach", "hide,maxscale=33");


          msketch_param("undetachByX", "false");


          msketch_param("buttonmenubar", "false");









I know I can set the background in the detached editor itself with the "molbg" param, but I would like to keep that the default white.





Here's my problem: I would like to change the background of the MSketch portion that remains embedded in the page. At the very least, I would want to change the color of it so it stands out in the webpage. This portion, however, does not seem to be affected by the molbg modifier. What I'd really like is for the embedded portion to show a grid akin to millimeter paper, to direct the user to enter their answer right there.








I cannot find a way to achieve either in the online documentation or forum.





Any ideas how to achieve this?





Thanks.























Product Version:    MarvinSketch 5.1.4


Build Date:        2008-12-18


Operating System:    x86 Windows XP 5.1


Java:        Sun Microsystems Inc. Java 1.6.0_12

ChemAxon 7c2d26e5cf

16-03-2009 17:54:54

The "molbg" parameter initializes the background color of MarvinSketch panel and the background color of sketcher button (from where the sketcher window is detached).








In current Marvin, there is no way to modify the color of the sketcher button. The Edit/Color menu controls only the color of the edit canvas in the sketcher window.





I do not recommend to use too much applet instances on the same page. Since the huge ammount of applets requires a lot of memory that slows down the loading of the page and it may cause out of memmory error in the browser. See the FAQ about it.





Instead of that I can recommend to insert images iinto your html page and link the opening of sketcher applet to the mouse clicking event on the image.





See the following basic examples how to do it (last 4 examples on this page):


http://www.chemaxon.com/marvin/examples/beans/image-generation/index.html





I also recommend to take a look at the following ajax example on the JChem page:


http://www.chemaxon.com/jchem/examples/ajax/





It demonstrates how you can display huge number of molecules quickly on a page (by clickin on the molecule image, it turns into edit mode where an applet control the structure).

User 62a37f4796

16-03-2009 19:23:54

Quote:
The "molbg" parameter initializes the background color of MarvinSketch panel and the background color of sketcher button (from where the sketcher window is detached).








In current Marvin, there is no way to modify the color of the sketcher button. The Edit/Color menu controls only the color of the edit canvas in the sketcher window.






You are correct. That is what I found. I do need the embedded portion to stand out from the default white of the remainder of the page, though.








Quote:
I do not recommend to use too much applet instances on the same page. Since the huge ammount of applets requires a lot of memory that slows down the loading of the page and it may cause out of memmory error in the browser. See the FAQ about it.






I'm not planning anywhere near that limit. Repetition is key in teaching students chemistry, though, so I might have a dozen editors in the same page each with a different question to answer. It seems to work in IE7, FF3, and Safari3.








Quote:
Instead of that I can recommend to insert images iinto your html page and link the opening of sketcher applet to the mouse clicking event on the image.





See the following basic examples how to do it (last 4 examples on this page):


http://www.chemaxon.com/marvin/examples/beans/image-generation/index.html






I'll have a look into this.








Quote:
I also recommend to take a look at the following ajax example on the JChem page:


http://www.chemaxon.com/jchem/examples/ajax/





It demonstrates how you can display huge number of molecules quickly on a page (by clickin on the molecule image, it turns into edit mode where an applet control the structure).






We don't have JChem, but I'll talk to my technical folks to see what they can learn from this example.





Thanks!