get_window_extentsT_get_window_extentsGetWindowExtentsGetWindowExtents (Operator)

Name

get_window_extentsT_get_window_extentsGetWindowExtentsGetWindowExtents — Abfragen von Informationen über die Größe und Position eines Fensters.

Signatur

get_window_extents( : : WindowHandle : Row, Column, Width, Height)

Herror T_get_window_extents(const Htuple WindowHandle, Htuple* Row, Htuple* Column, Htuple* Width, Htuple* Height)

void GetWindowExtents(const HTuple& WindowHandle, HTuple* Row, HTuple* Column, HTuple* Width, HTuple* Height)

void HWindow::GetWindowExtents(Hlong* Row, Hlong* Column, Hlong* Width, Hlong* Height) const

static void HOperatorSet.GetWindowExtents(HTuple windowHandle, out HTuple row, out HTuple column, out HTuple width, out HTuple height)

void HWindow.GetWindowExtents(out int row, out int column, out int width, out int height)

Beschreibung

get_window_extentsget_window_extentsGetWindowExtentsGetWindowExtentsGetWindowExtents gibt die Position der linken oberen Ecke, sowie die Breite und die Höhe des Ausgabefensters aus.

Achtung

Die Größe und die Position eines Fensters können durch den Windowmanager verändert werden, ohne dass dies vom Programm aus vorgenommen wurde. Deshalb können sich die Werte, die get_window_extentsget_window_extentsGetWindowExtentsGetWindowExtentsGetWindowExtents liefert, durch diesen Seiteneffekt ändern.

Ausführungsinformationen

Parameter

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Fenster-Handle.

RowRowRowRowrow (output_control)  rectangle.origin.y HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Zeilenindex der linken oberen Ecke des Fensters.

ColumnColumnColumnColumncolumn (output_control)  rectangle.origin.x HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Spaltenindex der linken oberen Ecke des Fensters.

WidthWidthWidthWidthwidth (output_control)  rectangle.extent.x HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Breite des Fensters.

HeightHeightHeightHeightheight (output_control)  rectangle.extent.y HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe des Fensters.

Beispiel (HDevelop)

open_window(100,100,200,200,'root','visible','',WindowHandle)
fwrite_string(FileHandle, 'Move the window with the mouse!')
fnew_line(FileHandle)
repeat
get_mbutton(WindowHandle,_,_,Button)
get_window_extents(WindowHandle,Row,Column,Width,Height)
fwrite_string(FileHandle, ['(',Row,',',Column,')'])
fnew_line(FileHandle)
until(Button == 4)

Beispiel (C)

open_window(100,100,200,200,"root","visible","",&WindowHandle);
fwrite_string(FileHandle,"Move the window with the mouse!");
fnew_line(FileHandle);
create_tuple(&String,1);
do
{
  get_mbutton(WindowHandle,NULL,NULL,&Button);
  get_window_extents(WindowHandle,&Row,&Column,&Width,&Height);
  sprintf(buf,"Row %d Col %d ",Row,Column);
  set_s(String,buf,0);
  T_fwrite_string(FileHandle, String);
  fnew_line(FileHandle);
}
while(Button < 4);

Beispiel (HDevelop)

open_window(100,100,200,200,'root','visible','',WindowHandle)
fwrite_string(FileHandle, 'Move the window with the mouse!')
fnew_line(FileHandle)
repeat
get_mbutton(WindowHandle,_,_,Button)
get_window_extents(WindowHandle,Row,Column,Width,Height)
fwrite_string(FileHandle, ['(',Row,',',Column,')'])
fnew_line(FileHandle)
until(Button == 4)

Beispiel (HDevelop)

open_window(100,100,200,200,'root','visible','',WindowHandle)
fwrite_string(FileHandle, 'Move the window with the mouse!')
fnew_line(FileHandle)
repeat
get_mbutton(WindowHandle,_,_,Button)
get_window_extents(WindowHandle,Row,Column,Width,Height)
fwrite_string(FileHandle, ['(',Row,',',Column,')'])
fnew_line(FileHandle)
until(Button == 4)

Beispiel (HDevelop)

open_window(100,100,200,200,'root','visible','',WindowHandle)
fwrite_string(FileHandle, 'Move the window with the mouse!')
fnew_line(FileHandle)
repeat
get_mbutton(WindowHandle,_,_,Button)
get_window_extents(WindowHandle,Row,Column,Width,Height)
fwrite_string(FileHandle, ['(',Row,',',Column,')'])
fnew_line(FileHandle)
until(Button == 4)

Ergebnis

get_window_extentsget_window_extentsGetWindowExtentsGetWindowExtentsGetWindowExtents liefert den Wert 2 (H_MSG_TRUE), falls das Fenster gültig ist. Ansonsten wird eine Fehlerbehandlung durchgeführt.

Vorgänger

open_windowopen_windowOpenWindowOpenWindowOpenWindow, set_drawset_drawSetDrawSetDrawSetDraw, set_colorset_colorSetColorSetColorSetColor, set_coloredset_coloredSetColoredSetColoredSetColored, set_line_widthset_line_widthSetLineWidthSetLineWidthSetLineWidth

Siehe auch

set_window_extentsset_window_extentsSetWindowExtentsSetWindowExtentsSetWindowExtents, open_windowopen_windowOpenWindowOpenWindowOpenWindow

Modul

Foundation