Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
3.4 KiB

  1. //Copyright (c) 1997-2000 Microsoft Corporation
  2. #include "pch.hxx" // pch
  3. #pragma hdrstop
  4. #include "resource.h"
  5. #include "pgMseCur.h"
  6. CMouseCursorPg::CMouseCursorPg(
  7. LPPROPSHEETPAGE ppsp
  8. ) : WizardPage(ppsp, IDS_MSEWIZMOUSECURSORTITLE, IDS_MSEWIZMOUSECURSORSUBTITLE)
  9. {
  10. m_dwPageId = IDD_MSEWIZMOUSECURSOR;
  11. ppsp->pszTemplate = MAKEINTRESOURCE(m_dwPageId);
  12. }
  13. CMouseCursorPg::~CMouseCursorPg(
  14. VOID
  15. )
  16. {
  17. }
  18. LRESULT
  19. CMouseCursorPg::OnInitDialog(
  20. HWND hwnd,
  21. WPARAM wParam,
  22. LPARAM lParam
  23. )
  24. {
  25. HICON hIconSmallWhite = LoadIcon(g_hInstDll, MAKEINTRESOURCE(IDI_CURSOR_SMALL_WHITE));
  26. HICON hIconMediumWhite = LoadIcon(g_hInstDll, MAKEINTRESOURCE(IDI_CURSOR_MEDIUM_WHITE));
  27. HICON hIconLargeWhite = LoadIcon(g_hInstDll, MAKEINTRESOURCE(IDI_CURSOR_LARGE_WHITE));
  28. HICON hIconSmallBlack = LoadIcon(g_hInstDll, MAKEINTRESOURCE(IDI_CURSOR_SMALL_BLACK));
  29. HICON hIconMediumBlack = LoadIcon(g_hInstDll, MAKEINTRESOURCE(IDI_CURSOR_MEDIUM_BLACK));
  30. HICON hIconLargeBlack = LoadIcon(g_hInstDll, MAKEINTRESOURCE(IDI_CURSOR_LARGE_BLACK));
  31. HICON hIconSmallInverting = LoadIcon(g_hInstDll, MAKEINTRESOURCE(IDI_CURSOR_SMALL_INVERTING));
  32. HICON hIconMediumInverting = LoadIcon(g_hInstDll, MAKEINTRESOURCE(IDI_CURSOR_MEDIUM_INVERTING));
  33. HICON hIconLargeInverting = LoadIcon(g_hInstDll, MAKEINTRESOURCE(IDI_CURSOR_LARGE_INVERTING));
  34. #pragma message ("Need to destroy bitmaps in OnDestroy")
  35. SendMessage(GetDlgItem(m_hwnd, IDC_RADIO2), BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIconSmallWhite);
  36. SendMessage(GetDlgItem(m_hwnd, IDC_RADIO3), BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIconMediumWhite);
  37. SendMessage(GetDlgItem(m_hwnd, IDC_RADIO4), BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIconLargeWhite);
  38. SendMessage(GetDlgItem(m_hwnd, IDC_RADIO5), BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIconSmallBlack);
  39. SendMessage(GetDlgItem(m_hwnd, IDC_RADIO6), BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIconMediumBlack);
  40. SendMessage(GetDlgItem(m_hwnd, IDC_RADIO7), BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIconLargeBlack);
  41. SendMessage(GetDlgItem(m_hwnd, IDC_RADIO8), BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIconSmallInverting);
  42. SendMessage(GetDlgItem(m_hwnd, IDC_RADIO9), BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIconMediumInverting);
  43. SendMessage(GetDlgItem(m_hwnd, IDC_RADIO10), BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIconLargeInverting);
  44. Button_SetCheck(GetDlgItem(m_hwnd, IDC_RADIO1), TRUE);
  45. UpdateControls();
  46. return 1;
  47. }
  48. void CMouseCursorPg::UpdateControls()
  49. {
  50. // Nothing to do
  51. }
  52. LRESULT
  53. CMouseCursorPg::OnCommand(
  54. HWND hwnd,
  55. WPARAM wParam,
  56. LPARAM lParam
  57. )
  58. {
  59. LRESULT lResult = 1;
  60. WORD wNotifyCode = HIWORD(wParam);
  61. WORD wCtlID = LOWORD(wParam);
  62. HWND hwndCtl = (HWND)lParam;
  63. HCURSOR hCursor = NULL;
  64. switch(wCtlID)
  65. {
  66. case IDC_RADIO1:
  67. g_Options.m_schemePreview.m_nCursorScheme = 0;
  68. break;
  69. case IDC_RADIO2:
  70. g_Options.m_schemePreview.m_nCursorScheme = 1;
  71. break;
  72. case IDC_RADIO3:
  73. g_Options.m_schemePreview.m_nCursorScheme = 2;
  74. break;
  75. case IDC_RADIO4:
  76. g_Options.m_schemePreview.m_nCursorScheme = 3;
  77. break;
  78. case IDC_RADIO5:
  79. g_Options.m_schemePreview.m_nCursorScheme = 4;
  80. break;
  81. case IDC_RADIO6:
  82. g_Options.m_schemePreview.m_nCursorScheme = 5;
  83. break;
  84. case IDC_RADIO7:
  85. g_Options.m_schemePreview.m_nCursorScheme = 6;
  86. break;
  87. case IDC_RADIO8:
  88. g_Options.m_schemePreview.m_nCursorScheme = 7;
  89. break;
  90. case IDC_RADIO9:
  91. g_Options.m_schemePreview.m_nCursorScheme = 8;
  92. break;
  93. case IDC_RADIO10:
  94. g_Options.m_schemePreview.m_nCursorScheme = 9;
  95. break;
  96. default:
  97. break;
  98. }
  99. g_Options.ApplyPreview();
  100. return lResult;
  101. }