📄 atlscintilla.h
字号:
#ifndef __ATLSCINTILLA_H__
#define __ATLSCINTILLA_H__
#pragma once
//
// Scintilla Editor WTL wrappers
//
// Automatically generated by Bjarke Viksoe (bjarke@viksoe.dk)
// The script (JavaScript) to regenerate these wrappers can be
// obtained by mail request.
//
#ifndef __cplusplus
#error ATL requires C++ compilation (use a .cpp suffix)
#endif
#ifndef __ATLCTRLS_H__
#error atlscintilla.h requires atlctrls.h to be included first
#endif
#if (_WIN32_IE < 0x0300)
#error atlscintilla.h requires IE Version 3.0 or higher
#endif
// Include the original Scintilla C++ headers
#define PLAT_WIN 1
#include "Scintilla.h"
#undef PLAT_WIN
/////////////////////////////////////////////////////////////////////////////
// CScintillaCtrl
template< class TBase >
class CScintillaCtrlT : public TBase
{
public:
CScintillaCtrlT(HWND hWnd = NULL) : TBase(hWnd) { }
CScintillaCtrlT< TBase >& operator=(HWND hWnd)
{
m_hWnd = hWnd;
return *this;
}
HWND Create(HWND hWndParent, _U_RECT rect = NULL, LPCTSTR szWindowName = NULL,
DWORD dwStyle = 0, DWORD dwExStyle = 0,
_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)
{
return CWindow::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);
}
// Attributes
static LPCTSTR GetWndClassName()
{
return _T("Scintilla");
}
static LPCTSTR GetLibraryName()
{
return _T("SCILEXER.DLL");
}
// Operations
CharacterRange GetSelection() const
{
ATLASSERT(::IsWindow(m_hWnd));
CharacterRange cr;
cr.cpMin = GetSelectionStart();
cr.cpMax = GetSelectionEnd();
return cr;
}
void SetSel(CharacterRange cr)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETSEL, (WPARAM) cr.cpMin, (LPARAM) cr.cpMax);
}
int GetCurrentLine() const
{
ATLASSERT(::IsWindow(m_hWnd));
return LineFromPosition(GetCurrentPos());
}
int GetLineLength(int iLine) const
{
ATLASSERT(::IsWindow(m_hWnd));
return GetLineEndPosition(iLine) - PositionFromLine(iLine);
}
int GetTextRange(int iStart, int iEnd, LPSTR pstrText) const
{
ATLASSERT(::IsWindow(m_hWnd));
ATLASSERT(pstrText);
TextRange tr;
tr.chrg.cpMin = iStart;
tr.chrg.cpMax = iEnd;
tr.lpstrText = pstrText;
return (int) ::SendMessage(m_hWnd, SCI_GETTEXTRANGE, 0, (LPARAM) &tr);
}
int GetCaretInLine() const
{
ATLASSERT(::IsWindow(m_hWnd));
int lCaret = GetCurrentPos();
int lLine = LineFromPosition(lCaret);
int lLineStart = PositionFromLine(lLine);
return lCaret - lLineStart;
}
/**
* AUTOGENERATED - START
**/
void AddText(int iLength, LPCSTR pstrText)
{
ATLASSERT(::IsWindow(m_hWnd));
ATLASSERT(pstrText);
::SendMessage(m_hWnd, SCI_ADDTEXT, (WPARAM) iLength, (LPARAM) pstrText);
}
void AddStyledText(int iLength, LPSTR pCells)
{
ATLASSERT(::IsWindow(m_hWnd));
ATLASSERT(pCells);
::SendMessage(m_hWnd, SCI_ADDSTYLEDTEXT, (WPARAM) iLength, (LPARAM) pCells);
}
void InsertText(long lPos, LPCSTR pstrText)
{
ATLASSERT(::IsWindow(m_hWnd));
ATLASSERT(pstrText);
::SendMessage(m_hWnd, SCI_INSERTTEXT, (WPARAM) lPos, (LPARAM) pstrText);
}
void ClearAll()
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_CLEARALL, 0, 0L);
}
void ClearDocumentStyle()
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_CLEARDOCUMENTSTYLE, 0, 0L);
}
int GetLength() const
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_GETLENGTH, 0, 0L);
}
int GetCharAt(long lPos) const
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_GETCHARAT, (WPARAM) lPos, 0L);
}
long GetCurrentPos() const
{
ATLASSERT(::IsWindow(m_hWnd));
return (long) ::SendMessage(m_hWnd, SCI_GETCURRENTPOS, 0, 0L);
}
long GetAnchor() const
{
ATLASSERT(::IsWindow(m_hWnd));
return (long) ::SendMessage(m_hWnd, SCI_GETANCHOR, 0, 0L);
}
int GetStyleAt(long lPos) const
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_GETSTYLEAT, (WPARAM) lPos, 0L);
}
void Redo()
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_REDO, 0, 0L);
}
void SetUndoCollection(BOOL bCollectUndo)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETUNDOCOLLECTION, (WPARAM) bCollectUndo, 0L);
}
void SelectAll()
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SELECTALL, 0, 0L);
}
void SetSavePoint()
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETSAVEPOINT, 0, 0L);
}
int GetStyledText(TextRange* pTextRange)
{
ATLASSERT(::IsWindow(m_hWnd));
ATLASSERT(pTextRange);
return (int) ::SendMessage(m_hWnd, SCI_GETSTYLEDTEXT, 0, (LPARAM) pTextRange);
}
BOOL CanRedo() const
{
ATLASSERT(::IsWindow(m_hWnd));
return (BOOL) ::SendMessage(m_hWnd, SCI_CANREDO, 0, 0L);
}
int MarkerLineFromHandle(int iHandle)
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_MARKERLINEFROMHANDLE, (WPARAM) iHandle, 0L);
}
void MarkerDeleteHandle(int iHandle)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_MARKERDELETEHANDLE, (WPARAM) iHandle, 0L);
}
BOOL GetUndoCollection() const
{
ATLASSERT(::IsWindow(m_hWnd));
return (BOOL) ::SendMessage(m_hWnd, SCI_GETUNDOCOLLECTION, 0, 0L);
}
int GetViewWS() const
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_GETVIEWWS, 0, 0L);
}
void SetViewWS(int iViewWS)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETVIEWWS, (WPARAM) iViewWS, 0L);
}
long PositionFromPoint(int iX, int iY)
{
ATLASSERT(::IsWindow(m_hWnd));
return (long) ::SendMessage(m_hWnd, SCI_POSITIONFROMPOINT, (WPARAM) iX, (LPARAM) iY);
}
long PositionFromPointClose(int iX, int iY)
{
ATLASSERT(::IsWindow(m_hWnd));
return (long) ::SendMessage(m_hWnd, SCI_POSITIONFROMPOINTCLOSE, (WPARAM) iX, (LPARAM) iY);
}
void GotoLine(int iLine)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_GOTOLINE, (WPARAM) iLine, 0L);
}
void GotoPos(long lPos)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_GOTOPOS, (WPARAM) lPos, 0L);
}
void SetAnchor(long lPosAnchor)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETANCHOR, (WPARAM) lPosAnchor, 0L);
}
int GetCurLine(int iLength, LPSTR pstrText)
{
ATLASSERT(::IsWindow(m_hWnd));
ATLASSERT(pstrText);
return (int) ::SendMessage(m_hWnd, SCI_GETCURLINE, (WPARAM) iLength, (LPARAM) pstrText);
}
long GetEndStyled() const
{
ATLASSERT(::IsWindow(m_hWnd));
return (long) ::SendMessage(m_hWnd, SCI_GETENDSTYLED, 0, 0L);
}
void ConvertEOLs(int iEolMode)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_CONVERTEOLS, (WPARAM) iEolMode, 0L);
}
int GetEOLMode() const
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_GETEOLMODE, 0, 0L);
}
void SetEOLMode(int iEolMode)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETEOLMODE, (WPARAM) iEolMode, 0L);
}
void StartStyling(long lPos, int iMask)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_STARTSTYLING, (WPARAM) lPos, (LPARAM) iMask);
}
void SetStyling(int iLength, int iStyle)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETSTYLING, (WPARAM) iLength, (LPARAM) iStyle);
}
BOOL GetBufferedDraw() const
{
ATLASSERT(::IsWindow(m_hWnd));
return (BOOL) ::SendMessage(m_hWnd, SCI_GETBUFFEREDDRAW, 0, 0L);
}
void SetBufferedDraw(BOOL bBuffered)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETBUFFEREDDRAW, (WPARAM) bBuffered, 0L);
}
void SetTabWidth(int iTabWidth)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETTABWIDTH, (WPARAM) iTabWidth, 0L);
}
int GetTabWidth() const
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_GETTABWIDTH, 0, 0L);
}
void SetCodePage(int iCodePage)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETCODEPAGE, (WPARAM) iCodePage, 0L);
}
void SetUsePalette(BOOL bUsePalette)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETUSEPALETTE, (WPARAM) bUsePalette, 0L);
}
void MarkerDefine(int iMarkerNumber, int iMarkerSymbol)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_MARKERDEFINE, (WPARAM) iMarkerNumber, (LPARAM) iMarkerSymbol);
}
void MarkerSetFore(int iMarkerNumber, COLORREF clrFore)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_MARKERSETFORE, (WPARAM) iMarkerNumber, (LPARAM) clrFore);
}
void MarkerSetBack(int iMarkerNumber, COLORREF clrBack)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_MARKERSETBACK, (WPARAM) iMarkerNumber, (LPARAM) clrBack);
}
int MarkerAdd(int iLine, int iMarkerNumber)
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_MARKERADD, (WPARAM) iLine, (LPARAM) iMarkerNumber);
}
void MarkerDelete(int iLine, int iMarkerNumber)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_MARKERDELETE, (WPARAM) iLine, (LPARAM) iMarkerNumber);
}
void MarkerDeleteAll(int iMarkerNumber)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_MARKERDELETEALL, (WPARAM) iMarkerNumber, 0L);
}
int MarkerGet(int iLine)
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_MARKERGET, (WPARAM) iLine, 0L);
}
int MarkerNext(int iLineStart, int iMarkerMask)
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_MARKERNEXT, (WPARAM) iLineStart, (LPARAM) iMarkerMask);
}
int MarkerPrevious(int iLineStart, int iMarkerMask)
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_MARKERPREVIOUS, (WPARAM) iLineStart, (LPARAM) iMarkerMask);
}
void MarkerDefinePixmap(int iMarkerNumber, LPCSTR pstrPixmap)
{
ATLASSERT(::IsWindow(m_hWnd));
ATLASSERT(pstrPixmap);
::SendMessage(m_hWnd, SCI_MARKERDEFINEPIXMAP, (WPARAM) iMarkerNumber, (LPARAM) pstrPixmap);
}
void SetMarginTypeN(int iMargin, int iMarginType)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETMARGINTYPEN, (WPARAM) iMargin, (LPARAM) iMarginType);
}
int GetMarginTypeN(int iMargin) const
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_GETMARGINTYPEN, (WPARAM) iMargin, 0L);
}
void SetMarginWidthN(int iMargin, int iPixelWidth)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETMARGINWIDTHN, (WPARAM) iMargin, (LPARAM) iPixelWidth);
}
int GetMarginWidthN(int iMargin) const
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_GETMARGINWIDTHN, (WPARAM) iMargin, 0L);
}
void SetMarginMaskN(int iMargin, int iMask)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETMARGINMASKN, (WPARAM) iMargin, (LPARAM) iMask);
}
int GetMarginMaskN(int iMargin) const
{
ATLASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, SCI_GETMARGINMASKN, (WPARAM) iMargin, 0L);
}
void SetMarginSensitiveN(int iMargin, BOOL bSensitive)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_SETMARGINSENSITIVEN, (WPARAM) iMargin, (LPARAM) bSensitive);
}
BOOL GetMarginSensitiveN(int iMargin) const
{
ATLASSERT(::IsWindow(m_hWnd));
return (BOOL) ::SendMessage(m_hWnd, SCI_GETMARGINSENSITIVEN, (WPARAM) iMargin, 0L);
}
void StyleClearAll()
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_STYLECLEARALL, 0, 0L);
}
void StyleSetFore(int iStyle, COLORREF clrFore)
{
ATLASSERT(::IsWindow(m_hWnd));
::SendMessage(m_hWnd, SCI_STYLESETFORE, (WPARAM) iStyle, (LPARAM) clrFore);
}
void StyleSetBack(int iStyle, COLORREF clrBack)
{
ATLASSERT(::IsWindow(m_hWnd));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -