Unit
Declaration
type TPlusMemoOption = (pmoKeepColumnPos, pmoPutExtraSpaces,
pmoWrapCaret, pmoInsertKeyActive,
pmoWideOverwriteCaret, pmoLargeWordSelect,
pmoAutoScrollBars, pmoNoDragnDrop,
pmoAutoIndent, pmoBackIndent,
pmoWindowsSelColors, pmoFullLineSelect,
pmoDiscardTrailingSpaces, pmoNoFineScroll,
pmoNoLineSelection, , pmoNoDefaultPopup,
pmoBlockSelection, pmoAutoLineBreak,
pmoPlainClipboard, pmoPersistentBlocks,
pmoNoOverwriteBlocks, pmoSmartTabs,
pmoKeepParBackgnd);
TPlusMemoOptions = set of TPlusMemoOption;
Description
TPlusMemoOptions is type of property Options of a TPlusMemo or TDBPlusMemo. This property affects various aspects of user navigation in the control and display rendering. This is a set that can contain the following values:
| pmoKeepColumnPos | if present, the caret will not move horizontally when navigating up and down. Its default value is False, which implies that the caret cannot be farther to the right than the end of a line. |
| pmoPutExtraSpaces | if present, extra spaces will be added as padding between the end of the current line and the current caret position when some text is typed. It is effective only if pmoKeepColumnPos is set. Its default value is True. If set to False, no extra spaces are added to the text when the user types and the caret is farther to the right than the current end of line. |
| pmoWrapCaret | if present, attempting to advance to the right with the arrow key will make the caret wrap to the next line when the end of line is reached. If absent and pmoKeepColumnPos is present, the caret will just keep moving to the right. Its default value is True. |
| pmoInsertKeyActive | if present, the end user can toggle the overwrite mode with the Insert key. The default value is True. If False, the Insert key has no effect when a TPlusMemo has focus. |
| pmoWideOverwriteCaret | if present, the blinking caret will be exactly the width of the letter to be overridden when in overwrite mode. If absent, the caret is always the same width, given by property CaretWidth, whether in overwrite or insert mode. The default value is True. |
| pmoLargeWordSelect | if present, selecting a word by double clicking will include the delimiters to the right of it. The default value is True. |
| pmoAutoScrollBars | if present, scroll bars will hide themselves when they are not necessary, even if property ScrollBars is set to ssVertical, ssHorizontal or ssBoth. The default value is True. |
| pmoNoDragnDrop | if present, the TPlusMemo will not enable drag and drop editing with the mouse. If absent (the default), drag and drop editing is enabled. |
| pmoAutoIndent | if present, pressing Enter will make the new line start at the same indentation level as the previous one. If not present (the default), Enter behaves normally and the new line starts at the left. |
| pmoBackIndent | if present, pressing BackSpace while no text is selected and the caret is at the left of the first non blank character of the line will make it take the same indentation level as the previous line. If not present (the default), BackSpace key behaves normally, i.e. removing the preceding character. |
| pmoWindowsSelColors | this member is used to control how the TPlusMemo draws the selected text. When False (the default), selected text is displayed by bit color inversion. If True, selected text is displayed using the SelBackColor and SelTextColor properties. |
| pmoFullLineSelect | this member is used to control how the TPlusMemo draws selected lines when they are completely part of the selection. When False (the default), selected lines are highlighted up to their right end. If True, they are highlighted up to the right edge of the control's window. |
| pmoDiscardTrailingSpaces | this option is used to control whether trailing spaces and tabs at the end of a paragraph are saved in output files or streams. It also affects reading from a stream, whereby trailing spaces and tabs are also discarded and not inserted in the control's text. If not present in property Options (the default), trailing spaces and tabs are considered as regular text. |
| pmoNoFineScroll | this member is used to control the vertical scrolling. When False (the default), vertical scrolling can be effected with pixel resolution. When True, vertical scrolling is done with a resolution of one line height, then behaving like the regular TMemo. |
| pmoNoLineSelection | this option controls the "fast line selection" feature, whereby complete lines are selected by clicking in the left margin area. When False (the default), a line is selected by clicking just to its left. When True, clicking in the left margin simply brings the editing caret at the start of the corresponding line. |
| pmoNoDefaultPopup | if present, the TPlusMemo will not open its default popup menu when the user right clicks with the mouse. If absent (the default), the default popu menu is active. This default popup menu contains Undo/Redo items and the regular Cut/Copy/Paste commands. Note that if you assign to property PopupMenu, this menu will open with a right click even if pmoNoDefaultPopup is False. This assigned menu will take the place of the internal popup menu if pmoNoDefaultPopup is True. |
| pmoBlockSelection | this option controls the "column block selection" feature. When True, columns of text can be selected with the mouse by dragging with pressing the Alt key, or with arrow keys by using the Alt-Shift key combination. When False (the default), the column block selection feature is turned off. Property WordWrap must be False for column block selection to work, even when pmoBlockSelection is True. Also, it makes sense to enable it only for fixed pitch fonts. With a variable pitch font, the display will not be rendered accurately when a column block selection is made. |
| pmoAutoLineBreak | this option controls the automatic setting of property LineBreak when reading the content of a TPlusMemo through a stream or file. If True, property LineBreak is set according to the last kind of paragraph mark encountered in the stream, so that doing SaveToStream after that will preserve the original kind of line breaks in the stream. When False (the default), property LineBreak is not modified when reading from a stream. |
| pmoPlainClipboard | If this member is present in property Options, static control codes are stripped before copying the selection to the clipboard via method CopyToClipboard, or when the user selects "Copy" from the default popup menu. If False (the default), static control codes are preserved through clipboard operations. |
| pmoPersistentBlocks | This option controls the persistent block feature in TPlusMemo. If present, the selected part stays highlighted when moving the caret with arrow keys. When coupled with pmoNoOverwriteBlocks (see below), this option corresponds to Delphi editor setting "Persistent blocks". The default value is False, meaning that selection is reset whenever the current editing position is moved. |
| pmoNoOverwriteBlocks | When this option is set, user text editing operations do not overwrite the currently selected text. The default value is False, meaning that selected text is overwritten by whatever is typed or pasted by the user. |
| pmoSmartTabs | This option gives access to the smart tab feature of TPlusMemo. When turned on, entering a tab character will make the caret move to the next indentation level from the previous line. Spaces are added to the line to achieve that effect, unless pmoDiscardTrailingSpaces is also set and the caret was already at the end of the line. In such case, the caret is moved at the appropriate horizontal level but no spaces are added to the line. |
| pmoKeepParBackgnd | This option controls whether dynamic highlighting background color overrides the paragraph background color or not. If set, the paragraph background color is that given by property ParagraphsBackground, even for dynamically highlighted parts that specify a background color. If no color is specified for a given paragraph through property ParagraphsBackground (or set at clNone, which is the default), then dynamic highlighting background will apply for highlighted sections defining a background color. If not set, dynamically highlighted sections will have their background applied (if different from clNone) even when in paragraphs whose property ParagraphsBackground is different from clNone. See properties Keywords, StartStopKeys and Highlighter for dynamic highlighting topics. |
| pmoFixedBackground | This member controls whether the background picture scrolls with the memo content or stay fixed. It has no effect if a background picture is not set in the control. See property BackgroundBmp for further details. Its default value is False (not set). |
Typical settings for a general purpose text editor:
You may start from the following set for property Options in the case of a general purpose text editor:
Options:= [pmoInsertKeyActive, pmoWideOverwriteCaret, pmoLargeWordSelect,
pmoAutoScrollBars];
Other members may be included to achieve the desired behavior.
Typical settings for a code editor:
The following set represents a typical value for Options in the case of a code editor:
Options:= [pmoKeepColumnPos, pmoPutExtraSpaces, pmoWrapCaret,
pmoInsertKeyActive, pmoWideOverwriteCaret, pmoAutoScrollBars,
pmoAutoIndent, pmoBackIndent, pmoDiscardTrailingSpaces,
pmoBlockSelection, pmoSmartTabs];
Other members may be included or suggested ones may be excluded to achieve the desired behavior.