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


C++ Widget::SendWidMessage方法代码示例

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


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

示例1: HandleMessage

LRESULT WidDispatch::HandleMessage( UINT uMsg, WPARAM wParam, LPARAM lParam )
{
	LRESULT lResult = 1;
	Point pt(lParam);
	Widget* pWid = NULL;

	if (uMsg != WM_PAINT
		&& uMsg != WM_TIMER
		&& uMsg != WM_LBUTTONUP)

	{
		pWid = GetObject(m_h2oCaptured);
		if (pWid != NULL)
		{
			lResult = pWid->SendWidMessage(uMsg, wParam, lParam);
			return lResult;
		}
	}
	ProcessMessage(uMsg, wParam, lParam, lResult, 0);
	return lResult;
	
}
开发者ID:MartinWei,项目名称:wfc,代码行数:22,代码来源:Dispatch.cpp

示例2: ProcessMessage

BOOL WidDispatch::ProcessMessage( UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult, DWORD dwMsgMapID )
{
	Point pt(lParam);
	Widget* pWid = NULL;
	switch(uMsg)
	{
	case WM_ERASEBKGND:
		return lResult;
	case WM_PAINT:
		{
			// Handle WM_PAINT message
			Rect rcPaint;
			if( !::GetUpdateRect(m_hWnd, &rcPaint, FALSE) ) 
				return 1;
			PAINTSTRUCT ps;
			::BeginPaint(m_hWnd, &ps);
			OnPaint(ps.rcPaint);
			::EndPaint(m_hWnd, &ps);
		}
		break;
	case WM_MOUSEMOVE:
		{
			pWid = GetWidPt(pt);
			if (pWid == NULL)
			{
				pWid = GetObject(m_h2oLastMouseMove);
				if (pWid != NULL)
				{
					pWid->SendWidMessage(WM_MOUSELEAVE);
					ClearH2O(m_h2oLastMouseMove);
					return lResult;
				}
			}
			else
			{
				HWID hWidNowMouse = pWid->GetHwid();
				if (m_h2oLastMouseMove.first != hWidNowMouse)
				{
					Widget* pLastMouse = GetObject(m_h2oLastMouseMove);
					if (pLastMouse != NULL)
					{
						pLastMouse->SendWidMessage(WM_MOUSELEAVE);
					}
					SetMouseMoveH2O(std::make_pair(hWidNowMouse, pWid));
				}
				lResult = pWid->SendWidMessage(WM_MOUSEMOVE, wParam, lParam);

				return lResult;
			}
		}
		break;
	case WM_LBUTTONDOWN:
		{
			WFX_CONDITION(m_hWnd != NULL);
			::SetFocus(m_hWnd);
			pWid = GetWidPt(pt);
			if (pWid != NULL)
			{
				if (pWid->GetHwid() != m_h2oFocused.first
					&& pWid != m_h2oFocused.second)
				{
					if (m_h2oFocused.second != NULL)
					{
						m_h2oFocused.second->SendWidMessage(WM_KILLFOCUS, (WPARAM)pWid->GetHwid());
					}
					pWid->SendWidMessage(WM_SETFOCUS, (WPARAM)m_h2oFocused.first);
				}
				SetCapture(pWid);
				SetFocus(pWid);
				SetLButtonDown(pWid);
				lResult = pWid->SendWidMessage(uMsg, wParam, lParam);
			}
			else
			{
				if (m_h2oFocused.second != NULL)
				{
					m_h2oFocused.second->SendWidMessage(WM_KILLFOCUS, INVALID_HWID);
				}
			}
		}
		break;
	case  WM_LBUTTONUP:
		{
			pWid = GetObject(m_h2oCaptured);
			if (pWid == NULL)
			{
				pWid = GetWidPt(pt);
			}
			if (m_h2oCaptured.first != INVALID_HWID)
			{
				ReleaseCapture();
				ClearH2O(m_h2oCaptured);
			}
			if (pWid != NULL)
			{
				lResult = pWid->SendWidMessage(uMsg,  wParam, lParam);
				Widget* pLastMM = GetObject(m_h2oLastMouseMove);
				if (pLastMM != NULL)
				{
					pLastMM->SendWidMessage(WM_MOUSELEAVE);
//.........这里部分代码省略.........
开发者ID:MartinWei,项目名称:wfc,代码行数:101,代码来源:Dispatch.cpp


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