.NET Form: Change skin and selection color programmatically?

User 1a8d11549a

19-09-2011 08:18:11

First of all thanks for exposing the MarvinEditor control for inheriting in Marvin 5.6, and implementing
NativeEditor, EditorHandle, FocusEditor and SaveSetting . This is much appreciated (are they mentioned
in the release notes and in the API documentation? - I'm not sure).

Here's my question: I am trying to overcome the not-so-elegant and heavy bold type font interface of the
Marvin .NET control, e.g. towards the much better looking  "Windows" skin. The "Look and feel" popup in the preferences dialog is disabled in this control, so this can't be changed by the user. - How can this be
achieved programmatically?


And on the same page: How can the squeaky green atom selection markers be changed to something more decent, e.g. a light blue color?


Thanks for your help,
Stefan

ChemAxon bd13b5bd77

22-09-2011 06:14:22

Dear Stefan,


colour of the selection cannot be changed now.


There should be a skin parameter for changing the l&f:


setParams("skin=...")


I am back to you once I figured it out.


Viktor

ChemAxon bd13b5bd77

22-09-2011 07:29:21


 



 Dear Stefan,


 in your CustomEditor we discussed in a different forum topic


you can add:


 public  Form1() {


InitializeComponent();
base.CancelButton = new System.Windows.Forms.Button();


var lookAndFeels = UIManager.getInstalledLookAndFeels();
UIManager.setLookAndFeel(lookAndFeels[0].getClassName());
 



 




OR UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());





 



}




 


 Viktor 

User 1a8d11549a

22-09-2011 08:00:52

Thanks a lot Victor, this works very nicely!


There's one thing I came across, though: There are four pre-installed skins on the control (Metal, Motif, Windows and Windows Classic), from which Windows and Windows Classic seem to look identical to me. Wereas the "Windows Classic" skin looks like expected,  the "Windows" skin doesnt look like in the standalone editor. - Is this intended?


Finally, as an idea: If users in the future would get the option to select a selection color, this might be a welcome enhancement ...

ChemAxon bd13b5bd77

22-09-2011 08:04:17

This is the Sun/Oracle approach for skins.


I will forward  your request to Marvin team in terms of selection colour.


 


Viktor

User 1a8d11549a

22-09-2011 08:11:25

So this means that in the Sun/Oracle approach the "Windows" and "Windows Classic" skins are intended to look the same? They sure don't when you apply them in the MarvinSketch standalone application preferences, if you try here ...


Stefan

ChemAxon bd13b5bd77

22-09-2011 08:15:40

It seems. Stefan, please drop a question in the Marvin forum as well about skins you experienced.


Do you have the java version also installed? It is worth checking this as well there.


 

User 1a8d11549a

22-09-2011 08:27:56

If you mean by "Java version" the standalone MarvinSketch application, then yes (I described my differing observations there). Otherwise I have just JChem_Net installed.


I will follow up in the Marvin forum later, I just assumed that this is an issue of the .NET control, since it shows different behavior with the skin selection than the Java standalone version, which works as expected.


Thanks again for your help.