コード例 #1
0
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;
}
コード例 #2
0
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"))
	{
	}
}