Example #1
0
void CSkinButton2::OnMouseMove(UINT nFlags, CPoint point)
{
	if(m_bUseResponseRect && !m_rcResponse.PtInRect(point))
	{
		//CButton::OnMouseMove(nFlags, point);
		SendMouseMessageToParent(WM_MOUSEMOVE, nFlags, point);
		return;
	}
	if( !m_bSelected && IsWindowEnabled()&&m_bHandMouse )
	{
#ifndef IDC_HAND
#define IDC_HAND            MAKEINTRESOURCE(32649)
#endif
		::SetCursor(::LoadCursor(NULL, IDC_HAND));
	}

	if (!m_bMouseOnButton) 
	{ 
		TRACKMOUSEEVENT   tme; 
		tme.cbSize   =   sizeof(tme); 
		tme.hwndTrack   =   m_hWnd; 
		tme.dwFlags   =   TME_LEAVE   |   TME_HOVER; 
		tme.dwHoverTime   =   1; 
		m_bMouseOnButton   =   _TrackMouseEvent(&tme); 
	} 
	CButton::OnMouseMove(nFlags, point);
}
Example #2
0
void CSkinButton2::OnLButtonDown(UINT nFlags, CPoint point)
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	if(m_bUseResponseRect && !m_rcResponse.PtInRect(point))
	{
		//CButton::OnMouseMove(nFlags, point);
		SendMouseMessageToParent(WM_LBUTTONDOWN, nFlags, point);
		return;
	}

	if( m_bSelected )
	{
		this->SetCapture();
		return ;
	}
	m_bMouseDown = TRUE;
	CButton::OnLButtonDown(nFlags, point);
}
Example #3
0
void CSkinButton2::OnLButtonUp(UINT nFlags, CPoint point)
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	if(m_bUseResponseRect && !m_rcResponse.PtInRect(point))
	{
		//CButton::OnMouseMove(nFlags, point);
		::ReleaseCapture();
		SendMouseMessageToParent(WM_LBUTTONUP, nFlags, point);
		return;
	}

	if( m_bSelected )
	{
		::ReleaseCapture();
		return ;
	}
	m_bMouseDown = FALSE;
	CButton::OnLButtonUp(nFlags, point);
}
Example #4
0
void SolidRectWnd::OnLButtonDown(UINT nFlags, CPoint point) 
{
	SendMouseMessageToParent(WM_LBUTTONDOWN, nFlags, point);
	CWnd::OnLButtonDown(nFlags, point);
}
Example #5
0
void SolidRectWnd::OnMouseMove(UINT nFlags, CPoint point) 
{
	SendMouseMessageToParent(WM_MOUSEMOVE, nFlags, point);
	CWnd::OnMouseMove(nFlags, point);
}
Example #6
0
void SolidRectWnd::OnRButtonUp(UINT nFlags, CPoint point) 
{
	SendMouseMessageToParent(WM_RBUTTONUP, nFlags, point);
	CWnd::OnRButtonUp(nFlags, point);
}