/*
Module : ScintillaCtrl.CPP
Purpose: Defines the implementation for an MFC wrapper class for the Scintilla edit control (www.scintilla.org)
Created: PJN / 19-03-2004
History: PJN / 19-03-2004 1. Initial implementation synchronized to the v1.59 release of Scintilla
PJN / 19-03-2004 1. Updated the sample app's Find Next and Find Previous marker functions. Now correctly
goes to the next and previous markers when a marker is on the current line.
2. Updated the sample app's passing of messages to Scintilla from the top level
CMainFrame window
PJN / 06-06-2004 1. Updated class to work with Scintilla v1.61
PJN / 20-12-2004 1. Updated class to work with Scintilla v1.62.
2. Sample app now includes a common control 6 manifest
3. Sample app now includes an example of scintilla autocompletion. When you type
"scintilla is " case insensitively a autocompletion list is displayed which allows
"very cool", "easy" or "way cool!!" to be entered.
4. Sample app now includes an example of scintilla calltips. Whenever you hover
over text which is "author " case insensitively, a call tip with the text
"PJ Naughter" is displayed.
PJN / 10-07-2005 1. Updated class to work with Scintilla v1.64.
2. Fixed a number of warnings when the code is compiled using Visual Studio .NET 2003.
PJN / 03-01-2006.1. Updated class to work with Scintilla v1.67. New messages wrapped include:
SCI_MARKERADDSET, SCI_SETPASTECONVERTENDINGS, SCI_GETPASTECONVERTENDINGS,
SCI_SELECTIONDUPLICATE and SCI_GETSTYLEBITSNEEDED.
2. Updated copyright messages
PJN / 14-03-2006 1. Updated class to work with Scintilla v1.68. New messages wrapped include:
SCI_CALLTIPUSESTYLE, SCI_SETCARETLINEBACKALPHA and SCI_GETCARETLINEBACKALPHA.
PJN / 05-06-2006 1. Updated class to work with Scintilla v1.69. New messages wrapped include:
SCI_MARKERSETALPHA, SCI_GETSELALPHA and SCI_SETSELALPHA.
PJN / 06-06-2006 1. Updated the wrapper class to work correctly when compiled for Unicode.
PJN / 29-06-2006 1. Code now uses new C++ style casts rather than old style C casts where necessary.
2. Optimized CScintillaCtrl constructor code
3. Updated the code to clean compile in VC 2005
4. Fixed a bug in the sample program when you invoke Print Preview when compiled
using VC 2005
PJN / 27-07-2006 1. Minor update to the sample app to fix an ASSERT related to the formatting of the
IDR_SCINTITYPE string resource. Thanks to Matt Spear for reporting this issue.
PJN / 17-09-2006 1. Fixed a bug in UTF82W (and W2UTF8) where if GetLine is called in a Unicode build
for the end of the file (i.e. a line having a length of 0), the UTF82W function would
allocate no buffer, but still erroneously write a one character terminating null. In
addition, the caller (GetLine) will try to deallocate the buffer that was never
allocated. Thanks to Scott Kelley for spotting this nasty bug.
2. Added of a GetLineEx method which explicitly sets the first WORD value in the text
string to the maximum size. This avoids client code from having to deal with the
weird semantics of the EM_GETLINE message. Thanks to Scott Kelley for providing this
nice addition.
3. Verified code implements all the functionality of Scintilla v1.71
PJN / 11-06-2007 1. Updated copyright details.
2. CScintillaCtrl::GetSelText now uses CString::GetBufferSetLength to avoid having to
allocate an intermediate buffer. Thanks to Jochen Neubeck for reporting this
optimization
3. Addition of a SCINTILLACTRL_EXT_CLASS preprocessor macro to allow the classes to be
more easily used in an extension DLL.
4. Updated class to work with Scintilla v1.73. New messages wrapped include:
SCI_STYLEGETFORE, SCI_STYLEGETBACK, SCI_STYLEGETBOLD, SCI_STYLEGETITALIC, SCI_STYLEGETSIZE,
SCI_STYLEGETFONT, SCI_STYLEGETEOLFILLED, SCI_STYLEGETUNDERLINE, SCI_STYLEGETCASE,
SCI_STYLEGETCHARACTERSET, SCI_STYLEGETVISIBLE, SCI_STYLEGETCHANGEABLE, SCI_STYLEGETHOTSPOT,
SCI_GETSELEOLFILLED, SCI_SETSELEOLFILLED, SCI_GETHOTSPOTACTIVEFORE, SCI_GETHOTSPOTACTIVEBACK,
SCI_GETHOTSPOTACTIVEUNDERLINE & SCI_GETHOTSPOTSINGLELINE
PJN / 28-11-2007 1. Updated class to work with Scintilla v1.75. New messages wrapped include: SCI_INDICSETUNDER,
SCI_INDICGETUNDER, new behavior for SCI_SETINDENTATIONGUIDES & SCI_GETINDENTATIONGUIDES,
SCI_SETSCROLLWIDTHTRACKING, SCI_GETSCROLLWIDTHTRACKING, SCI_DELWORDRIGHTEND, SCI_SETCARETSTYLE,
SCI_GETCARETSTYLE, SCI_SETINDICATORCURRENT, SCI_SETINDICATORVALUE, SCI_INDICATORFILLRANGE,
SCI_INDICATORCLEARRANGE, SCI_INDICATORALLONFOR, SCI_INDICATORVALUEAT, SCI_INDICATORSTART,
SCI_INDICATOREND, SCI_SETPOSITIONCACHE & SCI_GETPOSITIONCACHE.
2. The auto completion sample in CScintillaDemoView::OnCharAdded has been extended to show
another style of auto completion. Thanks to alessandro limonta for suggesting this update.
PJN / 19-03-2008 1. Updated class to work with Scintilla v1.76. New messages wrapped include: SCI_COPYALLOWLINE.
2. Updated copyright details.
3. Updated code to clean compile on VC 2008.
4. Removed VC 6 style classwizard comments from the code.
5. Updated the sample apps document icon.
6. Fixed a level 4 warning when the code is compiled on VC 6.
PJN / 15-06-2008 1. Code now compiles cleanly using Code Analysis (/analyze)
2. Updated code to compile correctly using _ATL_CSTRING_EXPLICIT_CONSTRUCTORS define
3. The code now only supports VC 2005 or later.
PJN / 01-11-2008 1. Updated class to work with Scintilla v1.77. New messages wrapped include:
SCI_GETCHARACTERPOINTER, SCI_SETKEYSUNICODE & SCI_GETKEYSUNICODE
2. Reworked all the key Unicode functions which expose string length management and
reimplemented them to use CStringW output parameters. Equivalent ASCII versions have also been
provided. This new approach helps to raise the level of abstraction provided by the wrapper
class. In the process the need for the GetLineEx function has been removed. Thanks to Alexei
Letov for prompting this update.
PJN / 20-01-2009 1. Updated copyright details.
Copyright (c) 2004 - 2009 by PJ Naughter (Web: www.naughter.com, Email: pjna@naughter.com)
All rights reserved.
Copyright / Usage Details:
You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise)
when your
评论6
最新资源