示例#1
0
void CCtrlGesture::onRButtonUp (CPoint pt, uint key) {
	assert(m_pCtrlMain->getCaptureCtrl() == shared_from_this());
	assert(m_points.size() > 0);

	CPoint ptDown = m_points[0];
	bool pass2background = m_points.size() == 1;
	tstring gesture = m_gesture;
	bool isTimeout = m_isTimeout;
	CCtrlTarget *pTarget = _GetTarget(); // save it before removed from control main
	assert(pTarget != NULL);
	
	_Capture(false);
	m_pCtrlMain->removeChild(m_id);
	m_points.clear();
	m_gesture.clear();
	m_isTimeout = false;

	if (::GetTickCount() - m_lastMove < m_gestureTimeout && !isTimeout) {
		pTarget->onGesture(gesture, ptDown, true);
		m_lastMove = 0;
	} else if (pass2background && !isTimeout) {
		CControlPtr ctrl = m_pCtrlMain->getControlByPoint(ptDown);
		if (ctrl != NULL) {
			ctrl->onRButtonDown(ptDown, key);
		}

		ctrl = m_pCtrlMain->getControlByPoint(pt);
		if (ctrl != NULL) {
			ctrl->onRButtonUp(pt, key);
		}
	}
}
示例#2
0
void CCtrlButton::onLButtonUp (CPoint pt, uint /*key*/) {
	if (disable) {
		if (_GetMainCtrl()->getCaptureCtrl() == shared_from_this()) {
			_Capture(false);
		}
		return;
	}
	_Capture(false);
	m_pushAndCapture = false;
	invalidate();

	assert (_GetTarget() != NULL);
	if (isPointIn(pt)) {
		_GetTarget()->onCommand(m_id, shared_from_this());
	}
}
示例#3
0
void CCtrlButton::onLButtonDown (CPoint /*pt*/, uint /*key*/) {
	if (disable) {
		return;
	}
	_Capture(true);
	m_pushAndCapture = true;
	invalidate();
}
示例#4
0
void CCtrlGesture::onRButtonDown (CPoint pt, uint /*key*/) {
	m_pCtrlMain->insertChild(shared_from_this());
	assert (m_pCtrlMain->getControlByID(m_id) == shared_from_this());
	_Capture(true);
	m_points.clear();
	m_gesture.clear();
	m_points.push_back(pt);
	m_isTimeout = false;
}
示例#5
0
void CCtrlImageButton::onLButtonUp (CPoint pt, uint key) {
	if (disable) {
		if (_GetMainCtrl()->getCaptureCtrl() == shared_from_this()) {
			_Capture(false);
		}
		return;
	}
	CCtrlButton::onLButtonUp(pt, key);
}
示例#6
0
void CNavView::onLButtonDown (CPoint pt, xl::uint) {
	assert(m_ptCapture == CPoint(-1, -1));
	CRect rcView = m_rcView;
	CRect rc = getClientRect();
	rcView.OffsetRect(rc.left, rc.top);
	if (rcView.PtInRect(pt)) {
		_Capture(true);
		m_ptCapture = pt;
		m_ptSrcCapture = m_ptSrc;
	}
}
示例#7
0
void CNavView::onLButtonUp (CPoint, xl::uint) {
	_Capture(false);
	m_ptCapture = CPoint(-1, -1);
	m_ptSrcCapture = CPoint(-1, -1);
}