|
|
|
|
|
- Use conditions
- Operation and special cases
ChangeTheme (Function) In french: ChangeThème Is used to change, through programming, the theme (dark or light) used by the mobile application.
IF CBOX_NightMode THEN
ChangeTheme(stThemeDark)
ELSE
ChangeTheme(stThemeLight)
END
Syntax
ChangeTheme(<Theme> [, <Option>])
<Theme>: Integer constant Theme to apply:
| | stThemeAutomatic | Default theme used by the mobile device. The theme changes automatically according to the system settings. | stThemeDark | Forces the use of the dark theme. | stThemeLight | Forces the use of the light theme. |
<Option>: Optional Integer constant Indicates whether theme change events should be run: | | withCodeExecution (Default value) | All WLanguage events related to the theme application are run in the following order: - Event "Application of light/dark theme" of the project.
- Optional event "Application of light/dark theme" of the windows.
- Optional event "Application of light/dark theme" of the internal windows.
Note: If the dark theme cannot be applied to the window ("Do not apply dark theme" option in the "Style" tab of the window description), the "Application of light/dark theme" event is not executed for this window. However, it is executed for all other open windows and for the project. | withoutCodeExecution | No WLanguage event (project and/or windows or internal windows) linked to the application of the light/dark theme is run. |
Remarks Use conditions The dark theme must have been enabled in the application in order to use ChangeTheme: - Open the project description window. To do so, go to the "Project" tab, "Project" group, and click "Description".
- On the "Style" tab, check "Allow switching to dark theme (automatically or manually via ChangeTheme)".
- Validate.
If the dark theme has not been allowed, ChangeTheme returns an error. Operation and special cases - The automatic mode is used by default.
- If the selected theme corresponds to the current theme, ChangeTheme has no effect.
- When ChangeTheme is used, the theme is changed in all the windows of the application (except in those for which the option "Do not apply dark theme" is checked in the "Style" tab of the description window.
- Windows opened next will use the theme specified with ChangeTheme.
Business / UI classification: UI Code Component: wd300android.jar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|