首页 > 代码库 > Duilib Caption解析

Duilib Caption解析

DUILib 中的 caption="x1,y1,x2,y2"
x1 距离左边界的距离;rcCaption.left
y1 距离上边界的距离; rcCaption.top
x2 距离右边界的距离;rcCaption.right
y2 距离上边界的距离; rcCaption.bottom

rcClient 为客户区域大小

标题栏范围:
"rcClient.left + rcCaption.left(左边界坐标), rcCaption.top(上边界坐标),
rcClient.right - rcCaption.right(右边界坐标), rcCaption.bottom(下边界坐标)“

1
RECT rcCaption = m_PaintManager.GetCaptionRect();2 if( pt.x >= rcClient.left + rcCaption.left && pt.x < rcClient.right - rcCaption.right 3 && pt.y >= rcCaption.top && pt.y < rcCaption.bottom ) {4 CControlUI* pControl = static_cast<CControlUI*>(m_PaintManager.FindControl(pt));5 if( pControl && _tcsicmp(pControl->GetClass(), _T("ButtonUI")) != 0 && 6 _tcsicmp(pControl->GetClass(), _T("OptionUI")) != 0 &&7 _tcsicmp(pControl->GetClass(), _T("TextUI")) != 0 )8 return HTCAPTION;9 }