RegBasicDlg.cpp
上传用户:zslianheng
上传日期:2013-04-03
资源大小:946k
文件大小:3k
源码类别:

Linux/Unix编程

开发平台:

Visual C++

  1. /***************************************************************************
  2.  *                                                                         *
  3.  *   This program is free software; you can redistribute it and/or modify  *
  4.  *   it under the terms of the GNU General Public License as published by  *
  5.  *   the Free Software Foundation; either version 2 of the License, or     *
  6.  *   (at your option) any later version.                                   *
  7.  *                                                                         *
  8.  *   copyright            : (C) 2002 by Zhang Yong                         *
  9.  *   email                : z-yong163@163.com                              *
  10.  ***************************************************************************/
  11. // RegBasicDlg.cpp : implementation file
  12. //
  13. #include "stdafx.h"
  14. #include "myicq.h"
  15. #include "RegBasicDlg.h"
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CRegBasicDlg property page
  23. IMPLEMENT_DYNCREATE(CRegBasicDlg, CPropertyPage)
  24. CRegBasicDlg::CRegBasicDlg() : CPropertyPage(CRegBasicDlg::IDD)
  25. {
  26. //{{AFX_DATA_INIT(CRegBasicDlg)
  27. m_province = _T("");
  28. m_city = _T("");
  29. m_country = _T("");
  30. m_gender = 0;
  31. m_passwd = _T("");
  32. m_passwdAgain = _T("");
  33. m_age = 0;
  34. m_nick = _T("");
  35. m_pic = -1;
  36. //}}AFX_DATA_INIT
  37. }
  38. CRegBasicDlg::~CRegBasicDlg()
  39. {
  40. }
  41. void CRegBasicDlg::DoDataExchange(CDataExchange* pDX)
  42. {
  43. CPropertyPage::DoDataExchange(pDX);
  44. //{{AFX_DATA_MAP(CRegBasicDlg)
  45. DDX_Control(pDX, IDC_PIC, m_cmbPic);
  46. DDX_CBString(pDX, IDC_PROVINCE, m_province);
  47. DDX_Text(pDX, IDC_CITY, m_city);
  48. DDX_CBString(pDX, IDC_COUNTRY, m_country);
  49. DDX_CBIndex(pDX, IDC_GENDER, m_gender);
  50. DDX_Text(pDX, IDC_PASSWD, m_passwd);
  51. DDX_Text(pDX, IDC_PASSWD_AGAIN, m_passwdAgain);
  52. DDX_Text(pDX, IDC_AGE, m_age);
  53. DDX_Text(pDX, IDC_NICK, m_nick);
  54. DDX_CBIndex(pDX, IDC_PIC, m_pic);
  55. //}}AFX_DATA_MAP
  56. }
  57. BEGIN_MESSAGE_MAP(CRegBasicDlg, CPropertyPage)
  58. //{{AFX_MSG_MAP(CRegBasicDlg)
  59. //}}AFX_MSG_MAP
  60. END_MESSAGE_MAP()
  61. /////////////////////////////////////////////////////////////////////////////
  62. // CRegBasicDlg message handlers
  63. BOOL CRegBasicDlg::OnSetActive() 
  64. {
  65. ((CPropertySheet *) GetParent())->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);
  66. return CPropertyPage::OnSetActive();
  67. }
  68. BOOL CRegBasicDlg::OnInitDialog() 
  69. {
  70. CPropertyPage::OnInitDialog();
  71. m_cmbPic.addPics();
  72. m_cmbPic.SetCurSel(0);
  73. return TRUE;  // return TRUE unless you set the focus to a control
  74.               // EXCEPTION: OCX Property Pages should return FALSE
  75. }
  76. LRESULT CRegBasicDlg::OnWizardNext() 
  77. {
  78. if (!UpdateData())
  79. return -1;
  80. if (m_passwd.IsEmpty() || m_nick.IsEmpty()) {
  81. myMessageBox(IDS_BASICINFO_MUST_FILL, IDS_ERROR, this);
  82. return -1;
  83. }
  84. if (m_passwd.Compare(m_passwdAgain) != 0) {
  85. myMessageBox(IDS_PASSWD_MISMATCH, IDS_ERROR, this);
  86. return -1;
  87. }
  88. return CPropertyPage::OnWizardNext();
  89. }