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.

107 lines
2.4 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1991-1996 **/
  4. /**********************************************************************/
  5. /*
  6. Welcome.cpp
  7. Property Page support for Group management wizard
  8. FILE HISTORY:
  9. jony Apr-1996 created
  10. */
  11. #include "stdafx.h"
  12. #include "Romaine.h"
  13. #include "Welcome.h"
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CWelcome property page
  21. IMPLEMENT_DYNCREATE(CWelcome, CPropertyPage)
  22. CWelcome::CWelcome() : CPropertyPage(CWelcome::IDD)
  23. {
  24. //{{AFX_DATA_INIT(CWelcome)
  25. m_nMode = 0;
  26. //}}AFX_DATA_INIT
  27. m_pApp = (CRomaineApp*)AfxGetApp();
  28. m_pFont = NULL;
  29. }
  30. CWelcome::~CWelcome()
  31. {
  32. if (m_pFont != NULL) delete m_pFont;
  33. }
  34. void CWelcome::DoDataExchange(CDataExchange* pDX)
  35. {
  36. CPropertyPage::DoDataExchange(pDX);
  37. //{{AFX_DATA_MAP(CWelcome)
  38. DDX_Radio(pDX, IDC_NEW_GROUP_RADIO, m_nMode);
  39. //}}AFX_DATA_MAP
  40. }
  41. BEGIN_MESSAGE_MAP(CWelcome, CPropertyPage)
  42. //{{AFX_MSG_MAP(CWelcome)
  43. ON_WM_SHOWWINDOW()
  44. //}}AFX_MSG_MAP
  45. END_MESSAGE_MAP()
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CWelcome message handlers
  48. LRESULT CWelcome::OnWizardNext()
  49. {
  50. UpdateData(TRUE);
  51. m_pApp->m_sMode = m_nMode;
  52. m_pApp->m_cps1.SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);
  53. if (m_nMode == 1)
  54. {
  55. m_pApp->m_csGroupName = L"";
  56. return IDD_LR_DIALOG;
  57. }
  58. else return IDD_NAME_DLG;
  59. }
  60. BOOL CWelcome::OnInitDialog()
  61. {
  62. CPropertyPage::OnInitDialog();
  63. m_pFont = new CFont;
  64. LOGFONT lf;
  65. memset(&lf, 0, sizeof(LOGFONT)); // Clear out structure.
  66. lf.lfHeight = 15;
  67. _tcscpy(lf.lfFaceName, L"MS Sans Serif");
  68. lf.lfWeight = 700;
  69. m_pFont->CreateFontIndirect(&lf); // Create the font.
  70. CString cs;
  71. cs.LoadString(IDS_WELCOME);
  72. CWnd* pWnd = GetDlgItem(IDC_WELCOME);
  73. pWnd->SetWindowText(cs);
  74. pWnd->SetFont(m_pFont);
  75. return TRUE; // return TRUE unless you set the focus to a control
  76. // EXCEPTION: OCX Property Pages should return FALSE
  77. }
  78. void CWelcome::OnShowWindow(BOOL bShow, UINT nStatus)
  79. {
  80. CPropertyPage::OnShowWindow(bShow, nStatus);
  81. if (bShow) m_pApp->m_cps1.SetWizardButtons(PSWIZB_NEXT);
  82. }