本文整理汇总了C++中Viewer::HandleKeyDown方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewer::HandleKeyDown方法的具体用法?C++ Viewer::HandleKeyDown怎么用?C++ Viewer::HandleKeyDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewer
的用法示例。
在下文中一共展示了Viewer::HandleKeyDown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WndProcViewer
//.........这里部分代码省略.........
globals.vsize=TWPNG_VS_1;
v->CalcStretchedSize();
InvalidateRect(hwnd,NULL,0);
}
return 0;
case WM_LBUTTONDOWN:
if(v->m_dragging) return 0;
if(!v->m_dib) return 0;
SetCapture(hwnd);
SetCursor(globals.hcurDrag2);
pts = MAKEPOINTS(lParam);
v->m_dragstart_x = v->m_imgpos_x - pts.x;
v->m_dragstart_y = v->m_imgpos_y - pts.y;
v->m_dragging = 1;
return 0;
case WM_LBUTTONUP:
SetCapture(NULL);
v->m_dragging=0;
return 0;
case WM_MOUSEMOVE:
if(v->m_dragging) {
pts = MAKEPOINTS(lParam);
v->m_imgpos_x = v->m_dragstart_x + pts.x;
v->m_imgpos_y = v->m_dragstart_y + pts.y;
InvalidateRect(hwnd,NULL,TRUE);
}
return 0;
case WM_KEYDOWN:
if(v->HandleKeyDown(hwnd,wParam,lParam)) {
return 0;
}
break;
case WM_CLOSE: // The user clicked the [x] for the window.
globals.autoopen_viewer=0;
break; // DefWindowProc will send a WM_DESTROY message
case WM_COMMAND:
id=LOWORD(wParam);
switch(id) {
case ID_CLOSE:
globals.autoopen_viewer=0;
DestroyWindow(hwnd);
return 0;
case ID_COPYIMAGE:
v->CopyImage();
return 0;
case ID_GAMMACORRECT:
globals.use_gamma = !globals.use_gamma;
v->UpdateViewerWindowTitle();
update_viewer();
return 0;
case ID_CORRECTNONSQUARE:
globals.viewer_correct_nonsquare = !globals.viewer_correct_nonsquare;
update_viewer();
return 0;
case ID_BG_CUSTOM:
globals.use_imagebg = 0;
globals.use_custombg = 1;
v->UpdateViewerWindowTitle();
update_viewer();