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.

99 lines
2.0 KiB

  1. // GetWhatPage.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "CertWiz.h"
  5. #include "GetWhatPage.h"
  6. #include "Certificat.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CGetWhatPage property page
  14. IMPLEMENT_DYNCREATE(CGetWhatPage, CIISWizardPage)
  15. CGetWhatPage::CGetWhatPage(CCertificate * pCert)
  16. : CIISWizardPage(CGetWhatPage::IDD, IDS_CERTWIZ, TRUE),
  17. m_pCert(pCert)
  18. {
  19. //{{AFX_DATA_INIT(CGetWhatPage)
  20. m_Index = -1;
  21. //}}AFX_DATA_INIT
  22. }
  23. CGetWhatPage::~CGetWhatPage()
  24. {
  25. }
  26. void CGetWhatPage::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CIISWizardPage::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(CGetWhatPage)
  30. DDX_Radio(pDX, IDC_RADIO0, m_Index);
  31. //}}AFX_DATA_MAP
  32. }
  33. BEGIN_MESSAGE_MAP(CGetWhatPage, CIISWizardPage)
  34. //{{AFX_MSG_MAP(CGetWhatPage)
  35. //}}AFX_MSG_MAP
  36. END_MESSAGE_MAP()
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CWelcomePage message handlers
  39. BOOL
  40. CGetWhatPage::OnSetActive()
  41. {
  42. m_pCert->SetStatusCode(CCertificate::REQUEST_UNDEFINED);
  43. SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);
  44. return CIISWizardPage::OnSetActive();
  45. }
  46. enum
  47. {
  48. REQUEST_NEW_CERT = 0,
  49. INSTALL_EXISTING_CERT,
  50. IMPORT_KEYRING_CERT
  51. };
  52. LRESULT
  53. CGetWhatPage::OnWizardPrev()
  54. {
  55. return IDD_PAGE_PREV;
  56. }
  57. LRESULT
  58. CGetWhatPage::OnWizardNext()
  59. {
  60. UpdateData();
  61. switch (m_Index)
  62. {
  63. case REQUEST_NEW_CERT:
  64. m_pCert->SetStatusCode(CCertificate::REQUEST_NEW_CERT);
  65. return IDD_PAGE_NEXT_NEW;
  66. case INSTALL_EXISTING_CERT:
  67. m_pCert->SetStatusCode(CCertificate::REQUEST_INSTALL_CERT);
  68. return IDD_PAGE_NEXT_EXISTING;
  69. case IMPORT_KEYRING_CERT:
  70. m_pCert->SetStatusCode(CCertificate::REQUEST_IMPORT_KEYRING);
  71. return IDD_PAGE_NEXT_IMPORT;
  72. default:
  73. ASSERT(FALSE);
  74. }
  75. return 1;
  76. }
  77. BOOL CGetWhatPage::OnInitDialog()
  78. {
  79. ASSERT(m_pCert != NULL);
  80. m_Index = 0;
  81. CIISWizardPage::OnInitDialog();
  82. GetDlgItem(IDC_RADIO0)->SetFocus();
  83. return FALSE;
  84. }