ダイアログボックスの位置を設定する。
setdlgpos [<x> <y> [<position> [<offset x> <offset y>]]]
"inputbox", "listbox", "messagebox", "passwordbox", "statusbox", "yesnobox" コマンドで表示されるダイアログボックスとエラーダイアログの表示位置を変更する。
また、ステータスダイアログボックスが表示されている場合、setdlgpos コマンドはそのダイアログボックスを移動させる。
ダイアログがディスプレイからはみ出す場合は、ディスプレイ内に移動される。(バージョン 4.105以降)
座標の単位はピクセル。
; 左上の隅にダイアログボックス setdlgpos 0 0 messagebox 'Message' 'Title' ; ステータスダイアログボックスを開く setdlgpos 0 200 statusbox 'Message' 'Title' ; ステータスダイアログボックスを移動 for i 0 200 setdlgpos i 200 next ; VTウィンドウの左上を基準に表示する setdlgpos 0 0 6 messagebox 'top-left' 'VT window' ; ディスプレイの右上を基準に、下に10px、左に10pxに表示する 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 VT window' message_string_array[7] = 'top-right of the VT window' message_string_array[8] = 'bottom-left of the VT window' message_string_array[9] = 'bottom-right of the VT window' message_string_array[10] = 'center of the VT 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