Class CadMTextEditorLayout
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
The words of an MTEXT being edited in place, laid out as the canvas will draw them: the one layout of the display, wrapped at the width, its lines spaced by the MTEXT's rule, its stacks, tabs, indents, paragraph spacing, columns, mask and frame, in the drawing's fonts; with where each place of the editor (CadMTextEditor) stands, for its caret and selection. Everything is in the MTEXT's own frame and drawing units: its location at nought, x along its direction, y up.
public sealed class CadMTextEditorLayout
- Inheritance
-
CadMTextEditorLayout
- Inherited Members
Remarks
"II II II" in an MTEXT 20 wide of letters 10 high is laid out as "II II" with its baseline 10 below the top and "II" 50 / 3 below that, as the canvas draws it; the caret after the last letter stands at the end of the second line, and the space at the break stays at the end of the first. An empty paragraph at the end of the words is a line here, as AutoCAD's editor shows a caret on it, though the drawn MTEXT has no such line.
Constructors
- CadMTextEditorLayout(CadDocument, CadInPlaceEdit)
Makes the layout of an MTEXT edited in place: the MTEXT of the edit's handle, its spacing style, columns, mask and frame kept; for an MTEXT being made or a table cell, an MTEXT of the edit's height, width, style and attachment.
Properties
- Bounds
Gets the box of everything drawn: the defined box, the ink of the letters and the mask and frame; left, bottom, right and top.
- Box
Gets the box the MTEXT is defined by, as its grips stand: left, bottom, right and top.
- ColumnCount
Gets how many columns the words stand in now: 1 with none, those the words fill with dynamic ones.
- Frame
Gets the MTEXT's box as last laid out: the editor's frame; null before the first Update(CadMTextEditor, int, double, int, int) with it.
- LineCount
Gets how many lines the words make, an empty paragraph at the end one of them.
- Parts
Gets the parts the words are drawn as, as the canvas draws an MTEXT (Parts): the mask and the frame first, then the runs and their lines.
Methods
- BaselineOf(int)
Gets the baseline of a line.
- BottomOf(int)
Gets the foot of a line's cell: the ink below its baseline, or a third of the MTEXT's height.
- ColumnOf(int)
Gets the column a line stands in, from nought.
- LineEnd(int)
Gets the place at the end of a line, where End goes: before the space it breaks at or the paragraph break that ends it, or after the last place of the words.
- LineOfPlace(int)
Gets the line a place stands on.
- LineStart(int)
Gets the first place of a line, where Home goes.
- PlaceAt(double, double)
Gets the place nearest a point, for a click: on the line under it (of the column under it, or the nearest), before the first letter whose middle is right of it, else at the line's end.
- PlaceOnLine(int, double)
Gets the place of a line nearest an X, for the arrows up and down: before the first letter whose middle is right of it, else at the line's end.
- RightOf(int)
Gets where a place's letter ends along the line: the X of the caret after it on the same line.
- SetMask(CadMTextMask)
Gives the words the background mask the editor shows them on, drawn by the next Update(CadMTextEditor, int, double, int, int); the MTEXT's own where none is given. A file older than R2004 has no background, and keeps the words as they are.
- TopOf(int)
Gets the top of a line: of its tallest letters.
- Update(CadMTextEditor, double, int, double, int, int)
Lays the words out again, as they are and with the box as the editor has it now. A width of nought wraps nothing; with columns, the width is the columns'.
- Update(CadMTextEditor, int, double, int, int)
Lays the words out again, as they are and in the box the editor has now (Frame): its width, defined height and columns, as the ruler and Column Settings change them.
- XOf(int)
Gets where the caret stands before a place, along the line: the left of its letter.