本文整理汇总了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));
}