| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version |
Arguments: text-edit-pane index &key bottom position-to-return
Returns the pixel position of the character at index in text-edit-pane.
The returned position object is in stream coordinates, meaning that it is measured from the upper-left corner of the scrollable contents of the window, and so the value will not be affected by the current scroll-position of the window.
text-edit-pane should be a text-edit-pane
or rich-edit-pane
.
index should be a non-negative integer indicating
a character, where 0 indicates the first character in the window,
(file-position text-edit-pane)
indicates the
character immediately to the right of the text cursor, and
(file-length text-edit-pane)
indicates the
hypothetical character just after the last character. (See file-position and file-length.)
If bottom is nil
, as it
is by default, then the returned position is of the upper-left corner
of the character cell. If bottom is true, then
it is the lower-left corner instead.
If position-to-return is nil
, as it is by default, then a new position object
is consed and returned. Otherwise
position-to-return may be a position object, in
which case it is filled in and returned in order to avoid consing a
position object.
For a text-edit-pane
with a fixed-width
font, the returned value could alternately be derived by calling such
functions as line-height, line-number-from-char, and char-from-line-number.
So this function is most useful for a rich-edit-pane
, which typically has
differing line heights and character widths.
See also character-index-at-position.
This example would return the pixel position of the bottom-right corner of the very last character's character cell:
(position-of-character-index my-text-edit-pane (file-length my-text-edit-pane) :bottom t)
Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version |