ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Mobile specific functions / Phone functions
  • Use conditions
  • Operation and special cases
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Is used to change, through programming, the theme (dark or light) used by the mobile application.
Example
// Lors de la modification du champ Interrupteur INT_ModeNuit
IF INT_ModeNuit THEN
	ChangeTheme(stThemeDark)
ELSE 
	ChangeTheme(stThemeLight)
END
// Initialisation du thème du projet à celui du système
ChangeTheme(SysTheme())
Syntax
ChangeTheme(<Theme> [, <Option>])
<Theme>: Integer constant
Theme to apply:
stThemeAutomaticDefault theme used by the mobile device. The theme changes automatically according to the system settings.
stThemeDarkForces the use of the dark theme.
stThemeLightForces 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:
  1. Event "Application of light/dark theme" of the project.
  2. Optional event "Application of light/dark theme" of the windows.
  3. Optional event "Application of light/dark theme" of the internal windows.
Note: If the application of the dark theme is forbidden for the window (option "Do not apply dark theme" in the "Style" tab of the window description window), the "Apply light/dark theme" event is not executed for this window, but the "Apply light/dark theme" events for all other open windows and the project are executed.
withoutCodeExecutionNo 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:
  1. Open the project description window. To do so, go to the "Project" tab, "Project" group, and click "Description".
  2. On the "Style" tab, check "Allow switching to dark theme (automatically or manually via ChangeTheme)".
  3. Validate.
If the dark theme has not been allowed, ChangeTheme returns an error.
For more details, see Dark theme management.

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
Minimum version required
  • Version 25
Comments
Click [Add] to post a comment

Last update: 10/01/2024

Send a report | Local help