Marvin Setch: Set ChemDraw or ISIS/Draw view config in .NET?

User 1a8d11549a

05-01-2012 09:07:32

Marvin Sketch offers the useful ability to configure its UI to resemble ISIS/Draw or ChemDraw using View- > Configurations. How can this be done via .NET code?

ChemAxon bd13b5bd77

05-01-2012 18:18:06

Hi Stefan,


investigating the chances more and back to you with a result soon.


Viktor

ChemAxon bd13b5bd77

05-01-2012 21:43:23

Dear Stefan,


Result of my investigations is:


- Now as you remember we save the user settings in the end in your custom editor form
NativeEdtor.getUserSettings().save("Marvin parameters");



If your users set any of the listed settings, next time the correct view is going to be displayed.
I think this is an acceptable  workaround to the problem for the time being.


 


- The real solution would be to save the proper settings (like ISIS) from View/Configuration/Configuration Settings/Export, from here you wil gain an XML, which looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<customization active="config1">
  <scheme id="config1" name="ISIS/Draw-like"/>
</customization>



this xml string can be added to the
NativeEdtor.getUserSettings().setProperty(



 




"menuconfig", "C:\\Users\\h\\Work\\CustomEditor\\SavedStyle.xml");


The only problem with it that the Native sketcher constructor has to get this in the constructor to be made alive in menus.


 


So what I could suggest now is that I will register a task for this for 5.9 and expose a Settings property on the Editor interface for you.


Editor.MenuConfig = xml;


 


Viktor

User 1a8d11549a

06-01-2012 11:57:39

Dear Victor,


Thanks for your information - I'll wait for version 5.9 then to implement this in code.


Best regards (and all the best for 2012!)
Stefan

ChemAxon bd13b5bd77

09-01-2012 17:42:23

Stefan, is your question targeting to build up menus programmatically from code or would you like to activate the menus from code?


Activate the configuration will be implemented soon in 5.9, configuring from code can be more complicated.


Predefined XML config files should be written out I think, but I need to investigate this more.

User 1a8d11549a

09-01-2012 17:54:28

Victor,


I am not complete sure if I understand your question. What I would like to have is some .NET code equivalent to selecting the menu item e.g. View->Configurations-> ISIS/Draw-like, or one of the other views, which then rearrange the Marvin Sketch UI accordingly.


Stefan

ChemAxon bd13b5bd77

09-01-2012 18:13:51

This is much clearer now,


I had concerns after rereading our conversation in the forum entry if I understood everything what you needed perfectly.


You meant activation of the predefined UI styles from .NET code. Okay, this is what I investigated so far.


Will be in the next release (5.9), I will send you interim releases to test the feature.

User 1a8d11549a

09-01-2012 18:22:34

I am looking forward to it, thanks!

ChemAxon bd13b5bd77

10-01-2012 12:44:49


 The new interface method is :


 public UIModes CurrentUIMode on MarvinEditorControl.



in your custom Editor form:


 this.editor.CurrentUIMode = MarvinEditorControl.UIModes.ISISDrawLike;


 


Stefan please note that this is a development version, the final one will be release in mid March.
This installer will be removed from the temp folder soon.


User 1a8d11549a

10-01-2012 14:00:41

Victor, these are links point to JChem.NET for Excel. I am not sure if this is what I need - or is this identical to the standard JChem.NET?

ChemAxon bd13b5bd77

10-01-2012 16:55:39

You are right since the JChem .NET devel folder has not been used for years, this is why I am used to put the dev versions into JChemExcel (regardless of the material represents the JCXL or the underlying api).


But from now I tried to copy it across to the proper place.
BTW there is no JChem.NET for Excel, we do not have such a product, we do have JChem .NET API for all products including JChem for Excel as well.


http://www.chemaxon.com/download.php?d=/data/download/jchem/devel/JChem_NET_API_AnyJChem_5_9_0_421_487.x64.msi


http://www.chemaxon.com/download.php?d=/data/download/jchem/devel/JChem_NET_API_AnyJChem_5_9_0_421_487.x64.msi


 


 Stefan please note that this is a development version, the final one will be release in mid March.
This installer will be removed from the temp folder soon.

User 1a8d11549a

11-01-2012 12:10:31

This works perfectly,exactly wat I needed, thanks Victor!


Side note: This is version 5.9, while the current one is 5.7. When do you estimate this to become an official release? I am asking because I am close to the release of my ELN, and I guess that using this interim build would be a bit of an adventure ...

ChemAxon bd13b5bd77

11-01-2012 12:14:36

Yes, good question.


This week the company is busy with coming out the 5.8 official, final tests are taking palce now.
5.9 will be out in the middle of March. We introducing a4 week dev period ...


 

User 1a8d11549a

11-01-2012 12:22:00

Ok, thanks.


Please also consider following Sketch dialog issue then for 5.9 (see attached screenshot): In the lower part of the dialog often a small, transparent stripe is visible, where the background of the application shines through - not a show-stopper, but looks a bit strange ...

ChemAxon bd13b5bd77

11-01-2012 12:39:31

In your inherited control can say refresh when resizing.

User 1a8d11549a

11-01-2012 13:20:55

The refresh unfortunately doesn't work in my case, but I've found a workaround now: In the OnActivated event of the dialog I apply :


Me.Height -= 1
Me.Height += 1

This works. The issue before was, that the dialog displayed the transparency when opened, and before any resize occurred. After a resize it went away. Therefore I can live with this workaround for now. 

ChemAxon bd13b5bd77

11-01-2012 13:55:13

Yeah, this code generates refresh. Thank your for the solution.