![]() |
Dial_SetPosition |
Sets the position on the screen of dialogs to be shown.
Syntax
Dial_SetPosition ( switches ; left ; top )
Parameters
switches | specifies the scope of the SetPosition function |
left | the left co-ordinate (in pixels) of the dialog |
top | the top co-ordinate (in pixels) of the dialog |
Switches
Switches can be empty or must be one of these:
-All | show all subsequent dialogs at the specified position |
-Once | show only the next dialog at the specified position |
If you don’t specify a switch the position is set once. If you want to reset the position to the default position use this switch:
-Default | show all subsequent dialogs at the default position |
You can also add this switch:
-UseCenterCoordinates | the coordinates specify where the center of the dialog will be positioned (instead of the top left of the dialog) |
Returned Result
Data type returned
Error code
Result
An error code. Currently the plug-in always returns 0.
Originated in
Troi Dialog Plug-in 3.0
Compatibility
FileMaker Pro 17 to FileMaker Pro 21 (2024)
Considerations
On macOS the plug-in makes sure the dialog does not display under the menu bar.
version 12.0 added the switch -UseCenterCoordinates
Example
Set Field [ gErrorCode ; Dial_SetPosition ( "-Once" ; 100 ; 150 ) ]
This will set the position of the next dialog box to 100 pixels from the left and 150 pixels from the top of the screen.
Set Field [ gErrorCode ; Dial_SetPosition ( "-Once -UseCenterCoordinates" ; 840 ; 720 ) ]
This will set the position of the next dialog box, the *center* of the dialog will be 840 pixels from the left and 720 pixels from the top of the screen.
Example 2
This example will use fields to set the position for all next dialogs. We assume that in your FileMaker file the following fields are defined:
gErrorCode Global, text
gLeft Global, text
gTop Global, text
Add the following script step:
Set Field [ gErrorCode ; Dial_SetPosition ( "-All " ; gLeft ; gTop ) ]
Used in example file
Position.fmp12
Related functions
Dial_CenterPointOfRect |
Dial_Dialog |
Dial_GetGlobalScreenPosition |
Dial_GetScreenInfo |
Dial_InputDialog |
Dial_ListDialog |
Related topics
Troi Dialog Plug-in online help (overview)