Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

EventMonitor.SetCardWindow

Sets script trigger for clicks outside card.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
EventMonitor 7.3 Yes Yes No No No

MBS( "EventMonitor.SetCardWindow"; WindowRef; X; Y; Width; Height; FileName; ScriptName )

Parameters

Parameter Description Example value
WindowRef Window Reference is the unique OS level window ID. You can obtain this by using the Window.FindByTitle or Window.FindByIndex functions. Pass zero to access the frontmost window. 0
X X position of the card in the parent window.
Can be negative for automatic center position.
-1
Y Y position of the card in the parent window.
Can be negative for automatic center position.
-1
Width The width of the card window. 600
Height The height of the card window. 400
FileName The file name where to find the script. Get(FileName)
ScriptName The name of the script to trigger when a click is received outside the card area. "Close Card Script"

Result

Returns OK or error.

Description

Sets script trigger for clicks outside card.
You can show a card and have the MBS Plugin watch for mouse clicks outside the card area. The plugin can trigger a script. As script triggers are queued up, please make sure you handle various cases like several clicks queue up.

Please call EventMonitor.Install once before and make sure it’s enabled.

With plugin version 6.0 or newer the script name can be a script ID number. In that case the plugin queries the script name for the given script ID. This allows to call scripts by ID and avoid problems if scripts are later renamed.

Examples

Install trigger:

Set Variable [ $r ; Value: MBS( "EventMonitor.Install" ) ]
Set Variable [ $$cardShowing ; Value: 1 ]
Set Variable [ $r ; Value: MBS( "EventMonitor.SetCardWindow"; Get(WindowName); -1; -1; 600; 400; Get(FileName); "Close Script" ) ]
New Window [ Style: Card ; Name: "Card" ; Using layout: “Tabelle” ; Height: 400 ; Width: 600 ]

Close script:

If [ $$cardShowing ]
    Set Variable [ $$cardShowing ; Value: 0 ]
    Close Window [ Name: "Card" ; Current file ]
    Set Variable [ $r ; Value: MBS("EventMonitor.ClearCardWindow") ]
End If

See also

Example Databases


EventMonitor.LastMousePositionY   -   EventMonitor.SetEnabled

Feedback: Report problem or ask question.




Links
MBS FileMaker blog