📄 oxtooltipctrl.h
字号:
// ==========================================================================
// Class Specification : COXToolTipCtrl
// ==========================================================================
// //////////////////////////////////////////////////////////////////////////
// Header file : OXToolTipCtrl.h
//
//
//////////////////////////////////////////////////////////////////////////
#if !defined(_OXTOOLTIPCTRL_H__)
#define _OXTOOLTIPCTRL_H__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "OXDllExt.h"
class COXToolTipInfo;
struct OXTOOLINFO : public TOOLINFO
{
#if (_WIN32_IE < 0x0300)
// Application defined value that is associated with the tool
LPARAM lParam;
#endif
// Width of box, or 0 for default
int nWidth;
// text color
COLORREF clrTextColor;
// background color
COLORREF clrBackColor;
OXTOOLINFO::OXTOOLINFO()
{
cbSize = sizeof(OXTOOLINFO);
}
void operator=(COXToolTipInfo& RHS);
};
// this structure holds all the tooltip information internall
class OX_CLASS_DECL COXToolTipInfo : public CObject
{
public:
UINT uFlags; // Not used
HWND hWnd; // Window handle of the control
UINT nIDTool; // ID of tool
CRect rectBounds; // Bounding rect for toolinfo to be displayed
LPCTSTR szText; // Either LPSTR_TEXTCALLBACK or NULL
CString strText; // Tooltip text if szText is NULL, or empty.
int nWidth; // Width of box, or 0 for default
COLORREF clrTextColor; // text color
COLORREF clrBackColor; // background color
LPARAM lParam; // Application defined value that is associated
// with the tool
void operator=(OXTOOLINFO& RHS)
{
uFlags = RHS.uFlags;
hWnd = RHS.hwnd;
nIDTool = RHS.uId;
rectBounds = RHS.rect;
if (RHS.lpszText == LPSTR_TEXTCALLBACK)
{
szText = RHS.lpszText;
strText.Empty();
}
else
{
szText = NULL;
strText = RHS.lpszText;
}
nWidth = RHS.nWidth;
clrTextColor = RHS.clrTextColor;
clrBackColor = RHS.clrBackColor;
lParam = RHS.lParam;
}
void operator=(COXToolTipInfo& RHS)
{
uFlags = RHS.uFlags;
hWnd = RHS.hWnd;
nIDTool = RHS.nIDTool;
rectBounds = RHS.rectBounds;
strText = RHS.strText;
nWidth = RHS.nWidth;
clrTextColor = RHS.clrTextColor;
clrBackColor = RHS.clrBackColor;
lParam = RHS.lParam;
}
};
inline void OXTOOLINFO::operator=(COXToolTipInfo& RHS)
{
cbSize = sizeof(OXTOOLINFO);
uFlags = RHS.uFlags;
hwnd = RHS.hWnd;
uId = RHS.nIDTool;
rect = RHS.rectBounds;
hinst = AfxGetResourceHandle();
if (RHS.szText == LPSTR_TEXTCALLBACK)
lpszText = LPSTR_TEXTCALLBACK;
else
lpszText = (LPTSTR)(LPCTSTR) RHS.strText;
lParam = RHS.lParam;
nWidth = RHS.nWidth;
clrTextColor = RHS.clrTextColor;
clrBackColor = RHS.clrBackColor;
}
/////////////////////////////////////////////////////////////////////////////
// COXToolTipCtrl window
class OX_CLASS_DECL COXToolTipCtrl : public CWnd
{
// Construction
public:
// --- In
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -