Scriptcase provides macros, functions created by the developers of Scriptcase, which will assist in customizing applications as well as simplifying code editing at events.
In this article, we will see how to use the sc_set_theme macro in practice, to change the themes of your applications.
The macro changes the theme in the session, causing the change to be applied to all other applications until the session is finished or the theme changes again.
1. Run the login application and select a theme.
2. Click on ok, to execute the onValidity event, to change the theme.
The next application, in this example the form, will receive the selected theme.
This macro changes the theme in the session, as previously informed.
In this way, all applications will be displayed with the selected theme, including the login application.
To keep the login with the default theme, add the sc_set_theme macro to the onApplicationInit event stating the desired theme.
If you would like the login theme to also be changed, just do not add the macro in the onApplicationInit event.