コード例 #1
0
ファイル: thumbs.cpp プロジェクト: tweimer/miranda-ng
void ThumbInfo::OnMouseMove(int nX, int nY)
{
	// Position thumb
	if (bMouseDown) {
		POINT	ptNew = { nX, nY };
		ClientToScreen(hwnd, &ptNew);

		int dX = ptNew.x - ptOld.x;
		int dY = ptNew.y - ptOld.y;

		if (dX || dY) {
			bMouseMoved = TRUE;

			nLeft += dX;
			nTop += dY;

			PositionThumb(nLeft, nTop);
		}

		ptOld = ptNew;
	}
	else SetCursor(LoadCursor(nullptr, IDC_ARROW));

	// Update selection status
	if (!pThumbMouseIn) {
		SetTimer(hwnd, TIMERID_LEAVE_T, 10, nullptr);
		pThumbMouseIn = this;

		ThumbSelect(TRUE);
	}

	if (bEnableTip && fcOpt.bShowTip && !bMouseDown) {
		WORD tmpTimeIn;
		POINT pt;
		RECT rc;

		GetCursorPos(&pt);
		GetThumbRect(&rc);
		if (!PtInRect(&rc, pt)) {
			KillTip();
			return;
		}
		if (fTipTimerActive && abs(pt.x - ptTipSt.x) < 5 && abs(pt.y - ptTipSt.x) < 5)
			return;

		ptTipSt = pt;

		if (fTipTimerActive)
			KillTimer(hwnd, TIMERID_HOVER_T);

		if (fTipActive)
			return;

		tmpTimeIn = (fcOpt.TimeIn > 0) ? fcOpt.TimeIn : CallService(MS_CLC_GETINFOTIPHOVERTIME, 0, 0);
		SetTimer(hwnd, TIMERID_HOVER_T, tmpTimeIn, nullptr);
		fTipTimerActive = TRUE;
	}
}
コード例 #2
0
ファイル: thumbs.cpp プロジェクト: tweimer/miranda-ng
void ThumbInfo::OnLButtonDown()
{
	if (bEnableTip && fcOpt.bShowTip)
		KillTip();

	GetCursorPos(&ptOld);

	RECT rc;
	GetThumbRect(&rc);

	nLeft = rc.left;
	nTop = rc.top;

	bMouseDown = TRUE;
	bMouseMoved = FALSE;
}
コード例 #3
0
void CTipWindow::OnMouseMove( const CPoint & )
{
    KillTip();
}