📄 oxtooltipctrl.cpp
字号:
// ==========================================================================
// Class Implementation : COXToolTipCtrl
// ==========================================================================
#include "stdafx.h"
#include "OXToolTipCtrl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// TODO: Add message handlers (eg TTM_SETTIPBKCOLOR) and point them
// to the correct functions.
LPCTSTR COXToolTipCtrl::m_szArrowSpace = _T(" ");
/////////////////////////////////////////////////////////////////////////////
// COXToolTipCtrl construction
COXToolTipCtrl::COXToolTipCtrl() :
m_pParentWnd(NULL),
m_rectMargin(2,2,3,3),
m_nMaxWidth(0),
m_ptOffset(0,20),
m_pCurrentToolTip(NULL),
m_nCheckInterval(500), // Time between checks of the tooltip - allows
// user to move the mouse to the tooltip before
// it disappears
m_nDisplayDelay(500), // delay in milliseconds till the tooltip is
// displayed
m_nDisplayTime(5000), // Length of time the tooltip is displayed
m_nElapsedTime(0),
m_bActivated(TRUE),
m_bTipCancelled(FALSE),
m_bHasExtendedText(FALSE),
m_hOldFocusWnd(NULL),
m_crBackColor(CLR_DEFAULT),
m_crTextColor(CLR_DEFAULT),
m_bUsingSystemFont(TRUE),
m_dwTextStyle(DT_EXPANDTABS|DT_EXTERNALLEADING|DT_NOPREFIX|DT_WORDBREAK)
{
m_arrTools.RemoveAll();
}
COXToolTipCtrl::~COXToolTipCtrl()
{
m_Font.DeleteObject();
COXToolTipInfo *pInfo = NULL;
int nSize = m_arrTools.GetSize();
for (int nIndex = 0; nIndex < nSize; nIndex++)
{
pInfo = (COXToolTipInfo* )m_arrTools.GetAt(nIndex);
delete pInfo;
}
m_arrTools.RemoveAll();
if (IsWindow(m_hWnd))
DestroyWindow();
}
/////////////////////////////////////////////////////////////////////////////
// COXToolTipCtrl message handlers
BEGIN_MESSAGE_MAP(COXToolTipCtrl, CWnd)
//{{AFX_MSG_MAP(COXToolTipCtrl)
ON_WM_PAINT()
ON_WM_TIMER()
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_SETFOCUS()
ON_WM_DESTROY()
ON_WM_SETTINGCHANGE()
ON_WM_MOUSEACTIVATE()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_SETFONT, OnSetFont)
ON_MESSAGE(WM_GETFONT, OnGetFont)
END_MESSAGE_MAP()
// --- In
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -