本文整理汇总了C++中CControlBase::GetRresponse方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlBase::GetRresponse方法的具体用法?C++ CControlBase::GetRresponse怎么用?C++ CControlBase::GetRresponse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlBase
的用法示例。
在下文中一共展示了CControlBase::GetRresponse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnLButtonDown
// 鼠标左键按下事件处理
BOOL CControlBase::OnLButtonDown(UINT nFlags, CPoint point)
{
if(!m_bIsVisible || !m_bRresponse) return false;
// 保存原始的鼠标位置,并进行位置变换
CPoint oldPoint = point;
OnMousePointChange(point);
m_bMouseDown = m_rc.PtInRect(point);
// 查找鼠标是否在某个内部控件位置,如果是的话就更新当前子控件(按照反向顺序查找,因为定义在后面的控件是优先级更高的)
// 找到第一个符合条件的就结束查找
for (int i = m_vecControl.size()-1; i >= 0; i--)
{
CControlBase * pControlBase = m_vecControl.at(i);
if (pControlBase && pControlBase->PtInRect(point))
{
if(pControlBase->GetVisible() && !pControlBase->GetDisable() && pControlBase->GetRresponse())
{
m_pControl = pControlBase;
break;
}
}
}
if(m_pControl != NULL)
{
// 如果是控件内置滚动条子控件,则不进行位置变换,因为滚动条位置是不需要变换的
UINT uControlID = m_pControl->GetControlID();
if((SCROLL_V == uControlID) || (SCROLL_H == uControlID))
{
point = oldPoint;
}
if(m_pControl->OnLButtonDown(nFlags, point))
{
return true;
}
}
else
{
// 切换对话框中的当前焦点控件(暂不处理Popup窗口的切换)
CDlgBase* pDlg = GetParentDialog(FALSE);
if(pDlg)
{
pDlg->SetFocusControl(this);
}
// 发送鼠标左键按下DUI消息
if(m_bDuiMsgMouseLDown && m_rc.PtInRect(point))
{
SendMessage(MSG_MOUSE_LDOWN, (WPARAM)nFlags, (LPARAM)(&point));
}
return OnControlLButtonDown(nFlags, point);
}
return false;
}
示例2: OnLButtonDown
// 鼠标左键事件处理
BOOL CControlBase::OnLButtonDown(UINT nFlags, CPoint point)
{
if(!m_bIsVisible || !m_bRresponse) return false;
OnMousePointChange(point);
m_bMouseDown = m_rc.PtInRect(point);
// 查找鼠标是否在某个内部控件位置,如果是的话就更新当前子控件
for (size_t i = 0; i < m_vecControl.size(); i++)
{
CControlBase * pControlBase = m_vecControl.at(i);
if (pControlBase && pControlBase->PtInRect(point))
{
if(pControlBase->GetVisible() && !pControlBase->GetDisable() && pControlBase->GetRresponse())
{
m_pControl = pControlBase;
}
}
}
if(m_pControl != NULL)
{
if(m_pControl->OnLButtonDown(nFlags, point))
{
return true;
}
}
else
{
// 切换对话框中的当前焦点控件(暂不处理Popup窗口的切换)
CDlgBase* pDlg = GetParentDialog(FALSE);
if(pDlg)
{
pDlg->SetFocusControl(this);
}
return OnControlLButtonDown(nFlags, point);
}
return false;
}
示例3: OnMouseMove
void CDlgPopup::OnMouseMove(UINT nFlags, CPoint point)
{
if (!m_bTracking)
{
TRACKMOUSEEVENT tme;
tme.cbSize = sizeof(tme);
tme.hwndTrack = m_hWnd;
tme.dwFlags = TME_LEAVE | TME_HOVER;
tme.dwHoverTime = 1;
m_bTracking = ::_TrackMouseEvent(&tme);
}
BOOL bInvalidateRect = false;
if (m_pControl)
{
if(((m_pControl->PtInRect(point) && m_pControl->OnCheckMouseResponse(nFlags, point)) || m_bIsLButtonDown) && m_bTracking)
{
m_pControl->OnMouseMove(nFlags, point);
return;
}
}
if (!m_bIsLButtonDown)
{
CControlBase * pOldControl = m_pControl;
BOOL bIsSelect = FALSE;
BOOL bIsSystemSelect = FALSE;
if(m_bTracking)
{
// 用户控件
for (size_t i = 0; i < m_vecControl.size(); i++)
{
CControlBase * pControlBase = m_vecControl.at(i);
if (pControlBase)
{
pControlBase->OnMouseMove(nFlags, point);
if (!bIsSystemSelect)
{
if(pControlBase->PtInRect(point) && pControlBase->GetRresponse())
{
m_pControl = pControlBase;
bIsSelect = TRUE;
}
}
}
}
}
if (!bIsSelect && !bIsSystemSelect)
{
m_pControl = NULL;
}
// 调用自身的OnMouseMove
if(OnMouseMove(point))
{
DrawWindow();
}
}
}