本文整理汇总了C++中CControlUI::IsClass方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlUI::IsClass方法的具体用法?C++ CControlUI::IsClass怎么用?C++ CControlUI::IsClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlUI
的用法示例。
在下文中一共展示了CControlUI::IsClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnNcHitTest
LRESULT CWin::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
POINT pt; pt.x = GET_X_LPARAM(lParam); pt.y = GET_Y_LPARAM(lParam);
::ScreenToClient(m_hWnd, &pt);
RECT rcClient;
::GetClientRect(*this, &rcClient);
if( !::IsZoomed(*this) ) {
RECT rcSizeBox = GetPaintMgr()->GetSizeBox();
if( pt.y < rcClient.top + rcSizeBox.top ) {
if( pt.x < rcClient.left + rcSizeBox.left ) return HTTOPLEFT;
if( pt.x > rcClient.right - rcSizeBox.right ) return HTTOPRIGHT;
return HTTOP;
}
else if( pt.y > rcClient.bottom - rcSizeBox.bottom ) {
if( pt.x < rcClient.left + rcSizeBox.left ) return HTBOTTOMLEFT;
if( pt.x > rcClient.right - rcSizeBox.right ) return HTBOTTOMRIGHT;
return HTBOTTOM;
}
if( pt.x < rcClient.left + rcSizeBox.left ) return HTLEFT;
if( pt.x > rcClient.right - rcSizeBox.right ) return HTRIGHT;
}
RECT rcCaption = GetPaintMgr()->GetCaptionRect();
//modify by dfn.li 2013-7-12 21:09
RECT rcBottomCaption = GetPaintMgr()->GetBottomCaptionRect();
bool bCaption = false;
if( pt.x >= rcClient.left + rcCaption.left && pt.x < rcClient.right - rcCaption.right \
&& pt.y >= rcCaption.top && pt.y < rcCaption.bottom )
bCaption = true;
bool bBottomCaption = false;
if ( pt.x >= rcClient.left + rcBottomCaption.left && pt.x < rcClient.right - rcBottomCaption.right \
&& pt.y >= rcClient.bottom - rcBottomCaption.bottom && pt.y < rcClient.bottom )
bBottomCaption = true;
if( bCaption||bBottomCaption ) {
CControlUI* pControl = static_cast<CControlUI*>(GetPaintMgr()->FindControl(pt));
if (pControl)
{
if (pControl->IsClass(CControlUI::GetClassName()) ||
pControl->IsClass(CChildLayoutUI::GetClassName()) ||
pControl->IsClass(CHorizontalLayoutUI::GetClassName())||
pControl->IsClass(CTabLayoutUI::GetClassName()) ||
pControl->IsClass(CTileLayoutUI::GetClassName()) ||
pControl->IsClass(CVerticalLayoutUI::GetClassName()) ||
pControl->IsClass(CTextUI::GetClassName()) ||
pControl->IsClass(CLabelUI::GetClassName()))
{
return HTCAPTION;
}
return HTCLIENT;
}
return HTCAPTION;
}
return HTCLIENT;
}