Leaked source code of windows server 2003
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.

157 lines
3.0 KiB

  1. // Copyright (c) 2001 Microsoft Corporation
  2. //
  3. // File: CYSWizardPage.cpp
  4. //
  5. // Synopsis: Defines the base class for the wizard
  6. // pages used for CYS. It is a subclass
  7. // of WizardPage found in Burnslib
  8. //
  9. // History: 02/03/2001 JeffJon Created
  10. #include "pch.h"
  11. #include "resource.h"
  12. #include "CYSWizardPage.h"
  13. CYSWizardPage::CYSWizardPage(
  14. int dialogResID,
  15. int titleResID,
  16. int subtitleResID,
  17. PCWSTR pageHelpString,
  18. bool hasHelp,
  19. bool isInteriorPage)
  20. :
  21. WizardPage(dialogResID, titleResID, subtitleResID, isInteriorPage, hasHelp)
  22. {
  23. LOG_CTOR(CYSWizardPage);
  24. if (hasHelp)
  25. {
  26. ASSERT(pageHelpString);
  27. if (pageHelpString)
  28. {
  29. helpString = pageHelpString;
  30. }
  31. }
  32. }
  33. CYSWizardPage::~CYSWizardPage()
  34. {
  35. LOG_DTOR(CYSWizardPage);
  36. }
  37. void
  38. CYSWizardPage::OnInit()
  39. {
  40. LOG_FUNCTION(CYSWizardPage::OnInit);
  41. PropertyPage::OnInit();
  42. }
  43. bool
  44. CYSWizardPage::OnWizNext()
  45. {
  46. LOG_FUNCTION(CYSWizardPage::OnWizNext);
  47. GetWizard().SetNextPageID(hwnd, Validate());
  48. return true;
  49. }
  50. /* NTRAID#NTBUG9-337325-2001/03/15-jeffjon,
  51. The cancel confirmation has been removed
  52. due to negative user feedback.
  53. */
  54. bool
  55. CYSWizardPage::OnQueryCancel()
  56. {
  57. LOG_FUNCTION(CYSWizardPage::OnQueryCancel);
  58. bool result = false;
  59. // set the rerun state to false so the wizard doesn't
  60. // just restart itself
  61. // State::GetInstance().SetRerunWizard(false);
  62. Win::SetWindowLongPtr(
  63. hwnd,
  64. DWLP_MSGRESULT,
  65. result ? TRUE : FALSE);
  66. return true;
  67. }
  68. HBRUSH
  69. CYSWizardPage::OnCtlColorDlg(
  70. HDC deviceContext,
  71. HWND /*dialog*/)
  72. {
  73. return GetBackgroundBrush(deviceContext);
  74. }
  75. HBRUSH
  76. CYSWizardPage::OnCtlColorStatic(
  77. HDC deviceContext,
  78. HWND /*dialog*/)
  79. {
  80. return GetBackgroundBrush(deviceContext);
  81. }
  82. HBRUSH
  83. CYSWizardPage::OnCtlColorEdit(
  84. HDC deviceContext,
  85. HWND /*dialog*/)
  86. {
  87. return GetBackgroundBrush(deviceContext);
  88. }
  89. HBRUSH
  90. CYSWizardPage::OnCtlColorListbox(
  91. HDC deviceContext,
  92. HWND /*dialog*/)
  93. {
  94. return GetBackgroundBrush(deviceContext);
  95. }
  96. HBRUSH
  97. CYSWizardPage::OnCtlColorScrollbar(
  98. HDC deviceContext,
  99. HWND /*dialog*/)
  100. {
  101. return GetBackgroundBrush(deviceContext);
  102. }
  103. HBRUSH
  104. CYSWizardPage::GetBackgroundBrush(HDC deviceContext)
  105. {
  106. // LOG_FUNCTION(CYSWizardPage::GetBackgroundBrush);
  107. ASSERT(deviceContext);
  108. if (deviceContext)
  109. {
  110. SetTextColor(deviceContext, GetSysColor(COLOR_WINDOWTEXT));
  111. SetBkColor(deviceContext, GetSysColor(COLOR_WINDOW));
  112. }
  113. return Win::GetSysColorBrush(COLOR_WINDOW);
  114. }
  115. bool
  116. CYSWizardPage::OnHelp()
  117. {
  118. LOG_FUNCTION(CYSWizardPage::OnHelp);
  119. // NTRAID#NTBUG9-497798-2001/11/20-JeffJon
  120. // Use null as the owner so that you can bring
  121. // CYS to the foreground. If you use the page
  122. // as the owner help will stay in the foreground.
  123. ShowHelp(GetHelpString());
  124. return true;
  125. }