LMD-RichPack 2022 What's New


New API reference


TLMDRichEdit class

 

property TransparentBoolean;

Allow to turns on native transparent background mode. This mode does not work well with the border, so, it's a good idea to set BorderStyle to bsNone.

property SpellCheckingBoolean;

Provies the ability to check spelling in the edit text. This is native RichEdit feature, so spell checking setting (if any) is provided by Windows.
The feature checks only the portion of the text, which is typed or modified after turning spell checking mode on. For full spell check the document should be reloaded.

procedure InsertTable(ARowCount, ARow);

Inserts a table into the cursor position consisting of ARowCount identical rows. The structure of rows, including the number of columns, column widths, borders and colors, is specified by the ARow parameter.
See the description of the related types below:

"TLMDInsertRow

"TLMDInsertCell

"TLMDInsertCellBorder

property TextDocumentITextDocument;

WinAPI Text Object Model (TOM) interface for advanced use. Provided "as is". Please look for more info in the corresponding Microsoft documentation.
Some examples of TOM usage is provided in our new Demo Center.

property TextDocument2ITextDocument2;

WinAPI Text Object Model 2 (TOM2) interface for advanced use. Provided "as is". Please look for more info in the corresponding Microsoft documentation.
Some examples of TOM2 usage is provided in our new Demo Center.

TLMDRichEdit.PreviewDialog;

TLMDRichEdit.PagePropertiesDialog;

TLMDRichEdit.Print;

The behavior of these printing related methods was changed to use LMD PrintPack functionality.
See the description of the related new global function LMDRichGetPrinter below.

TLMDRichEdit.PrinterSetupDialog;

New method, which allows to show printer setup dialog. As the previous APis also rely on LMD PrintPack functionality.

property ScrollPositionTPoint;

Allows to obtain the current scroll position of the edit control in pixel.

property ShowURLHintBoolean;

When set to True and the cursor is over a link, display a tooltip with the target link address.

property LinkOptionsTLMDRichLinkOptions;

Allows to prevent default hyper-text action in case of using the custom OnLinkClick event handler. Enum members:

"loGotoBookmark

"loGotoItem

 

TLMDTextAttributes class

 

TLMDTextAttributes is used as a type of the following TLMDRichEdit control properties:

 

"DefAttributes

"SelAttributes

"WordAttributes

 

property BoldBoolean;

The property allows to mark the corresponding text fragment with the bold style. Other srtyle flags, like Italic, Underline or Strikeout are not affected.

property ItalicBoolean;

The property allows to mark the corresponding text fragment with the italic style. Other srtyle flags, like Bold, Underline or Strikeout are not affected.

property UnderlineBoolean;

The property allows to mark the corresponding text fragment with the underline style. Other srtyle flags, like Bold, Italic or Strikeout are not affected.

property StrikeoutBoolean;

The property allows to mark the corresponding text fragment with the strikeout style. Other srtyle flags, like Bold, Italic or Underline are not affected.

 

TLMDParaAttributes class

 

TLMDParaAttributes is used as a type of the TLMDRichEdit.Paragraph property.

 

property ConsistentAttributes:

  TLMDConsistentParaAttributes;

Indicates which of the corresponding properties of the TLMDParaAttributes object are consistent throughout the text of the current paragraph in the rich edit object. The enumeration provides the following values:

"cpaAlignment

"cpaNumbering

"cpaFirstIndent

"cpaLeftIndent

"cpaRightIndent

"cpaTabStops

 

TLMDInsertRow type

 

TLMDInsertRow record type is used as the ARow parameter in TLMDRichEdit.InsertTable method to specify inserting table row structure. The following code gives an idea of how to use the TLMDInsertRow type:

 

procedure TForm1.Button1Click(Sender: TObject);

var

  rw: TLMDInsertRow;

begin

  rw.Alignment := raCenter;

  rw.Height := 500;

  rw.AddCell(1500, caTop);

  rw.AddCell;

  rw.AddCell;

 

  LMDRichEdit1.InsertTable(5, rw);

end;

 

Note: Microsoft does not provide the documentation of the corresponding WinAPI data structs. So, the following descriptions is taken from the RTF format syntax description.

 

procedure Reset;

Clears all property settings and cells.

procedure ClearCells;

Clear cells.

function AddCellTLMDInsertCel;

function AddCell(AWidthInteger;

  AAlignmentTLMDCellAlignment):

  TLMDInsertCell;

Adds a new cell. The cell is added to the end of the Cells list. The second method overload allows to specify new cell width and alignment via the corresponding method parameters.

property IndentInteger;

Position of the leftmost edge of the table with respect to the left edge of its column.

property HeightInteger;

Height of a table row in twips. When 0, the height is sufficient for all the text in the line; when positive, the height is guaranteed to be at least the specified height; when negative, the absolute value of the height is used, regardless of the height of the text in the line.

property AlignmentTLMDRowAlignment;

Row alignment:

"raLeft: Left-justifies a table row with respect to its containing document.

"raRight: Right-justifies a table row with respect to its containing document.

"raCenter: Centers a table row with respect to its containing document.

property KeepTogetherBoolean;

Table row keep together. This row cannot be split by a page break. This property is assumed to be off unless the control word is present.

property KeepOnTheSamePageBoolean;

Keep row on same page as following row.

property WrapTextBoolean;

Wrap text to right/left (depending on Alignment).

property CellsMarginInteger;

Half the space between the cells of a table row in twips.

property CellsRTLOrderBoolean;

Cells in this table row will have right-to-left precedence.

property CellCountInteger;

Count of cells in this row descriptor. Cells can be added using Add methods diocumented above.

property Cells[Index]: TLMDInsertCell;

The Cells property provides access to individual cells, added previously using Add method.

 

TLMDInsertCell class

 

TLMDInsertCell class is used to describe a cell (or column) in a TLMDInsertRow row descriptor. Cells can be added using TLMDInsertRow.Add overloaded methods, and enumerated using the corresponding CellCount and Cells[] properties.

 

Note: Microsoft does not provide the documentation of the corresponding WinAPI data structs. So, the following descriptions is taken from the RTF format syntax description.

 

property WidthInteger;

Defines the right boundary of a table cell, including its half of the space between cells.

property AlignmentTLMDCellAlignment;

Vertical alignment of the cell text:

"caTop: Text is top-aligned in cell (the default).

"caBottom: Text is bottom-aligned in cell.

"caCenter: Text is centered vertically in cell.

property FirstVertMergeCellBoolean;

Top cell for vertical merge.

property FirstHorzMergeCellBoolean;

Merge with cell above.

property MergeVertWithAboveBoolean;

Start set of horizontally merged cells.

property MergeHorzWithAboveBoolean;

Merge with the previous cell.

property RTLTextBoolean;

Display text top to bottom, right to left.

property ShadingWord;

The shading of a table cell in hundredths of a percent. This control should be included in RTF along with cell border information.

property BorderTLMDInsertCellBorder;

Provides cell border subproperties:

"Left: Left cell border thickness.

"Top: Top cell border thickness.

"Right: Right cell border thickness.

"Bottom: Bottom cell border thickness.

"LeftColor: Left table cell border color.

"TopColor: Top table cell border color.

"RightColor: Right cell border color.

"BottomColor: Bottom cell border color.

property BackgroundColorTColor;

Cell background color.

property ForegroundColorTColor ;

Cell foreground (text) color.

 

Global functions

 

LMDRichGetPrinter(AEdit);

LMDRichGetPrinter(ACombo);

Provide access to the TLMDPrinter object, used by the corresponding rich edit or rich combo box. If the custom callback function is not specified via LMDGetPrinterProc global variable, automatically created single global printer object is used.

var LMDGetPrinterProc:

  TLMDGetPrinterProc;

Provides the ability to specify custom callback function to determine the TLMDPrinter object, which should be used for rich edit or rich combo box instead of the default single printer object.

 

Following is an example of providing a custom printer object using LMDGetPrinterProc callback. The example callback function returns the custom printer component LMDPrinter1, placed on the Form1 at design-time:

 

procedure TForm1.FormCreate(Sender: TObject);

begin

  LMDGetPrinterProc := function(AEditOrCombo: TControl): TLMDPrinter

  begin

    Result := LMDPrinter1; 

  end;

end;