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


C++ Render::travellingParseTree方法代码示例

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


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

示例1: WndProc


//.........这里部分代码省略.........
	
		switch (LOWORD(wParam))
		{
		case ID_EDIT:
			switch (HIWORD(wParam))
			{
			case EN_CHANGE:	//Edit 창에 키보드 입력이 들어올때마다 url 배열에 저장.
				GetWindowText(hEdit, url, sizeof(url));
				break;
			}
		}

		return 0;

	case WM_HSCROLL:
		switch (LOWORD(wParam))
		{
		case SB_LINERIGHT:
			hScrollPos = min(rMain.right, hScrollPos + 100);
			break;
		case SB_LINELEFT:
			hScrollPos = max(rMain.left, hScrollPos - 100);
			break;
		case SB_PAGELEFT:
			hScrollPos = max(rMain.left, hScrollPos - 100);
			break;
		case SB_PAGERIGHT:
			hScrollPos = min(rMain.right, hScrollPos + 100);
			break;
		}
		SetScrollPos((HWND)lParam, SB_CTL, hScrollPos, TRUE);
		RedrawWindow(hMain, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
		return 0;

	case WM_VSCROLL:
		switch (LOWORD(wParam))
		{
		case SB_LINEUP:
			vScrollPos = max(rMain.top, vScrollPos - 100);
			break;
		case SB_LINEDOWN:
			vScrollPos = min(rMain.bottom, vScrollPos + 100);
			break;
		case SB_PAGEUP:
			vScrollPos = max(rMain.top, vScrollPos - 100);
			break;
		case SB_PAGEDOWN:
			vScrollPos = min(rMain.bottom, vScrollPos + 100);
			break;
		}
		SetScrollPos((HWND)lParam, SB_CTL, vScrollPos, TRUE);
		RedrawWindow(hMain, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
		return 0;

	case WM_SETFOCUS:
		return 0;

	case WM_PAINT:

		/*if (htmlparser->getIsParsed())
		{
			htmlparser->setIsParsed(false);
			render = new Render(htmlparser->getDocumentNode(), urlparser, HWNDpool,g_hInst, hWnd);
			htmlparser->setIsParsed(false);
			render->travellingParseTree(hdc);
		}*/
		//GetClientRect(hWnd, &rMain);	//Main Window 좌표값 받아오기
		if (g_flag)
		{
			printf("render tree print\n");
			//g_flag = false;
			hdc = BeginPaint(hWnd, &ps);
			render = new Render(htmlparser->getDocumentNode(), urlparser, HWNDpool, g_hInst, hWnd);
			render->travellingParseTree(hdc);
			EndPaint(hWnd, &ps);
		}
		else
		{
			hdc = BeginPaint(hWnd, &ps);
			GetClientRect(hWnd, &rMain);	//Main Window 좌표값 받아오기
			
			TextOut(hdc, 300, 300, "Enter URL........", strlen("Enter URL........"));
			EndPaint(hWnd, &ps);
		}

		//htmlparser->setIsParsed(true);
		//Sleep(5000);
		return 0;

	case WM_DESTROY:
		Gdiplus::GdiplusShutdown(gdiplusToken);	//closeGdiplus
		SetWindowLongPtr(hEdit, GWLP_WNDPROC, (LONG_PTR)originalProc);	//close subclass
		PostQuitMessage(0);
		
		return 0;

	}

	return(DefWindowProc(hWnd, iMessage, wParam, lParam));
}
开发者ID:abelym21,项目名称:bootcamp_webbrowser,代码行数:101,代码来源:Main.cpp


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