ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / System functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
SysScreenOrientation (Function)
In french: SysOrientationEcran
Allows you to:
  • get the orientation of an Android or iOS device.
  • set the orientation of an Android device.
Example
// Fill the "LIST_Orientations" control with the possibles orientations
ListAdd(LIST_Orientations, SysListScreenOrientation())

// Select the current orientation of the screen in the List Box control
LIST_Orientations = SysScreenOrientation()
AndroidAndroid Widget
// Change the orientation of the screen
// The screen will be turned around
SysScreenOrientation(Orient180)
Syntax

Getting the screen orientation Hide the details

<Result> = SysScreenOrientation()
<Result>: Character String constant
Value of the current screen orientation:
Orient0The screen is oriented in the default direction.
Orient90The screen is turned around by 90° clockwise.
Orient180The screen is turned around by 180°.
Orient270The screen is turned around by 90° counterclockwise (or by 270° clockwise).
AndroidAndroid Widget

Setting the screen orientation Hide the details

<Result> = SysScreenOrientation(<Orientation>)
<Result>: Character String constant
Orientation of the screen after the call to the function.
<Orientation>: Character String constant
Indicates the new orientation of the screen:
Orient0The screen is oriented in the default direction.
Orient90The screen is turned around by 90° clockwise.
Orient180The screen is turned around by 180°.
Orient270The screen is turned around by 90° counterclockwise (or by 270° clockwise).
Remarks
  • The screen orientation cannot be changed in all types of mobile devices. When this feature is not available, SysScreenOrientation always returns Orient0.
  • AndroidAndroid Widget The modification of the orientation will affect the current window only.
  • AndroidAndroid Widget Depending on the type of device on which the application is run (phone or tablet), the default orientation (Orient0) can correspond to:
    • the portrait mode (for most of the phones),
    • the landscape mode (for most of the tablets).
  • AndroidAndroid Widget To define whether an application is displayed in portrait or landscape mode, it is recommended to compare the values returned by SysXRes and SysYRes:
    • if the value returned by SysXRes is less than the value returned by SysYRes, the application is in portrait mode,
    • otherwise, it is in landscape mode.
Business / UI classification: Business Logic
Component: wd300android.aar
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/14/2025

Send a report | Local help