listboxtip.h

来自「实效编程百例,包含了用vc开发的各方面的源代码。」· C头文件 代码 · 共 37 行

H
37
字号
////////////////////////////////////////////////////////////////
// VCKBASE -- June 2001 
// Visual C++ 6.0 环境编译, Windows 98 和 NT 环境运行.
//
#pragma once

#include "subclass.h"
#include "puptext.h"

//////////////////
// Generic tip-handler to display tip for wide text in a list box.
// To use:
// - instantiate one of these for each list box
// - call Init
//
class CListBoxTipHandler : public CSubclassWnd {
protected:
	UINT	m_idMyControl;						 // id of list box control
	UINT	m_nCurItem;							 // index of current item
	BOOL	m_bCapture;							 // whether mouse is captured
	static CPopupText g_wndTip;			 // THE tip window

	// subclass window proc
	virtual LRESULT WindowProc(UINT msg, WPARAM wp, LPARAM lp);

	// virtual fns you can override
	virtual void OnMouseMove(CPoint p);
	virtual BOOL IsRectCompletelyVisible(const CRect& rc);
	virtual UINT OnGetItemInfo(CPoint p, CRect& rc, CString& s);

public:
	CListBoxTipHandler();
	~CListBoxTipHandler();
	static UINT g_nTipTimeMsec;			 // global: msec wait before showing tip
	void Init(CWnd* pListBox);				 // initialize
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?