Class Platform

Platform abstraction layer.

class Platform;

Represents application.

Fields

NameTypeDescription
_instance Platform
GLVersionMajor intOpenGL context major version.
GLVersionMinor intOpenGL context minor version.
multisamples intOpenGL multisamples amount.
_resourceDirs string[]
_themeId string
_uiDialogDisplayMode ulong
_uiLanguage string

Properties

NameTypeDescription
defaultWindowIcon[set] stringsets default icon for new created windows
defaultWindowIcon[get] stringgets default icon for new created windows
iconProvider[get] IconProviderBase
iconProvider[set] IconProviderBase
instance[get] Platform
resourceDirs[get] string[]returns list of resource directories
resourceDirs[set] Platformset list of directories to load resources from
uiDialogDisplayMode[get] ulongreturns how dialogs should be displayed - as popup or window
uiDialogDisplayMode[set] Platform
uiLanguage[get] stringreturns currently selected UI language code
uiLanguage[set] Platformset UI language (e.g. "en", "fr", "ru") - will relayout content of all windows if language has been changed
uiTheme[get] string
uiTheme[set] Platformsets application UI theme - will relayout content of all windows if theme has been changed

Methods

NameDescription
closeWindow (w) close window
createWindow (windowCaption, parent, flags, width, height) create window
enterMessageLoop () Starts application message loop.
getClipboardText (mouseBuffer) retrieves text from clipboard (when mouseBuffer == true, use mouse selection clipboard - under linux)
getMultisamples () Returns the amount of multisamples. Returns 0 if no OpenGL support
hasClipboardText (mouseBuffer) check has clipboard text
hasModalWindowsAbove (w) returns true if there is some modal window opened above this window, and this window should not process mouse/key input and should not allow closing
onDpiChanged () Called when the device pixel ratio changes. Clears cached resources and triggers re-layout so pt-based sizes are recomputed at the new scale.
onThemeChanged () handle theme change: e.g. reload some themed resources
openURL (url) open url in external browser
requestLayout () calls request layout for all windows
setClipboardText (text, mouseBuffer) sets text to clipboard (when mouseBuffer == true, use mouse selection clipboard - under linux)
setInstance (instance)
showInFileManager (pathName) show directory or file in OS file manager (explorer, finder, etc...)
setDefaultLanguageAndThemeIfNecessary () to set uiLanguage and themeId to default (en, theme_default) if not set yet

Aliases

NameDescription
~this