| Allegro CL version 8.2 Unrevised from 8.1 to 8.2. 8.1 version |
Arguments: graphical-stream &optional (stream-units-p t)
Returns the current left margin of a graphical-stream
, measured from the
left edge of the stream. The left-margin is initially zero,
except as noted below. (setf left-margin) may be called to set
the margin at any time.
If stream-units-p is true, as it is by default,
then the margin is measured in pixels. If nil
, it is measured in space character widths (see
space-width).
Margin attributes are provided primarily to allow an application to keep a drawing within arbitrary margins by drawing everything within the coordinates returned by left-margin, top-margin, right-margin, and bottom-margin. Common Graphics also uses them in a few special ways, though, as described below.
Whenever a newline character is printed to a graphical-stream, the current-position-x of the stream is set to the stream's left-margin, and the current-position-y is incremented by the line-height of the stream. This causes the next line of text to be printed at the left margin and just below the previous line.
A text-edit-pane
is an exception to
the general newline behavior. It is a control that positions text in
its own way, and inserting a newline does not add spaces or tabs to
the text-editing area to reflect the stream's left margin. The left-margin of a text-edit-pane
normally should be left at zero to allow pretty-printed output to fit
the interior width of the window as usual (see right-margin). The function
(setf text-edit-margins) may be
called instead to establish or modify the margins for all of a text-edit-pane
's text.
When opening a printer
stream or calling new-page to advance to
the next printed page, the current-position-x of the stream is
set to its left-margin, and the current-position-y is set
to its top-margin.
A printer
stream's coordinate system has position (0, 0) at the printer-physical-offset
of the printer. To allow an application to avoid dealing with this
arbitrary offset, Common Graphics sets the margins of a printer stream
to the distance from the physical offset to the margins selected by
the user in the print job dialog or page setup dialog. This allows
the application to maintain the requested paper margins by simply
drawing everything within the four margins that were set up
automatically. See *default-printer-left-margin*
for
more information.
Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.
| Allegro CL version 8.2 Unrevised from 8.1 to 8.2. 8.1 version |