当前位置: 首页>>代码示例>>C++>>正文


C++ CTabLayoutUI::GetPos方法代码示例

本文整理汇总了C++中CTabLayoutUI::GetPos方法的典型用法代码示例。如果您正苦于以下问题:C++ CTabLayoutUI::GetPos方法的具体用法?C++ CTabLayoutUI::GetPos怎么用?C++ CTabLayoutUI::GetPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CTabLayoutUI的用法示例。


在下文中一共展示了CTabLayoutUI::GetPos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnNcHitTest

LRESULT CZiMainFrame::OnNcHitTest(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	POINT pt; pt.x = GET_X_LPARAM(lParam); pt.y = GET_Y_LPARAM(lParam);
	::ScreenToClient(*this, &pt);

	RECT rcClient;
	::GetClientRect(*this, &rcClient);

	CControlUI* pControl = DuiControl(CControlUI, pt);
	if(pControl && 
		_tcsicmp(pControl->GetClass(), _T("ButtonUI"))   != 0 && 
		_tcsicmp(pControl->GetClass(), _T("OptionUI"))   != 0 &&
		_tcsicmp(pControl->GetClass(), _T("TextUI"))     != 0 && 
		_tcsicmp(pControl->GetClass(), _T("CheckBoxUI")) != 0 && 
		_tcsicmp(pControl->GetClass(), _T("ListUI"))     != 0 && 
		_tcsicmp(pControl->GetClass(), _T("ComboUI"))    != 0 && 
		_tcsicmp(pControl->GetClass(), _T("LabelUI"))    != 0 && 
		_tcsicmp(pControl->GetClass(), _T("EditUI"))     != 0)
	{
		// 判断是否是好友列表框中. 
		CTabLayoutUI * pTabs = DuiControl(CTabLayoutUI, _T("Tabs"));
		Assert(pTabs);

		const RECT & rcSize = pTabs->GetPos();
		if(pt.x > rcSize.left && pt.x < rcSize.right && 
			pt.y > rcSize.top && pt.y < rcSize.bottom)
		{
			return HTCLIENT;
		}

		//if(pControl) ::OutputDebugStringW(pControl->GetClass());
		return HTCAPTION;
	}

	return HTCLIENT;
}
开发者ID:yuechuanbingzhi163,项目名称:zimc,代码行数:36,代码来源:MainWindow.cpp

示例2: if

void CDuilib3dFrame::Notify(TNotifyUI& msg)
{
	CStdString strName = msg.pSender->GetName();
	if(msg.sType == _T("windowinit"))
	{
		
	}
	else if (msg.sType == _T("click"))
	{
		if (strName == _T("closebtn"))
		{
			//Close();
			m_cls.Create(m_hWnd,230,false,SW_MINIMIZE,CCloseAnimation::STYLE_CLOSE_ICON);
		}

		else if (strName == _T("scanbtn"))
		{
			CControlUI* pControl = m_PaintManager.FindControl(_T("testanibtn"));
			RECT rc = pControl->GetPos();
			rc.right = rc.left+64;
			rc.bottom = rc.top+64;
			POINT ptCenter = {rc.left+32,rc.top+32};
			POINT ptTrans = {-120,100};
			CAnimJobUI anim(0,500,ptCenter,ptTrans,1.0f,1.0f);
			anim.SetTextureFromFile(_T("../bin/skin/texture.png"));
			m_PaintManager.AddAnimJob(anim);
		}
		else if (strName == _T("common") || strName == _T("mumaoption")
			 || strName == _T("shaduoption") || strName == _T("wangdunoption")
			  || strName == _T("fdhoption") || strName == _T("rjgjoption"))
		{
			RECT rc = msg.pSender->GetPos();
			POINT ptStartCenter = {rc.left+(rc.right-rc.left)/2,rc.top+(rc.bottom-rc.top)/2};
			POINT ptTrans = {200,0};
			CAnimJobUI anim(0,500,ptStartCenter,ptTrans,1.0f,1.0f,false,false,rc,rc);
			anim.SetSpeedType(SPEED_LINEAR);
			m_PaintManager.AddAnimJob(anim);
		}
		else if (strName == _T("testanibtn"))
		{
		}
	}
	else if(msg.sType==_T("selectchanged"))
	{
		CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(_T("switch")));			
		RECT rcSrc = pControl->GetPos();
		RECT rcClip = {rcSrc.left+1,rcSrc.top+1,rcSrc.right-1,rcSrc.bottom};;
		long rcWidth = rcClip.right - rcClip.left;
		long rcHeight = rcClip.bottom - rcClip.top;
		CStdString stdString[8] = {_T("examine"),_T("trojan"),_T("plugins"),_T("vulnerability"),_T("rubbish"),_T("cleanup"),_T("fix"),_T("tool")};
		POINT ptStartCenter = {rcClip.left+rcWidth/2,rcClip.top+rcHeight/2};
		POINT ptTrans = {-rcWidth,0};

		for (int i=0;i<8;++i)
		{
			if (strName == stdString[i])
			{
				CAnimJobUI anim(0,500,ptStartCenter,ptTrans,1.0f,1.0f,true,true,rcClip,rcClip);
				m_PaintManager.AddAnimJob(anim);
				pControl->SelectItem(i);
				ptStartCenter.x += rcWidth;
				CAnimJobUI animTmp(0,500,ptStartCenter,ptTrans,1.0f,1.0f,true,true,rcClip,rcClip,WM_USER+1,pControl);				
				if (m_PaintManager.AddAnimJob(animTmp))
				{
					pControl->SetVisible(false);
				}
			}
		}
	}
	else if (msg.sType == _T("tabselect"))
	{
	}
}
开发者ID:likebeta,项目名称:code-snippets,代码行数:73,代码来源:Duilib3dFrame.cpp


注:本文中的CTabLayoutUI::GetPos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。