Generic Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version

## body-left-indentation

Arguments: text-edit-pane

Returns the current indentation of the lefthand side of a paragraph of text in a `text-edit-pane`, or the indentation indicated by the corresponding lower-left slider of a `rich-edit-ruler`.

This generic function may be called either on a `text-edit-pane` (typically a `rich-edit-pane`) or on a `rich-edit-ruler`. The methods behave somewhat differently: for a `text-edit-pane`, body-left-indentation is relative to top-left-indentation to match the rich text specification and the Microsoft rich edit control; for a `rich-edit-ruler`, top-left-indentation is instead relative to body-left-indentation to match the intuitive practice of moving the overall indentation of one or more paragraphs without changing the relative indentation of the first line of each paragraph.

The `text-edit-pane` method returns the left indentation of the body of the paragraph that contains the text-edit-pane's text cursor (or the first paragraph partly or wholly contained in the selected text, if any). The body is considered to be all lines of the paragraph except the first. This value is measured in points, and is measured rightward from the text-edit-pane's top-left-indentation, which in turn is measured rightward from the interior left of the text-edit-pane. A point is one seventy-second of an inch. Therefore, if a paragraph's body is indented by one inch and its first line is indented by a further inch, the top-left-indentation would be 144 and the body-left-indentation would be -72. This is the way that the rich-edit control was designed in the operating system, and reflects the rich text specification and the values that appear in the rich text string that might be read from the text-edit-pane. For a more intuitive style of measurement, it may be preferable to use the indentation of an associated `rich-edit-ruler` instead.

The setf method for `text-edit-pane` sets the indentation of the body of the paragraph that contains the text cursor (or all paragraphs that are partly or wholly selected, if any). If there is a `rich-edit-ruler` associated with the text-edit-pane (see the function ruler), then the rich-edit-ruler's indentation will be automatically modified to match.

The `rich-edit-ruler` method returns the position of the slider at the lower left of the ruler, measured in points from the leftmost position. This is not relative to the position of the upper left slider, which is normally used to control the top-left-indentation of a text-edit-pane.

The setf method for `rich-edit-ruler` moves the lower-left slider of the ruler to the specified position. Since the top-left-indentation of a rich-edit-ruler is relative to the body-left-indentation, the upper-left slider will also move by the same amount. Each slider will be independently constrained at position 0 (the leftmost position) if an attempt is made to move it to a negative position. If there is a text-edit-pane associated with the ruler (see the function rich-edit), then the paragraph in the text-edit-pane that contains the text cursor (or all paragraphs that are partly or wholly contained in the selected text, if any) will be automatically modified to match.

To apply this function to a `rich-edit` control, first apply window to the control to obtain a `rich-edit-pane` to pass to this function.

To read or modify multiple paragraph attributes of a `text-edit-pane` at once, see get-paragraph-format or set-paragraph-format. See also right-indentation.

See cg-rich-text.htm for information on rich text editing in Common Graphics.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version