TPlusMemo component
PlusMemo Help Send comments on this topic.
TPlusMemo component

Glossary Item Box

 Properties  Methods     Events


Unit

PlusMemo

 

Declaration (partial)

type

    TPlusMemo = class(TWinControl);

 

Description

TPlusMemo is a native VCL text editor control for Delphi and CBuilder. It has most of the features of the standard TMemo component (see differences for details), plus the following main characteristics:

 

  • Can handle very large amount of text and big text files with excellent performance.  In wordwrap mode, paragraphs and lines have separate definitions that can be manipulated distinctively by the programmer (see Lines, Paragraphs topic).
  • Dynamic syntax highlighting: you can have the TPlusMemo dynamically format your keywords and sections (i.e. comments), easily enabling code editor applications, among other things  (see further below).  Each keyword and highlighted section can have their individual highlighting (color and font style), under the control of the programmer.   
  • Possibility of justified text; the text is left and right justified at the same time.
  • You can define sections of the text content as clickable hot spot: an OnContext event is triggered whenever the user clicks in such section.  Keywords and automatically formatted sections can be set as clickable hot spots if the programmer wants.
  • Static font formatting: you can use any mix of Bold, Italic and Underline attributes for parts of the text, plus two different fonts and two colors (see further below).
  • Individual paragraph background color and wrapable attribute under the control of your application.
  • Possibility to implement collapsible blocks, whereby parts of the text content can be collapsed and expanded.
  • Possibility of a background picture instead of a plain background. Said background picture can be fixed or scrolling with text content (see BackgroundBmp).
  • Multi level Undo-Redo.
  • Optional smooth scrolling.
  • Columnar block selection with Alt-Mouse or Alt-Shift-Arrow key text selection (see property Options).
  • Fast line selection by clicking in left margin (see property Options).
  • Drag and drop editing.
  • Optional auto indent and back indent (see property Options).
  • Optional end of text line displayed (see property EndOfTextMark).
  • Optional automatic hiding of scroll bars (see property Options).
  • Optional fine vertical scrolling (see property Options).
  • Control of selected text color (see SelBackColor, SelTextColor).
  • Ability to display a right gutter line (see RightLinePos, RightLinePen).
  • Possibility to wrap text at a given column number instead of at the right edge of the control (ColumnWrap).
  • You can specify which characters are used to do word wrapping (WordWrapChars).
  • Individual paragraphs can be set so that they don't wrap (ParagraphsWrapable).
  • Can display non printing characters like spaces, tabs and carriage returns (ShowNonPrintChars).
  • Programmer controlled left and right margins.
  • Various properties and methods to interact at run time with the control, for example to set/retrieve the editing position, the display horizontal and vertical offset, and so on.

 

 

Selective text formatting is supported in two ways:

  1. Through control codes embedded in the text.  At run time, pressing Ctrl-B toggles Bold, Ctrl-I toggles Italic, Ctrl-U toggles Underline, Ctrl-H toggles color highlighting and Ctrl-F toggles alternate font.  Appropriate methods exist to embed at run time those codes in the text.  This way of achieving selective text formatting is what is called hereafter static text styling.  It can be turned off with property StaticFormat .
  2. Through dynamic style specification: you specify attributes for part of the text from your application but the formatting information is not in the text itself.  It is not retained when saved to a file or copied to the clipboard.  This may be achieved in four ways: 

2a. With the automatic keywords management: you put keywords in a list, specify options such as MatchCase, WholeWordsOnly, font attributes, colors, et voila, the keywords turn to your liking as text is entered in the component.  See Keywords property for more information;

 

2b. With automatic section management, you decide which character or string represents a section start and stop, font attributes, colors and the TPlusMemo takes care of managing the formatting of the section for you.  See StartStopKeys property for more information;

 

2c. With highlighter components: these are special components used to apply language specific syntax highlighting developed by Electro-Concept Mauricie.  Highlighters currently exist for Html, OOP language, for highlighting urls and so on.  See property Highlighter;

 

2d. With method SetDynStyle, used normally within an OnParse event handler, you specify the text range, the desired font style, colors, mouse cursor, hot spot context number.

 

 

In addition to these key properties, methods and events, TPlusMemo exposes at design time the following properties and events from TWinControl and TControl;

Align, Anchors, Constraints;

Color, ParentColor;

DragCursor, DragKind, DragMode;

Font, ParentFont;

PopupMenu

Enabled, Visible, ShowHint, ParentShowHint;

ImeMode, ImeName;

Ctl3D, ParentCtl3D;

TabStop, TabOrder;

OnClick, OnDblClick, OnMouseMove, OnMouseDown, OnMouseUp, OnMouseEnter, OnMouseLeave;

OnEnter, OnExit, Touch;

OnKeyDown, OnKeyPress, OnKeyUp;

OnDragOver, OnDragDrop, OnEndDrag, OnStartDrag;

BiDiMode, ParentBiDiMode;

OnEndDock, OnStartDock;

OnContextPopup