setdlgpos
Sets the position of dialog box.
setdlgpos [<x> <y> [<position> [<offset x> <offset y>]]]
Parameters
- integer <x>
- X coordinate of the top-left corner of the dialog box.
- integer <y>
- Y coordinate of the top-left corner of the dialog box.
- integer <position>
- Display position of the dialog box.
1 : Top-left of the display.
2 : Top-right of the display.
3 : Bottom-left of the display.
4 : Bottom-right of the display.
5 : Center of the display.
6 : Top-left of the terminal window.
7 : Top-right of the terminal window.
8 : Bottom-left of the terminal window.
9 : Bottom-right of the terminal window.
10 : Center of the terminal window.
- integer <offset x>
- X coordinate adjustment value for the display position specified by <position>.
- integer <offset y>
- Y coordinate adjustment value for the display position specified by <position>.
Return Value
- No return value.
Remarks
Change the display position of the dialog boxes and the error dialog shown by the "inputbox", "listbox", "messagebox", "passwordbox", "statusbox", "yesnobox".
If the status dialog box is displayed, the setdlgpos command will move that dialog box.
If the dialog extends beyond the display, it will be moved within the display.
The unit is points.
- setdlgpos
When the parameter is omitted, the display position will be centered on the main display (the primary display)." - setdlgpos <x> <y>
Specify the coordinates (x,y) of the top-left corner of the dialog box using <x> and <y>.
<x> and <y> must be specified as a pair.
The origin (0,0) is the top-left corner of the main display. - setdlgpos <x> <y> <position>
- If <position> is between 1 and 5,
If the macro is linked with a window, the dialog box will be shown on the display where the terminal window is displayed.
If the macro is not linked with a window, the dialog box will be shown on the main display.
The display position of the dialog box will be the location specified by <position>, and <x> and <y> will be ignored. - If <position> is between 6 and 10,
If the macro is linked with a window, the dialog box will be shown on the display where the terminal window is displayed.
If the macro is linked with a window, the display position will be the location specified by <position>.
If the macro is not linked with a window or if the window is minimized or hidden, the dialog box will be shown on the main display.
In this case, the display position will be the <x> <y> coordinates.
- If <position> is between 1 and 5,
- setdlgpos <x> <y> <position> <offset x> <offset y>
The display position of the dialog box will be the location obtained by adding <offset x> <offset y> to the display position (x,y coordinates) specified by setdlgpos <x> <y> <position>.
<offset x> and <offset y> must be specified as a pair.
When specifying negative values, please refer to the Note on negative integer constants.
Example
; Message box at the upper left corner. setdlgpos 0 0 messagebox 'Message' 'Title' ; Open the status box. setdlgpos 0 200 statusbox 'Message' 'Title' ; Moves the status box. for i 0 200 setdlgpos i 200 next ; Message box at the top-left of the terminal window. setdlgpos 0 0 6 messagebox 'top-left' 'VT window' ; Message box at the top-right offset 10px of the display. setdlgpos 0 0 2 (-10) 10 messagebox 'top-right offset 10px' 'Display'
strdim message_string_array 11 message_string_array[1] = 'top-left of the display' message_string_array[2] = 'top-right of the display' message_string_array[3] = 'bottom-left of the display' message_string_array[4] = 'bottom-right of the display' message_string_array[5] = 'center of the display' message_string_array[6] = 'top-left of the terminal window' message_string_array[7] = 'top-right of the terminal window' message_string_array[8] = 'bottom-left of the terminal window' message_string_array[9] = 'bottom-right of the terminal window' message_string_array[10] = 'center of the terminal window' strdim listbox_string_array 3 listbox_string_array[0] = 'Banana' listbox_string_array[1] = 'Apple' listbox_string_array[2] = 'Orange' x = 0 y = 0 offset_x = 0 offset_y = 0 for position 1 10 sprintf2 message 'setdlgpos %d %d %d %d %d\n(%s)' x y position offset_x offset_y message_string_array[position] strspecial message setdlgpos x y position offset_x offset_y statusbox message 'statusbox' messagebox message 'messagebox' yesnobox message 'yesnobox' inputbox message 'inputbox' passwordbox message 'passwordbox' listbox message 'listbox' listbox_string_array next