Difference between revisions of "RichMemo/ru"
Line 19: | Line 19: | ||
__TOC__ | __TOC__ | ||
− | == | + | == Licensing == |
− | '' | + | Author: [[User:Skalogryz|Dmitry 'skalogryz' Boyarintsev]] |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[http://svn.freepascal.org/svn/lazarus/trunk/COPYING.modifiedLGPL modified] [http://svn.freepascal.org/svn/lazarus/trunk/COPYING.LGPL LGPL] (same as the FPC RTL and the Lazarus LCL). You can contact the author if the modified LGPL doesn't work with your project licensing. | [http://svn.freepascal.org/svn/lazarus/trunk/COPYING.modifiedLGPL modified] [http://svn.freepascal.org/svn/lazarus/trunk/COPYING.LGPL LGPL] (same as the FPC RTL and the Lazarus LCL). You can contact the author if the modified LGPL doesn't work with your project licensing. | ||
− | == | + | == Download == |
− | + | The latest trunk is available here: | |
− | https:// | + | https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/richmemo |
− | + | Trunk snapshot can be downloaded from here: | |
− | + | https://havefunsoft.com/share/richmemo.zip . The snapshot is updated nightly. Review "revision.txt" file within the snapshot to find out about the revision it's currently built of. | |
− | |||
− | == | + | == Change Log == |
− | * | + | * Version 1.0.0 22th Jun 2009 |
+ | * Version 0.8.0 Jun 2009 | ||
− | + | == Dependencies / System Requirements == | |
+ | * Lazarus 1.0.0 | ||
− | + | Status: Released. | |
− | + | == Установка == | |
* Скачайте исходники пакета | * Скачайте исходники пакета | ||
* Установите пакет в Lazarus и пересоберите его | * Установите пакет в Lazarus и пересоберите его |
Revision as of 12:28, 21 January 2019
│
English (en) │
polski (pl) │
русский (ru) │
RichMemo is a package that includes a component to replace the Delphi TRichEdit component. It's designed in cross-platform way, so implementation is possible for the following platforms: Win32, MacOSX and Linux. Since, being cross-platform is the primary target, the native RichMemo API can be extended to make it Delphi's RichEdit compatible.
Its main characteristics are
- Text highlight
- System based Unicode edit support
Planned: (patches are welcomed)
- Adding images into text
- Embedding LCL Controls?
The download contains the component, an installation package and a demo application, that illustrates the features of the component along with some instrumentation for evaluating the chart on a given system.
Please add your Bugreports/Feature requests in Lazarus CCR project of the Lazarus bug tracker.
Licensing
Author: Dmitry 'skalogryz' Boyarintsev
modified LGPL (same as the FPC RTL and the Lazarus LCL). You can contact the author if the modified LGPL doesn't work with your project licensing.
Download
The latest trunk is available here: https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/richmemo
Trunk snapshot can be downloaded from here: https://havefunsoft.com/share/richmemo.zip . The snapshot is updated nightly. Review "revision.txt" file within the snapshot to find out about the revision it's currently built of.
Change Log
- Version 1.0.0 22th Jun 2009
- Version 0.8.0 Jun 2009
Dependencies / System Requirements
- Lazarus 1.0.0
Status: Released.
Установка
- Скачайте исходники пакета
- Установите пакет в Lazarus и пересоберите его
- TRichMemo добавится в закладку 'Common Controls'.
Документация
TRichMemo методы
SetTextAttributes
procedure SetTextAttributes(TextStart, TextLen: Integer; AFont: TFont);
- TextStart : Integer - номер первого символа, начиная с которого нужно применить изменение шрифта
- TextLen : Integer - количество символов, к которым нужно применить изменение шрифта
- AFont : TFont - шрифт, на который будет изменен стиль выбранных символов
procedure SetTextAttributes(TextStart, TextLen: Integer; SetMask: TTextStyleMask; const TextParams: TFontParams);
- TextStart : Integer - номер первого символа, начиная с которого нужно применить изменение шрифта
- TextLen : Integer - количество символов, к которым нужно применить изменение шрифта
- TextParams : TFontParams - запись, описывающая свойтсва шрифта, которые должны быть изменены
SetTextureAttributes метод изменяет шрифт в указанном тексте. Метод не изменяет текущее выделение.
Чтобы изменить стиль текщуего выделения, необходимо передать SelStart и SelLength, в качестве параметров TextStart, TextLength, например:
RichMemo1.SetTextAttributes(RichMemo1.SelStart, RichMemo1.SelLength, FontDialog1.Font);
GetTextAttributes
function GetTextAttributes(TextStart: Integer; var TextParams: TFontParams): Boolean; virtual;
- TextStart : Integer - номер символа, у которого необходимо получить шрифт
- var TextParams : TFontParams - возвращаемое значение, которое будет содержать параметры шрифта указанного символа
Функция возвращает параметры шрифта указанного символа. Если в TextStart передан неверный номер символа, функция возвращает False, значение полей записи TextParams неопределено. Если передан правильный TextStart номер символа, функция возвращает True, заполняя запись TextParams
GetStyleRange
function GetStyleRange(CharPos: Integer; var RangeStart, RangeLen: Integer): Boolean; virtual;
Возвращает диапазон символов, который имеет одинаковые параметры шрифта, т.е. у всех символов в диапазоне имя шрифта, размер, цвет и стиль одинаковые.
- CharPos : Integer - позиция символа, который принадлежит диапазону стиля. Необязательно, чтобы позиция соответствовала началу диапазона. Может быть и в середине, и в конце. Позиция первого символа возвращается в параметре RangeStart.
- var RangeStart : Integer - первый символ в диапазоне
- var RangeLen : Integer - количество символов в диапазоне
Метод возвращает True, если завершен успешно. Возвращает False, если CharPos имеет некорректное значение или возникли другие ошибки.
SetRangeColor
procedure SetRangeColor(TextStart, TextLength: Integer; FontColor: TColor);
Метод устанавливает цвет символов в указанном диапазоне для FontColor. Другие параметры шрифта (имя, размер, стили) остаются без изменений.
- TextStart: Integer - первый символ в диапазоне
- TextLength: Integer - количество символов в диапазоне
- FontColor: TColor - цвет, который должен быть установлен
SetRangeParams
procedure SetRangeParams(TextStart, TextLength: Integer;
ModifyMask: TTextModifyMask; const FontName: String;
FontSize: Integer; FontColor: TColor;
AddFontStyle, RemoveFontStyle: TFontStyles);
Метод изменяет параметры шрифта в указанном диапазоне.
LoadRichText
function LoadRichText(Source: TStream): Boolean; virtual;
- Source: TStream - a stream to read richtext data from
The method loads RTF enocded data from the specified stream. Returns true if success, and false otherwise. If source is nil, the method returns false
The content of TRichMemo is completely replaced by the content on the source stream. Current text selection is reset.
SaveRichText
function SaveRichText(Dest: TStream): Boolean; virtual;
- Source: TStream - a stream to read richtext data from
The method saves RTF enocded data to the specified stream. Returns true if success, and false otherwise. If source is nil, the method returns false
Current state of TRichMemo is unchanged after the method returns
TRichMemo свойства
HideSelection
property HideSelection: Boolean default false
Свойство на чтение и запись. Если значение True, то RichMemo не будет показывать текущее выделение, если контрол находится не в фокусе. Если значение False, то выделение показывается всегда. Значение по умолчанию False.