
Unit
pmCollapseHandler
Declaration (partial)
type
TCustomExtHighlighter = class(TComponent);
TpmCollapseHandler = class(TpmsCollapseHandler);
Description
TpmCollapseHandler is a non visual component to give visual cue and user interface for collapsible sections in a TPlusMemo. This is the type of its property CollapseHandler.
The visual cue takes the form of a colored vertical bar in the left margin, at the proper vertical level. The horizontal position of this bar reflects the level of collapsibility (up to 16). The start of a collapsible block is indicated by a + or - sign depending on the state of the block (collapsed or not). This sign is called the "collapse sign". When the user clicks on this sign with the mouse, the block is collapsed or expanded. Note that for levels that overlap the text area at the right of left margin, the collapse sign is not functional. Clicking there results in the caret going at that location, as is usual when no collapsible bar is shown.
Property BarPen.Width controls the width of the colored vertical bar and collapse sign. It also controls the amount horizontal indentation for blocks with collapsibility level greater than one. Since the collapse bar and sign are drawn in the left margin, it is recommended to set property TPlusMemo.LeftMargin equal to at least (BarPen.Width+1)*MaxLevels. Otherwise some overlapping of the collapse bar and sign may occur with the text content. Note however that since the collapse bar is drawn semi transparently, this effect might be tolerated for some applications. Users should be aware though that the collapse sign is not functional in this situation, as explained in the preceding paragraph.
Key properties
| BarPen | A TPen object to control the appearance of the vertical bar shown for uncollapsed blocks. |
| CollapseSignPen | A TPen object to control the appearance of the collapse sign ([+] or [-]) at the start of a collapsible block. |
| MaxLevels | Controls the maximum level of indentation for nested collapsible blocks. |
See also
Topic Collapsible blocks in PlusMemo
Property TPlusMemo.CollapseHandler