BCGControlBar Pro for MFC
CBCGPEditCtrl

Detailed Description

The CBCGPEditCtrl class implements the functionality of advanced edit control with the following special features:

  • IntelliSense support
  • Syntax highlighting support
  • Markers support
  • Adjustable left-side area suitable for displaying visual markers and other information
  • Extended (customizable) undo/redo support
  • Block selection support
  • Tooltip support
  • Drag & drop support
  • Line numbering
  • Outlining (collapsible nodes) support

To use the CBCGPEditCtrl class in your application you can take advantage of CBCGPEditView or just embed an object of this (or derived) class in a view (or any other parent) and call CBCGPEditCtrl::Create with WS_CHILD | WS_VISIBLE styles. After that you may want to set the edit control up by loading XML settings, enabling IntelliSense support and so on.

The following is the list of classes and structures used in conjunction with the edit control:

Outlining:

+ Inheritance diagram for CBCGPEditCtrl:

Public Member Functions

 AddOutliningCreates a new collapsible node.
 
 AddUndoActionAdds undo action to the undo buffer.
 
 AddUndoActionAdds undo action to the undo buffer.
 
 AddUndoActionAdds undo action to the undo buffer.
 
 AddUndoActionAdds undo action to the undo buffer.
 
 BookmarkLineToggles bookmark in the specified line.
 
 CanRedoTells whether redo operation is available.
 
 CanRemoveMarkerCalled by the framework when it's about to remove a marker.
 
 CanUndoTells whether an undo operation is available or not.
 
 CanUpdateMarkerCalled by the framework when the marker line is about to be updated.
 
 CleanUpMarkersRemoves all markers from the edit control.
 
 ClearClears (deletes) the selected text without copying it to the Clipboard.
 
 ClientToVirtConverts a point in client coordinates to document coordinates.
 
 ClientToVirtConverts a point in client coordinates to document coordinates.
 
 CollapseToDefinitionsCollapses the members of all outlining types.
 
 CommentSelectedTextCall this method to comment/uncomment selected text.
 
 CopyCopies either selected text or the whole text to the Clipboard in CF_TEXT format.
 
 CreateCreates a Windows child window and attaches it to the CBCGPEditCtrl object.
 
 CreateOutlineParserCreates outline parser.
 
 CutDeletes (cuts) the current selection (if any) in the edit control and copies the deleted text to the Clipboard in CF_TEXT format.
 
 DeleteAllMarkersRemoves all markers.
 
 DeleteMarkerDeletes a marker of specified type at the particular row.
 
 DeleteMarkerDeletes a marker of specified type at the particular row.
 
 DeleteSelectedTextDeletes the selected text from the edit control.
 
 DeleteTextDeletes a block of text from the edit control.
 
 DownMoves the caret to the next line. Scrolls the window if necessary.
 
 EmptyUndoListRemoves all undo operations from the undo buffer.
 
 EnableAutoHideScrollBarsScpecifies whether control's scroll bars should be hidden when scroll bars are inactive (mouse cursor is located outside of scrollbar).
 
 EnableAutoOutliningEnables or disables auto-outlining.
 
 EnableCommentingSelectedTextEnables or disables the commenting of selected text.
 
 EnableErrorIndicationEnables or disables edit control error indication. By default, the error indication is disabled.
 
 EnableGradientMarkersEnable or disable gradient markers.
 
 EnableIntelliSenseEnables or disables IntelliSense support.
 
 EnableOutlineParserEnables/disables the outlining parser.
 
 EnableOutliningEnables or disables outlining.
 
 EnableSyntaxHilightingOnColorLineEnables or disables the syntax hilighting on the colored line.
 
 EnableSyntaxHilightingOnHiliteMarkersEnables or disables the syntax hilighting on the hilite markers.
 
 EnableSyntaxHilightingOnSelectionEnables or disables the syntax hilighting on the selection area.
 
 EnableToolTipsEnables tooltips.
 
 EnableUndoCharModeEnables or disables undo "char mode".
 
 EnableVisualManagerMarkersEnable or disable visual theme-style markers.
 
 EnableZoomEnables/disables editor zooming by the mouse wheel (when Ctrl is pressed) or gesture zoom.
 
 EndSets the caret at the end of the current line.
 
 EndOfTextSets the caret at the end of text.
 
 ExportToHTMLSaves the content of edit control to a memory buffer adding HTML tags for color blocks.
 
 ExportToRTFExports text from edit control to a buffer in RTF format.
 
 FillIntelliSenseListCalled by the edit control when it needs to fill a list with IntelliSense data.
 
 FindMarkerByDataSearches the list of markers by user-defined data.
 
 FindTextFinds and selects a text in the edit control.
 
 FindWordStartFinishGiven an offset finds the offsets of the beginning and end of a word.
 
 GetCaretSizeReturns the size, in pixels, of the caret.
 
 GetCharAtReturns a character from the internal text buffer at the given position.
 
 GetCommentCharsReturns comment characters specified by EnableCommentingSelectedText() method.
 
 GetCurColumnReturns the current column.
 
 GetCurLineReturns text string at the current line.
 
 GetCurOffsetReturns the current caret offset from the beginning of the text.
 
 GetCurRowReturns the current caret row.
 
 GetFirstVisibleLineDetermines the topmost visible line.
 
 GetIncorrectWordToolTipCalled by the framework to obtain tooltip which appears near an incorrect word.
 
 GetIntelliSenseImgListReturns a pointer to the image list associated with the IntelliSense list box.
 
 GetIntelliSenseLBFontReturns the font that is currently used to display the IntelliSense data.
 
 GetLastUndoReasonRetrieves the last undo reason.
 
 GetLineGiven a line number retrieves a line from the internal buffer.
 
 GetLineGiven a line number retrieves a line from the internal buffer.
 
 GetLineCountReturns the number of lines in the edit control.
 
 GetLineHeightReturns the height of a single line in the text.
 
 GetLineNumbersMarginWidthReturns the width of the line numbers margin.
 
 GetMarkerObtains a marker of some type at the specified row.
 
 GetMarkerObtains a marker of some type at the specified position.
 
 GetMarkerListReturns the list of all markers.
 
 GetMarkerListByDataQueries the list of markers by the user-defined data.
 
 GetMarkerListByTypeReturns a list of all markers of the specified type (s).
 
 GetMarkersInRangeReturns the list of markers whose lines are in the specified range.
 
 GetOutlineMarginWidthReturns the width of the outline margin.
 
 GetOverrideModeTells whether the edit control in the override mode or not.
 
 GetRedoActionsReturns the list of available redo actions.
 
 GetScaleReturns control font scale.
 
 GetSelReturns the current selection range.
 
 GetSelTextRetrieves the text from the current selection
 
 GetSymbolExtraLenReturns additional spacing for a special symbol.
 
 GetSymImgListReturns a pointer to image list used to display special symbols.
 
 GetTabSizeReturns the tabulation size.
 
 GetTextReturns the reference to the internal text buffer.
 
 GetTextLeftMarginReturns a distance between text and left-side bar.
 
 GetUndoActionsReturns the list of available undo actions.
 
 GetWordCorrectionsCalled by the framewrok to obtain a list of suggestions and list of custom action associated with incorrect word.
 
 GetWordFromOffsetGiven an offset from the beginning of the text returns a word at this offset.
 
 GetWordFromPointGiven a point in client coordinates returns a word at this point.
 
 GoToFirstMarkerMoves the caret to the first marker.
 
 GoToLineScrolls edit control to specified line.
 
 GoToMarkerMoves the caret to the specified marker.
 
 GoToNextMarkerMoves the caret to the next marker in the specified (up or down) direction.
 
 HasMarkersTells whether the edit control contains the markers of the specified type (s).
 
 HasSelectionTells whether the edit control has selected text.
 
 HideSelectionTurns selected text into collapsible node.
 
 HitTestGiven a point in the client coordinates returns the offset of a symbol containing this point from the beginning of the text.
 
 HomeMoves caret to the beginning of the current line.
 
 IndentSelectionIndents the selected text forward or backward.
 
 IndentTextIndents a block of text forward or backward inserting or deleting spaces.
 
 InsertCharInserts a character into edit control.
 
 InsertMarkerInserts a new marker into the list of markers.
 
 InsertNewLineInserts a new line into the edit control.
 
 InsertTabInserts the tabulation into the edit control.
 
 InsertTextInserts text into the edit control at specified position.
 
 InvokeIntelliSenseInvokes the IntelliSense list box.
 
 InvokeIntelliSenseInvokes the IntelliSense list box.
 
 InvokeSymListInvokes the IntelliSense-like listbox with the list of symbols (images).
 
 IsAutoOutliningEnabledTells whether the auto-outlining is enabled or not.
 
 IsCopyEnabledTells whether text copy is enabled (TRUE) or disabled (possible).
 
 IsCorrectWordCalled by the framework when it needs to obtain a word "corectness" status.
 
 IsCutEnabledTells whether the text cut is enabled or not.
 
 IsDPIAwareTells whether the edit control is DPI aware.
 
 IsErrorIndicationEnabledTells whether an error indication is enabled.
 
 IsGradientMarkersEnabledTells whether gradient markers enabled or not.
 
 IsInBlockDetermines whether the specifies offset is located between two characters.
 
 IsIndentEnabledTells whether text indentation is possible.
 
 IsIntelliSenseEnabledTells whether IntelliSense support is enabled or disabled.
 
 IsLineNumbersMarginVisibleDetermine whether the line margin is visible or not
 
 IsModifiedTells whether text in the edit control is modified or not.
 
 IsOutlineMarginVisibleTells whether the outline margin is visible or not.
 
 IsOutliningEnabledTells whether the outlining is enabled or not.
 
 IsPasteEnabledTells whether paste from the Clipboard is allowed (enabled).
 
 IsProcessClipboardAcceleratorsTells whether the edit control automatically processes the standard keyboard accelelators.
 
 IsReadOnlyTells whether the edit control is read-only or not.
 
 IsScrollBarAutoHideEnabledTells whether control's scroll bars are auto-hidden.
 
 IsSyntaxHilightingOnColorLineTells whether the syntax hilighting on the colored line is enabled.
 
 IsSyntaxHilightingOnHiliteMarkersTells whether the syntax hilighting on the hilite markers is enabled.
 
 IsSyntaxHilightingOnSelectionTells whether the syntax hilighting on the selection area is enabled.
 
 IsViewWhiteSpaceTells whether the edit contol draws special symbold on the white space or not.
 
 IsVisualManagerMarkersEnabledTells whether visual theme-style markers enabled or not.
 
 IsZoomEnabledTells whether editor zooming is enabled.
 
 LeftAdvances the caret to one position in the left direction.
 
 LineFromCharRetrieves the number of the line that contains the specified character index.
 
 LineIndexRetrieves the character index of the line.
 
 LineLengthRetrieves the length of a line in an edit control
 
 LineScrollScrolls the text of an edit control.
 
 LoadOutlineParserXMLSettingsLoads XML settings for outline parser.
 
 LoadXMLSettingsLoads XML settings from a disk file.
 
 LoadXMLSettingsFromBufferLoads XML settings from a memory buffer.
 
 LoadXMLSettingsFromResourceLoads XML settings from application resource.
 
 LoadXMLSettingsFromResourceLoads XML settings from application resource.
 
 LookUpSymbolCalled by the framework when the symbol support is enabled every time it needs to check if a character should be replaced by a symbol (image).
 
 MakeSelectionSelects a block of text according to selection type.
 
 MarkAllMark all lines which contain a specified text.
 
 NextWordMoves the caret to the next word. Scrolls the text if necessary.
 
 OffsetToPointGiven an offset from the beginning of text buffer returns a point in the client coordinates.
 
 OnAfterTextChangedCalled by the edit control when the text has been changed.
 
 OnAfterUndoRedoCalled by the framework after undo or redo action has been executed.
 
 OnBeforeAddUndoActionCalled by the framework before an undo action is added to the undo buffer.
 
 OnBeforeInvokeIntelliSenseCalled by the framework before the IntelliSense is invoked.
 
 OnBeforeTextDeletedCalled by the edit control when a piece of text is about to be deleted from the edit control.
 
 OnBeforeTextInsertedCalled by the edit control when a fragment of text is about to be inserted in the edit control.
 
 OnCalcOutlineSymbolCalled to recalculate the outline symbol.
 
 OnDeleteDeletes a symbol at the current position or selected text.
 
 OnDeleteTextFromBufferCalled by the framework when text is deleted from the edit control.
 
 OnDrawErrorIndicationCalled when the edit control needs to draw an error indication.
 
 OnDrawMarkerCalled by the framework when it needs to draw a marker.
 
 OnDrawOutlineBarCalled by the framework when it needs to draw the outline side bar.
 
 OnDrawOutlineButtonCalled when the edit control needs to draw an outline button.
 
 OnDrawOutlineSymbolCalled when the edit control needs to draw the replace symbol instead of the hidden text
 
 OnDrawSideBarCalled by the framework when it needs to draw the side bar from the left.
 
 OnDrawSymbolCalled by the framework when it needs to display a symbol.
 
 OnDrawTextCalled by the framework to draw the edit control's text.
 
 OnFailedOperationCalled when an operation has failed.
 
 OnFillBackgroundCalled by the framework to fill the edit control's background.
 
 OnFillIntelliSenseListCalled by the framework when it needs to fill the IntelliSense list with data.
 
 OnFillSymListDataCalled by the framework when it needs to fill the IntelliSense-like symbol list with data.
 
 OnGetCharColorCalled by the framework when it draws the text and it needs to retrieve the color for the current character to be drawn.
 
 OnGetTipTextCalled by the framework when it needs to obtain the tooltip text.
 
 OnGetWordColorCalled by the edit control when it draws the text and needs to retrieve the current word color.
 
 OnGoToNextMarkerCalled by the framework when next or previous marker should be focused.
 
 OnInsertOutlineBlockCalled by the framework when a collapsible node is inserted
 
 OnInsertTextToBufferCalled when a piece of text is being inserted into the edit control.
 
 OnOutlineButtonClickCalled by the framework when a user clicks left mouse button at the outline margin.
 
 OnOutlineChangesCalled when the outlining information in the edit control has changed
 
 OnRedoPerforms redo operation.
 
 OnRemoveMarkerCalled by the framework when a marker is about to be removed.
 
 OnRemoveOutlineBlockCalled by the framework when a collapsible node is removed.
 
 OnRemoveUndoActionCalled by the framework when undo action data is being removed.
 
 OnScaleChangedCalled by the framework when control font has been scaled.
 
 OnSetCaretCalled by the framework when position of caret has changed.
 
 OnSetOvrModeCalled by the framework when when the override mode is switched on or off.
 
 OnUndoPerforms the next undo action.
 
 OnUpdateAutoOutliningCalled when the text in edit control has changed.
 
 OnUpdateMarkerLineCalled by the edit control when a marker's line is about to be updated.
 
 OnWordCorrectionMenuCustomActionOverride this method to execute a custom action associated with incorrect word.
 
 OpenFileOpens a file, reads text from it and sets this text to the edit control.
 
 OpenFileOpens a file, reads text from it and sets this text to the edit control.
 
 PageDownScrolls one page down.
 
 PageUpScrolls one page up.
 
 PastePastes the text from the Clipboard to the edit control at the specified position.
 
 PrevIndentMoves the caret to the previous indent position.
 
 PrevWordMoves the caret to the previous word.
 
 ProcessTextBeforeInsertCalled by the framework just before the text is inserted into the edit control.
 
 RedrawMarkerAreaRedraws the marker area for a single marker.
 
 RedrawTextRedraws text between specified rows.
 
 RedrawTextOffsetsRedraws text in the specifies range defined by offsets.
 
 RemoveAllBlocksRemoves all color blocks.
 
 RemoveAllWordsFromColorTableRemoves all words from the color table.
 
 RemoveBlockColorRemoves a color block definition from the list of color block definitions.
 
 RemoveSelectionRemoves selection from the edit control.
 
 RemoveWordFromColorTableRemoves a word from the color table.
 
 RemoveXMLSettingsRemoves all syntax highlighting settings that have been applied to the edit control.
 
 ReplaceAllReplaces all matching substrings in the edit control.
 
 ReplaceSelReplaces the current selection with the specified text.
 
 ReplaceTextFinds, replaces and selects text in the edit control.
 
 RightAdvances the caret to one position in the right direction.
 
 SaveFileSaves the edit control's text to a file.
 
 SaveFileSaves the edit control's text to a file.
 
 ScrollDownScrolls the edit control one line down or one step right.
 
 ScrollEndScrolls the edit control to the end of text or to the most right position of the horizontal scroll bar.
 
 ScrollHomeScrolls the edit control to the beginning of the text.
 
 ScrollPageDownScrolls one page down vertically or horizontally.
 
 ScrollPageUpScrolls one page up vertically or horizontally.
 
 ScrollTextScrolls text one line up or down.
 
 ScrollToCaretScroll to the currently focused editor location.
 
 ScrollUpScrolls the edit control up vertically or horizontally.
 
 SelectLineSelects a line.
 
 SelectLineRangeSelects several lines.
 
 SetBlockColorAdds a new color block definition to the list of color block definitions.
 
 SetCaretSets the caret at the specified offset.
 
 SetColorBlockStrLenMaxSets the new length of color block.
 
 SetDPIAwareSpecifies whether the edit control is DPI aware.
 
 SetIntelliSenseImgListAssociates a new image list with the IntelliSense data.
 
 SetIntelliSenseLBFontSets the font to be used in the IntelliSense list box to display the data.
 
 SetLastUndoReasonSets the last undo reason
 
 SetLineColorMarkerSets a new line color marker.
 
 SetLineNumbersMarginShows or hides line numbers.
 
 SetMarkerSets a marker at the specified row.
 
 SetMarkerDataAssociates the user-defined data with a marker.
 
 SetMarkerDataAssociates the user-defined data with a marker.
 
 SetModifiedSets or clears the "modified" flag for the editor's document.
 
 SetOutlineMarginSets outline margin of the editor.
 
 SetOverrideModeEnables or disables override mode.
 
 SetPrinterFontSets the font to be used for printing.
 
 SetProcessClipboardAcceleratorsSpecifies whether the edit control automatically processes the standard keyboard accelelators.
 
 SetReadOnlySets read-only flag and makes the edit control read-only.
 
 SetScaleSpecifies control font scale.
 
 SetScalingRangeSpecifies control font scaling range.
 
 SetSelSets the current selection.
 
 SetSel2Sets the current selection.
 
 SetSymImgListAssociates a new image list with symbol definitions.
 
 SetTabSizeSets tabulation size.
 
 SetTextLeftMarginSpecifies a distance between text and left-side bar. By default, this value is 1.
 
 SetViewWhiteSpaceSpecifies whether the edit contol draws special symbold on the white space.
 
 SetWordColorAssigns the specified foreground and background colors to a word.
 
 StartOfTextMoves the caret to the beginning of text.
 
 StopHidingCurrentDeletes a collapsible node(s) selected by user.
 
 StopOutliningCancels outlining mode.
 
 ToggleAllOutliningToggles outline mode for the whole text.
 
 ToggleMarkerToggles a marker at the specified row.
 
 ToggleOutliningToggles outlining inside selection.
 
 ToolTipPopRemoves tooltip.
 
 UpMoves the caret to the previous line. Scrolls the window if necessary.
 
 UpdateAutoOutliningUpdates the outlining information for the specified range.
 
 UpdateScrollBarsUpdates scroll bar's range and position.
 
 VirtToClientConverts a point in document coordinates to client coordinates.
 
 VirtToClientConverts a point in document coordinates to client coordinates.
 

Public Attributes

 m_bColorHyperlinkEnables or disables support for hyperlink.
 
 m_bDefaultIndentSpecifies indentation option for the edit control.
 
 m_bEnableCurrentLineCopyEnables or disables the ability to copy the current line text to the Clipboard when the current line is not selected.
 
 m_bEnableSymSupportIf TRUE, symbol support is enabled. If FALSE, symbol support is disabled.
 
 m_bEnableWholeTextCopyEnables or disables the ability to copy the whole text buffer into the Clipboard.
 
 m_bReplaceTabsAndEOLOnCopySpecifies whether to replace tab symbols and end of line symbols when the text is copied to the Clipboard.
 
 m_clrBackSpecifies the background color of text in the edit control.
 
 m_clrBackLineNumberBackground color for the line numbers area of the editor.
 
 m_clrBackOutlineSpecifies background color of the outline area.
 
 m_clrBackSelActiveSpecifies the background color of selected text in the edit control when the edit control has the input focus.
 
 m_clrBackSelInActiveSpecifies the background color of selected text in the edit control when the edit control is not active.
 
 m_clrBackSidebarBackground color of the sidebar of the editor.
 
 m_clrHyperlinkSpecifies the color for hyper links. If it is -1, then the default color is used.
 
 m_clrLineOutlineSpecifies the color used to paint lines in the outline area.
 
 m_clrTextSpecifies the foreground color of text in the edit control.
 
 m_clrTextLineNumberThis color is used to display line numbers in the line numbers area of the editor.
 
 m_clrTextSelActiveSpecifies the foreground color of selected text in the edit control when the edit control has the input focus.
 
 m_clrTextSelInActiveSpecifies the foreground color of selected text in the edit control when the edit control is not active (doesn't have the input focus).
 
 m_lstSymDefsList of symbol definitions
 
 m_lstURLPrefixesThe list of URL prefixes required for hyperlink support.
 
 m_nIndentSizeSpecifies the indentation size.
 
 m_nLeftMarginWidthSpecifies the width of left margin.
 
 m_nLineVertSpacingSpecifies the additional spacing between text lines.
 
 m_nOutlineMarginWidthSpecifies the width of outline margin at the left.
 
 m_nTabSizeDefines the tab size.
 
 m_strContinueStringSymbolsDefines a list of symbols that are used in the edit control to mark and exclude closing blocks from the string color blocks.
 
 m_strIndentCharsDefines what characters to insert when the text is indented.
 
 m_strIntelliSenseCharsDefines the list of symbols to be used for IntelliSense invocation.
 
 m_strNonSelectableCharsDefines a list of symbols (delimiters) that can't be selected by double click.
 
 m_strSpecialDelimitersDefines a list of special delimiters.
 
 m_strWordDelimetersSpecifies a set of characters used as word delimiters in the edit control.
 

Protected Member Functions

 CopyTextToClipboardCopies a text string to the Clipboard.
 
 DrawStringDraws a string in the edit control.
 
 ExportToRTFExports text from edit control to a buffer in RTF format.
 
- Protected Member Functions inherited from CBCGPGestureBase
 OnGestureEventBeginCalled by the framework to handle BCGP_GID_BEGIN notification.
 
 OnGestureEventEndCalled by the framework to handle BCGP_GID_END notification.
 
 OnGestureEventPressAndTapCalled by the framework to handle BCGP_GID_PRESSANDTAP notification.
 
 OnGestureEventRotateCalled by the framework to handle BCGP_GID_ROTATE notification.
 
 OnGestureEventTwoFingerTapCalled by the framework to handle BCGP_GID_TWOFINGERTAP notification.
 
 ProcessGestureEventThis method should be called from WM_GESTURE message handler.
 

Protected Attributes

 m_bKeepTabsSpecifies whether the edit control keeps the tab '\t' symbols or replaces them with spaces.
 
 m_bViewWhiteSpaceSpecifies whether the edit control draws special symbols on the empty ("white") space.
 
 m_iEndSelHolds the end selection offset.
 
 m_iStartSelHolds the start selection offset.
 
 m_lstUndoActionsThe internal buffer containing undo actions.
 
 m_nCurColumnHolds the current column.
 
 m_nCurrOffsetHolds the current offset.
 
 m_nLineHeightHolds the line height.
 
 m_nMaxCharWidthSpecifies the maximal character width.
 
 m_nMaxScrollWidthThe maximal scroll width.
 
 m_nUndoBufferSizeSpecifies the size of undo buffer.
 
 m_posUndoBufferPosition in the internal undo buffer.
 
 m_strBufferThe internal text buffer.