11.07.2015 Views

QP and Win32 - Quantum Leaps

QP and Win32 - Quantum Leaps

QP and Win32 - Quantum Leaps

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Application Note:<strong>QP</strong>/QM <strong>and</strong> <strong>Win32</strong> (Windows)state-machine.com/win32}/* comm<strong>and</strong>s from regular buttons <strong>and</strong> menus... */(11) case WM_COMMAND: {SetFocus(hWnd);switch (wParam) {case IDOK:case IDCANCEL: {BSP_terminate(0);break;}}return 0;}/* owner-drawn buttons... */(12) case WM_DRAWITEM: {(13) LPDRAWITEMSTRUCT pdis = (LPDRAWITEMSTRUCT)lParam;(14) switch (pdis->CtlID) {(15) case IDC_USER: { /* USER owner-drawn button */(16) switch (OwnerDrawnButton_draw(&l_userBtn, pdis)) {(17) case BTN_DEPRESSED: {BSP_playerTrigger();SegmentDisplay_setSegment(&l_userLED, 0U, 1U);break;}(18) case BTN_RELEASED: {SegmentDisplay_setSegment(&l_userLED, 0U, 0U);break;}}break;}}return 0;}/* mouse input... */(19) case WM_MOUSEWHEEL: {if ((HIWORD(wParam) & 0x8000U) == 0U) {/* wheel turned forward? */BSP_moveShipUp();}else { /* the wheel was turned backwards */BSP_moveShipDown();}return 0;}/* keyboard input... */(20) case WM_KEYDOWN: {switch (wParam) {case VK_UP:BSP_moveShipUp();break;case VK_DOWN:BSP_moveShipDown();Copyright © <strong>Quantum</strong> <strong>Leaps</strong>, LLC. All Rights Reserved.31 of 42

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!