Click here to Skip to main content
Click here to Skip to main content

Brainchild, A syntax coloring edit control

, 16 Jun 2005 CPOL
Rate this:
Please Sign up or sign in to vote.
Syntax coloring, multi-level undo/redo editor control.

Notes

The search and replace dialogs in version 2.4 and higher of the brainchild control are non-modal. This will require you to call the newly introduced API IsNonModalDialogMessage() in the main message loop of your application. Old code using the control should be updated. Failure to do so will result in shortcut keys and tab/shift tab navigation not working.

The compiled binaries archive contains the compiled versions of brainchild.dll, bcc.cpl, BCDemo.exe and brainchild.ocx. Please note that the setup as explained below is still needed to make it all work.

Introduction

Brain child is an editor control which supports all the bells like syntax coloring, multi-level undo/redo etc. The editor control comes in three parts.

  1. Brainchild.dll which is the editor control. It is the core component which is written in C.
  2. BCC.cpl which is the configuration control panel applet. This is written in C++ and depends on my ClassLib library.
  3. Brainchild.ocx which is an ActiveX wrapper for the control. It is written in C++ using MFC. This OCX makes it possible to used the brainchild control in VB or .NET applications.

In addition, I have included a simple MDI editor demonstration program called BCDemo which is written in C++ and also depends on my ClassLib library.

Features

Brainchild supports most modern editor capabilities including:

  • Syntax-coloring, fully configurable. Syntax coloring is supported both on screen and on printer output.
  • Multi-level undo/redo. Maximum number of hops configurable.
  • Bookmarks.
  • Line numbers.
  • Fully configurable keyboard mappings.
  • OLE drag and drop support.
  • Automatic/smart indentation.
  • Automatic case fixing.

How to get started

I have not included an installer package. This means that you must follow several steps to get the editor up and running.

  1. Download the source code (DLL, CPL, OCX (optional), BCDemo) or the compiled binaries. If you decide to use the compiled binaries, you still need to download the DLL source code. It contains necessary setup files which you will need to get things running. If you use the compiled binaries only, you can go to step 7.
  2. Download, setup and compile the ClassLib C++ library.
  3. Compile the brainchild DLL.
  4. Compile the brainchild CPL.
  5. Compile and register the brainchild OCX (optional).
  6. Compile the BCDemo demonstration program.
  7. Create a directory on your hard disk where you can put the brainchild configuration files.
  8. Copy the directory Defaults, which you can find in the DLL source zip, including all its contents to the created directory.
  9. Open RegEdit.
  10. Add the key HKEY_LOCAL_MACHINE\Software\BCDLL\CurrentVersion. (Be careful using the registry editor!)
  11. In the key, add the string value Settings and set its value to the directory you created for the brainchild configuration files.

To get the demonstration program up and running, copy the branchild.dll, brainchild.ocx and bcc.cpl files to the directory containing the BCDemo executable and you should be able to run the demonstration program. Do not forget to register the OCX if you want to use it. You can use RegSvr32 to register the OCX. Once you get it up and running, you might also want to download the HTMLHelp docs. It will explain, how to use brainchild in your own programs and how to use the configuration tool.

What's New

Version 2.4

  • Enhanced the Find and Replace dialogs.
  • Much better printer support.
  • Added support for background colors.
  • Added bracket and line highlighting.
  • Added an ActiveX wrapper so that brainchild can be used in VB and .NET apps.
  • Added support for hyperlinks.
  • Fixed some bugs.

Version 2.3

  • Fixed a couple of nasty bugs.
  • Support for loading and saving Unicode files (limited support for loading and saving only).
  • Added case-fixing. When turned on, this will automagically fix keyword casing. Suggested by Zodiakon.

Version 2.2

This version includes a WTL wrapper and a small WTL demonstration program (VS6 workspace only) by Ernest Laurentin which you can download using the links above. For this release, only the Brainchild_dll.zip and Brainchild_help.zip were updated. The Brainchild_wtl.zip was added. The BCC.cpl and BCDemo source were not updated so version 2.1 users do not have to download these. Also note that the VS7 solution is a Visual Studio .NET 2002 solution. I presume you can load this into Visual Studio .NET 2003 without any problems.

  • The control now loads if the registry keys are not set. If they are, the directory configured must have the "Defaults" directory including contents copied into it.
  • Added the LoadParserFromFile() and LoadParserFromMemory() APIs including corresponding messages. These will allow you to add parser files at run time.
  • Fixed a nasty bug which could crash brainchild after receiving a WM_DESTROY. This has been fixed.

Version 2.1

  • Line numbers. The control now supports the possibility to show line numbers.
  • WM_PRINTCLIENT support.
  • WM_MOUSEWHEEL support.
  • Some bug fixes. Mostly small rendering bugs when run under Windows XP.

Version 2.0

  • Initial release on the CodeProject.

Thanks

The control has been re-written several times over the last years. To get it to where it is now, I have based some of the code on the work of Andrei Stcherbatchenko's CrystalEdit component. The code which was based on his work mostly covers the undo/redo and text buffer stuff.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Jan van den Baard
Software Developer (Senior)
Netherlands Netherlands
I have been programming for a hobby since 1985. I have started programming on the C= 64. After that I migrated to the C= Amiga which I traded in for a PC back in 1997 I believe. Back in 2000 I decided to lose a hobby and start developing software for a living.
 
Currently I am working mainly in developing software for building security and access control systems.

Comments and Discussions

 
QuestionHow to register the BrainChild settings folder under W8.1 64 ? PinmemberMember 1079059513-Aug-14 13:05 
AnswerRe: How to register the BrainChild settings folder under W8.1 64 ? PinprofessionalJan van den Baard14-Aug-14 7:59 
GeneralRe: How to register the BrainChild settings folder under W8.1 64 ? PinmemberMember 1079059514-Aug-14 11:51 
GeneralMy vote of 3 Pinmemberbuyong26-Sep-11 15:01 
GeneralBrainchild and Borland C++ Pinmemberselinek13-Mar-10 8:57 
QuestionUnicode Support?? Pinmembereqbalsajadi4-Aug-09 19:39 
AnswerRe: Unicode Support?? PinmemberJan van den Baard6-Aug-09 3:32 
GeneralMany thanks PinmemberDavidHarper21-Jun-09 11:28 
GeneralRe: Many thanks PinmemberJan van den Baard21-Jun-09 20:51 
QuestionHow to call the configuration setting in Visual Studio (C#) project? Pinmemberkarenphg7-Apr-09 0:08 
AnswerRe: How to call the configuration setting in Visual Studio (C#) project? PinmemberJan van den Baard7-Apr-09 1:39 
GeneralBackground Delimeter Color PinmemberTeeJayMule1016-Mar-09 17:07 
GeneralRe: Background Delimeter Color PinmemberJan van den Baard8-Mar-09 20:55 
GeneralCannot Register OCX File PinmemberTeeJayMule10120-Jan-09 2:12 
GeneralRe: Cannot Register OCX File PinmemberJan van den Baard21-Jan-09 3:54 
QuestionConfiguration Editor Title PinmemberTeeJayMule1017-Oct-08 11:31 
AnswerRe: Configuration Editor Title PinmemberJan van den Baard8-Oct-08 20:34 
GeneralRe: Configuration Editor Title PinmemberTeeJayMule1019-Oct-08 2:31 
GeneralText wrapping PinmemberShakeeb19-Mar-08 6:03 
Generallicense?? reditributing Pinmemberbrianhood7-Feb-08 15:21 
GeneralRe: license?? reditributing PinmemberJan van den Baard9-Feb-08 7:46 
QuestionNew version? Pinmember[Jongware]31-May-07 13:03 
AnswerRe: New version? PinmemberJan van den Baard1-Jun-07 3:34 
Generalcan't compile the demo on Visual Studio 2005 Pinmemberuniquekaiser7-Feb-07 8:41 
GeneralRe: can't compile the demo on Visual Studio 2005 Pinmemberbrianhood7-Feb-08 14:29 
QuestionRegistration Error PinmemberAnt Htoo Naing4-Dec-06 5:29 
GeneralBrainchild control panel multi-user BUG! [modified] Pinmemberjwh42419-Nov-06 5:13 
GeneralRe: Brainchild control panel multi-user BUG! FIXED! Pinmemberjwh42419-Nov-06 6:35 
GeneralSyntax Coloring not working Pinmemberjwh42415-Nov-06 17:56 
GeneralRe: Syntax Coloring not working PinmemberJan van den Baard16-Nov-06 5:27 
GeneralRe: Syntax Coloring not working Pinmemberjwh42417-Nov-06 5:00 
GeneralRe: Syntax Coloring not working FIXED! Pinmemberjwh42418-Nov-06 4:48 
GeneralRe: Syntax Coloring not working FIXED! Pinmemberbrianhood7-Feb-08 14:53 
Questioninput question ?? Pinmemberxiaoyu731117-Jul-06 23:41 
AnswerRe: input question ?? PinmemberJan van den Baard18-Jul-06 3:52 
Questionocx can't use in powerbuilder Pinmemberxiaoyu731116-Jul-06 17:37 
AnswerRe: ocx can't use in powerbuilder PinmemberJan van den Baard16-Jul-06 19:38 
GeneralRe: ocx can't use in powerbuilder Pinmemberxiaoyu731116-Jul-06 22:35 
GeneralRe: ocx can't use in powerbuilder Pinmemberxiaoyu731117-Jul-06 17:36 
QuestionRe: ocx can't use in powerbuilder Pinmemberpgb196024-Aug-06 4:42 
GeneralError in language file Pinmembervatic17-Jan-06 17:14 
GeneralRe: Error in language file PinmemberJan van den Baard17-Jan-06 19:42 
GeneralBeeps when typing single quote PinmemberShakti Goel13-Jan-06 7:50 
GeneralRe: Beeps when typing single quote PinmemberJan van den Baard15-Jan-06 20:19 
Generalh-file PinmemberAlex Romanenko14-Dec-05 6:13 
GeneralRe: h-file PinmemberJan van den Baard15-Dec-05 3:28 
GeneralWrap text in Oracle PinmemberShakti Goel12-Dec-05 10:59 
GeneralRe: Wrap text in Oracle PinmemberJan van den Baard12-Dec-05 19:32 
QuestionHow to use the help file? Pinmemberh.lee8-Dec-05 14:20 
AnswerRe: How to use the help file? PinmemberJan van den Baard8-Dec-05 19:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 17 Jun 2005
Article Copyright 2002 by Jan van den Baard
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid