void CMembersView::OnPrint() { enum { NUM_PRT_COLUMNS = 7 }; GridColumn aColumns[NUM_PRT_COLUMNS] = { { TXT("Name"), 30, LVCFMT_LEFT, 0, true }, { TXT("Phone #1"), 20, LVCFMT_LEFT, CMembers::STANDARD_PHONE, true }, { TXT("Phone #2"), 20, LVCFMT_LEFT, CMembers::ALTERNATE_PHONE, true }, // { TXT("Address"), 20, LVCFMT_LEFT, CMembers::POSTAL_ADDRESS, false }, // { TXT("Email"), 20, LVCFMT_LEFT, CMembers::EMAIL_ADDRESS, false }, { TXT("Registered?"), 10, LVCFMT_LEFT, CMembers::IS_REGISTERED, true }, { TXT("Senior?"), 10, LVCFMT_LEFT, CMembers::IS_SENIOR, true }, { TXT("Available?"), 10, LVCFMT_LEFT, CMembers::IS_AVAILABLE, true }, { TXT("£ Balance"), 10, LVCFMT_LEFT, CMembers::BALANCE, true } }; PrintView(TXT("Members"), NUM_PRT_COLUMNS, aColumns); }
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; switch (message) { case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); break; case IDM_EXIT: DestroyWindow(hWnd); break; case IDM_PRINT: PrintView(hWnd, message, wParam, lParam); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_DESTROY: PostQuitMessage(0); break; case WM_SIZE: if (!gWebView) break; resizeSubViews(); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; }
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { WNDPROC parentProc = (gWinLauncher) ? (gWinLauncher->usesLayeredWebView() ? DefWebKitProc : DefWindowProc) : DefWindowProc; switch (message) { case WM_NCHITTEST: if (gWinLauncher && gWinLauncher->usesLayeredWebView()) { RECT window; ::GetWindowRect(hWnd, &window); // For testing our transparent window, we need a region to use as a handle for // dragging. The right way to do this would be to query the web view to see what's // under the mouse. However, for testing purposes we just use an arbitrary // 30 pixel band at the top of the view as an arbitrary gripping location. // // When we are within this bad, return HT_CAPTION to tell Windows we want to // treat this region as if it were the title bar on a normal window. int y = HIWORD(lParam); if ((y > window.top) && (y < window.top + dragBarHeight)) return HTCAPTION; } return CallWindowProc(parentProc, hWnd, message, wParam, lParam); case WM_COMMAND: { int wmId = LOWORD(wParam); int wmEvent = HIWORD(wParam); if (wmId >= IDM_HISTORY_LINK0 && wmId <= IDM_HISTORY_LINK9) { if (gWinLauncher) gWinLauncher->navigateToHistory(hWnd, wmId); break; } // Parse the menu selections: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); break; case IDM_EXIT: DestroyWindow(hWnd); break; case IDM_PRINT: PrintView(hWnd, message, wParam, lParam); break; case IDM_WEB_INSPECTOR: if (gWinLauncher) gWinLauncher->launchInspector(); break; case IDM_CACHES: if (!::IsWindow(hCacheWnd)) { hCacheWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_CACHES), hWnd, Caches); ::ShowWindow(hCacheWnd, SW_SHOW); } break; case IDM_HISTORY_BACKWARD: case IDM_HISTORY_FORWARD: if (gWinLauncher) gWinLauncher->navigateForwardOrBackward(hWnd, wmId); break; case IDM_AVFOUNDATION: case IDM_ACC_COMPOSITING: case IDM_WK_FULLSCREEN: case IDM_COMPOSITING_BORDERS: case IDM_DISABLE_IMAGES: case IDM_DISABLE_STYLES: case IDM_DISABLE_JAVASCRIPT: case IDM_DISABLE_LOCAL_FILE_RESTRICTIONS: ToggleMenuItem(hWnd, wmId); break; default: return CallWindowProc(parentProc, hWnd, message, wParam, lParam); } } break; case WM_DESTROY: #if USE(CF) CFRunLoopStop(CFRunLoopGetMain()); #endif PostQuitMessage(0); break; case WM_SIZE: if (!gWinLauncher || !gWinLauncher->hasWebView() || gWinLauncher->usesLayeredWebView()) return CallWindowProc(parentProc, hWnd, message, wParam, lParam); resizeSubViews(); break; default: return CallWindowProc(parentProc, hWnd, message, wParam, lParam); } return 0; }