TTextStrings class
Implements a string list optimized to handle the complete text as a whole
(instead of line by line as in
TStringList).
Declaration
TTextStrings = class(TCustomMemoStrings)Inheritance
- TTextStrings
- TCustomMemoStrings
TStrings
Description
TTextStrings is a TCustomMemoStrings descendant which implements a
string list optimized for handling the complete text in the list (rather than
on a line by line basis).
The ancestor class ensures that lines of text with wordwrap line endings are
handled in the component. TTextString uses an internal array of
TTextLineRange instances to represent the lines of text.
Overridden methods are provided to ensure that the internal line ranges are
used to implement property values.
TTextStrings is the type instantiated for use in the Lines
property in TCustomMemo.
See also
Properties
Text | public | Contains the textual representation for the values in Strings. |
Methods
GetTextStr | protected | Gets the value for the Text property. |
SetTextStr | protected | Sets the value for the Text property. |
BuildArrays | protected | Clears and builds the array with the line ranges for the values in Text. |
GetCount | protected | Gets the value for the Count property. |
Changed | protected | Performs actions needed after the value in Text is changed. |
Changing | protected | Performs action needed when properties in the component are being updated. |
Get | protected | Gets the value for the indexed Strings property. |
ClearArrays | protected | Clears the internal array of line ranges used in the component. |
GetObject | protected | Gets the value for the indexed Objects property. |
Put | protected | Sets the value for the indexed Strings property. |
PutObject | protected | Sets a value in the indexed Objects property. |
GetLineLen | protected | Gets the length of a line (including optional end-of-line characters) at the specified position. |
GetLineEnd | protected | Gets the ordinal position where the specified line ends in the Text property. |
CountLineEndings | protected | Gets the number of end-of-line sequences found in the specified string. |
Create | public | Constructor for the class instance. |
Destroy | public | Destructor for the class instance. |
Clear | public | Clears the text and internal line ranges for the component. |
SetText | public | Sets the value for the Text property from a PChar type. |
Insert | public | Inserts the line of text in S at the specified position. |
Delete | public | Deletes the line of text at the specified position. |
Exchange | public | Swaps the line values at the specified positions. |
Move | public | Moves a String value from the current position to the new position. |
MakeTextBufferUnique | public | Ensures that the reference count for the Text member is 1. |
BeginUpdate | public | Starts an update process for the component. |
EndUpdate | public | Finishes an update process for the component. |
GetText | public | Gets the value for the Text property as a PChar type. |
IndexOf | public | Gets the ordinal position for the specified String value. |
Add | public | Appends the specified text to the values in Strings. |
AddObject | public | Adds a String and Object pair to the string list. |
AddStrings | public | Adds the lines of text in TheStrings to the current class instance. |
LoadFromFile | public | Loads the content in the string list from the specified file name. |
SaveToFile | public | Saves the content in the string list to the specified file name. |
Events
OnChange | public | Event handler signalled when values in Strings or Objects have been changed. |
OnChanging | public | Event handler signalled before properties are updated in the component. |
Fields
FArraysValid | protected | Boolean flag which indicates whether the array of line ranges is valid. |
FLineCount | protected | Number of lines in the array of line ranges. |
FLineCapacity | protected | Number of line ranges allocated for the component. |
FLineRanges | protected | Pointer to an array of TTextLineRange instances used for the Strings in the component. |
FText | protected | Member variable used to store the Text in the component. |
FUpdateCount | protected | Number of times BeginUpdate has been called without a corresponding EndUpdate. |
FChangedWhileUpdate | protected | Indicates if Changed was called after calling BeginUpdate. |
Inherited
From TCustomMemoStrings (3)
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
