Herror ::get_string_extents (
    const HTuple &WindowHandle,
    const HTuple &Values,
    long *Ascent,
    long *Descent,
    long *Width,
    long *Height
)
HTuple HWindow::GetStringExtents (
    const HTuple &Values,
    HTuple *Descent,
    HTuple *Width,
    HTuple *Height
) const

Get the spatial size of a string.

::get_string_extents queries width and height of the output size of a string using the font of the window. In addition the extension above and below the current baseline for writing is returned (Ascent bzw. Descent).

The sizes are measured in the coordinate system of the window (for text windows in pixels). Using ::get_string_extents it is possible to determine text output and input independently from the used font. The conversion from integer numbers and floating point numbers to text strings is the same as in ::write_string.


Parameters

WindowHandle (input_control)
window -> HTuple.long
Window identifier.

Values (input_control)
string(-array) -> HTuple.char * / double / long
Values to consider.
Default value: 'test_string'

Ascent (output_control)
integer -> long *
Maximum height above baseline for writing.

Descent (output_control)
integer -> long *
Maximum extension below baseline for writing.

Width (output_control)
integer -> long *
Text width.

Height (output_control)
integer -> long *
Text height.


Result

::get_string_extents returns H_MSG_TRUE if the window is valid. Otherwise an exception handling is raised.


Possible Predecessors

::open_window, ::open_textwindow, ::set_font


Possible Successors

::set_tposition, ::write_string, ::read_string, ::read_char


See also

::set_tposition, ::set_font


Module

System



Copyright © 1996-2002 MVTec Software GmbH