BBjWebManager::setDarkTheme

Description

In BBj 22.03 and higher, this method sets the name of the theme to use when a DWC application has specified the system theme option with setTheme("system") and the user has configured their system to use dark mode. This will usually be "dark", but the "dark-pure" variant is also available.

Syntax

Return Value Method
string setDarkTheme(string darkTheme)

Parameters

None.

Variable Description
darkTheme Specifies a DWC theme name ("light", "dark", or "dark-pure")

Return Value

None.

Remarks

Themes are only meaningful in the DWC client.

Example

BBjWebManager Themes
rem ' BBjWebManager Themes

title$ = "BBjWebManager Themes"

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()

web! = bbjapi().getWebManager()

window! = sysgui!.addWindow(25,25,600,325,title$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")

window!.addStaticText(101,25,25,150,25,"setTheme:",$8000$)
themes$ = "light" + $0a$ + "dark" + $0a$ + "dark-pure" + $0a$ + "system" + $0a$
setThemeList! = window!.addListEdit(102,200,25,200,200,themes$,$$)
setThemeList!.selectIndex(0)
setTheme! = window!.addButton(103,425,25,150,25,"setTheme",$$)
setTheme!.setCallback(setTheme!.ON_BUTTON_PUSH,"setTheme")

window!.addStaticText(104,25,75,150,25,"getTheme:",$8000$)
getThemeText! = window!.addEditBox(105,200,75,200,25,"",$$)
getThemeText!.setEditable(0)
getTheme! = window!.addButton(106,425,75,150,25,"getTheme",$$)
getTheme!.setCallback(getTheme!.ON_BUTTON_PUSH,"getTheme")

window!.addStaticText(107,25,125,150,25,"setDarkTheme:",$8000$)
themes$ = "dark" + $0a$ + "dark-pure" + $0a$ + "light" + $0a$
setDarkThemeList! = window!.addListEdit(108,200,125,200,200,themes$,$$)
setDarkThemeList!.selectIndex(0)
setDarkTheme! = window!.addButton(109,425,125,150,25,"setDarkTheme",$$)
setDarkTheme!.setCallback(setDarkTheme!.ON_BUTTON_PUSH,"setDarkTheme")

window!.addStaticText(110,25,175,150,25,"getDarkTheme:",$8000$)
getDarkThemeText! = window!.addEditBox(111,200,175,200,25,"",$$)
getDarkThemeText!.setEditable(0)
getDarkTheme! = window!.addButton(112,425,175,150,25,"getDarkTheme",$$)
getDarkTheme!.setCallback(getDarkTheme!.ON_BUTTON_PUSH,"getDarkTheme")

window!.addStaticText(113,25,225,150,25,"setLightTheme:",$8000$)
themes$ = "light" + $0a$ + "dark" + $0a$ + "dark-pure" + $0a$
setLightThemeList! = window!.addListEdit(114,200,225,200,200,themes$,$$)
setLightThemeList!.selectIndex(0)
setLightTheme! = window!.addButton(115,425,225,150,25,"setLightTheme",$$)
setLightTheme!.setCallback(setLightTheme!.ON_BUTTON_PUSH,"setLightTheme")

window!.addStaticText(116,25,275,150,25,"getLightTheme:",$8000$)
getLightThemeText! = window!.addEditBox(117,200,275,200,25,"",$$)
getLightThemeText!.setEditable(0)
getLightTheme! = window!.addButton(118,425,275,150,25,"getLightTheme",$$)
getLightTheme!.setCallback(getLightTheme!.ON_BUTTON_PUSH,"getLightTheme")

process_events

eoj:
release

setTheme:
  theme$ = setThemeList!.getText()
  web!.setTheme(theme$)
return

getTheme:
  theme$ = web!.getTheme()
  getThemeText!.setText(theme$)
return

setDarkTheme:
  darkTheme$ = setDarkThemeList!.getText()
  web!.setDarkTheme(darkTheme$)
return

getDarkTheme:
  darkTheme$ = web!.getDarkTheme()
  getDarkThemeText!.setText(darkTheme$)
return

setLightTheme:
  lightTheme$ = setLightThemeList!.getText()
  web!.setLightTheme(lightTheme$)
return

getLightTheme:
  lightTheme$ = web!.getLightTheme()
  getLightThemeText!.setText(lightTheme$)
return

ClosedVersion History

  • BBj 22.03: getTheme introduced.

See Also

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.

BBjAPI

BBjBuiManager / BBjWebManager

DWC Themes

BBjWebManager::getDarkTheme

BBjWebManager::getLightTheme

BBjWebManager::getTheme

BBjWebManager::setLightTheme

BBjWebManager::setTheme