Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Screen.Width
Queries screen width.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Screenshot | 1.0 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
ScreenID | The zero based index of the screen to to target. | 0 | |
Unit | Available in MBS FileMaker Plugin 15.0 or newer. Can be point or pixel or empty. Default is pixel on Windows and point on macOS/iOS. |
"Point" | Optional |
Description
Queries screen width.FileMaker's built in functions for returning related information only works for the "desktop" and may include more than one screen in a Multiple monitor situation.
For version 7.1 we added support for multiple monitors for Windows.
Examples
Get the first screen's co-ordinates
MBS( "Screen.Left" ; 0 ) & "' " &
MBS( "Screen.Top" ; 0 ) & "' " &
MBS( "Screen.Width" ; 0 ) & "' " &
MBS( "Screen.Height" ; 0 )
Figure out on which screen the first window is:
Let([
WindowCenterX = MBS( "Window.GetLeft"; 0 ) + MBS( "Window.GetWidth"; 0 );
WindowCenterY = MBS( "Window.GetTop"; 0 ) + MBS( "Window.GetHeight"; 0 );
$ScreenIndex = -1;
r = While (
[
c = MBS( "Screen.Count" );
i = 0
] ;
i < c ;
[
l = MBS( "Screen.Left"; i );
t = MBS( "Screen.Top"; i );
w = MBS( "Screen.Width"; i );
h = MBS( "Screen.Height"; i );
$ScreenIndex = If(
(l ≤ WindowCenterX) AND
(t ≤ WindowCenterY) AND
(WindowCenterX ≤ l + w) AND
(WindowCenterY ≤ t + h) ; i; $ScreenIndex );
i = i + 1 ] ; 0 )
]; $ScreenIndex)
See also
- Screen.Count
- Screen.Height
- Screen.Left
- Screen.Top
- Window.GetHeight
- Window.GetLeft
- Window.GetTop
- Window.GetWidth
Release notes
- Version 15.0
- Added Unit parameter to Screen.Height, Screen.Left, Screen.Top and Screen.Width functions.
Example Databases
Blog Entries
This function checks for a license.
Created 18th August 2014, last changed 22nd November 2024