overrideStyle

Hello,

I have a solution for both OS, Mac and Win. For this I have two different Styles. With an ‘on open method’ I’m checking out the current OS (application.getOSName()) and would like to change the default Style (style_win) by ‘var vStyle = application.overrideStyle(‘style_win’, ‘style_mac’)’. But this doesn’t works. Than I tried this in my ‘onShow’-methods, also without success.

Thank you for help
Thomas

The onOpen method is the way to go. What doesn’t work? Are you sure you check for the OS right (you could make an output “I’m on Mac”, “I’m on Windows” to make sure it really makes that call)?

Hi Patrick!

I get in a global variable ‘Mac OS X’ as the OS version and I made an output like your example. This works fine and in the Debugger the method function ‘application.overrideStyle()’ works also , but the Style in my solution forms is always the default ‘style_win’. It never changes and I have different Parameter in the Styles!

Just to make sure: the style in your forms will always be the same (style_win). OverrideStyle overrides the style at runtime, so in design mode you will never see that change. Have you tested this in a client? What change is it that should happen and does not happen (what style property)?

I tried it in a client. The default property in design mode is ‘style_win’ always in all the forms properties. But overrideStyle on a Mac-Client doesn’t change to the ‘style_mac’ property…!??

Ok, I tested some different style-parameters in style_mac and style_win to find out what happend. In style_mac I set:
button
{
color: red;
}
and in style_win:
{
color: black;
}
This works fine, but parameters like:
form
{
background-color: #ffffcc;
}
in style_mac and
form
{
background-color: #cccccc;
}
in style_win shows always the win-style. I checked my style definitions. In both is only one ‘form’ parameter and the forms property settings are set correct.

So you say that the overrideStyle in general does work, but some things are nor applied correctly, such as background colors? If that is the case, you should file a support case in the support system.

Yes, it is correct that some parameters in a defined style who should override the default are not working. I tested it a lot in the last two days and therefore I will post this in the support system.
Thank you Patrick and have a nice time in Amsterdam.