📄 customeditctrl.h
字号:
//*******************************************************************************
// COPYRIGHT NOTES
// ---------------
// This is a sample for BCGControlBar Library Professional Edition
// Copyright (C) 1998-2007 BCGSoft Ltd.
// All rights reserved.
//
// This source code can be used, distributed or modified
// only under terms and conditions
// of the accompanying license agreement.
//*******************************************************************************
//
// CustomEditCtrl.h : header file
//
#pragma once
/////////////////////////////////////////////////////////////////////////////
// CCustomEditCtrl window
static const DWORD g_dwBreakPointType = g_dwBCGPEdit_FirstUserDefinedMarker;
static const DWORD g_dwColorBreakPointType = g_dwBCGPEdit_FirstUserDefinedMarker << 1;
static const DWORD g_dwColorHeaderType = g_dwColorBreakPointType << 1;
class CCustomEditCtrl : public CBCGPEditCtrl
{
// Construction, destruction
public:
CCustomEditCtrl();
virtual ~CCustomEditCtrl();
// Attributes
public:
BOOL m_bCheckColorTags; // TRUE if check for tags (<....>) in "OnGetCharColor"
// Operations
public:
BOOL ToggleBreakpoint(int nCurrRow = -1);
void RemoveAllBreakpoints();
BOOL IsEnableBreakpoints() const { return m_bEnableBreakpoints; }
BOOL EnableBreakpoints(BOOL bFl);
BOOL CopyAsHTML ();
BOOL IsToggleOutliningEnabled ();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCustomEditCtrl)
//}}AFX_VIRTUAL
public:
// Syntax coloring
virtual void OnGetCharColor (TCHAR ch, int nOffset, COLORREF& clrText, COLORREF& clrBk);
// Marker Support
virtual void OnDrawMarker(CDC* pDC, CRect rectMarker, const CBCGPEditMarker* pMarker);
// Tooltip Support
virtual BOOL OnGetTipText (CString& strTipString);
virtual BOOL CanUpdateMarker (CBCGPEditMarker* pMarker) const
{
if (pMarker->m_dwMarkerType & g_dwColorHeaderType)
{
return FALSE;
}
return TRUE;
}
virtual BOOL CanRemoveMarker (CBCGPEditMarker* pMarker) const
{
if (pMarker->m_dwMarkerType & g_dwColorHeaderType)
{
return FALSE;
}
return TRUE;
}
// IntelliSense Support
virtual BOOL FillIntelliSenseList(CObList& lstIntelliSenseData, LPCTSTR lpszIntelliSense = NULL) const;
virtual void ReleaseIntelliSenseList(CObList& lstIntelliSenseData);
protected:
// IntelliSense Support
virtual BOOL OnBeforeInvokeIntelliSense (const CString& strBuffer, int& nCurrOffset, CString& strIntelliSence) const;
virtual BOOL IntelliSenseCharUpdate(const CString& strBuffer, int nCurrOffset, TCHAR nChar, CString& strIntelliSense);
// Implementation
// Generated message map functions
protected:
//{{AFX_MSG(CCustomEditCtrl)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
BOOL m_bEnableBreakpoints;
CMapStringToPtr m_mIntelliString;
CMapStringToString m_mTipString;
void PrepareIntelliSense();
BOOL IsIntelliSenceWord(const CString& strWord) const;
BOOL FillIntelliSenceWord(const CString& strBuffer, int nOffset, CString& strIntelliSence) const;
BOOL CheckIntelliMark(const CString& strBuffer, int& nOffset, CString& strWordSuffix) const;
inline static int GetNextPos(const CString& strBuffer, const CString& strSkipChars, int& nPos, BOOL bForward);
CBCGPToolBarImages m_ImageBreak;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -