PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV Mobile 25 feature!
  • Use conditions
  • Operation and special cases
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Is used to change, by programming, the theme (dark or light) used by the mobile application.
Example
// When modifying the Check Box control "CBOX_NightMode"
IF CBOX_NightMode THEN
ChangeTheme(stThemeDark)
ELSE
ChangeTheme(stThemeLight)
END
// Initialize project theme using system theme
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.
stThemeLightForces the use of the light theme.
stThemeDarkForces the use of the dark 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.
Remark: If the dark theme cannot be applied to the window (option "Do not apply dark theme" in the "Style" tab of the window description), the event "Application of light/dark theme" is not run in this window, but it is run in all the other open windows and in the project.
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: on the "Project" pane, in the "Project" group, click "Description".
  2. In 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.

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