UserTypeDlg.cpp
上传用户:yffx2008
上传日期:2014-10-12
资源大小:12414k
文件大小:2k
源码类别:

交通/航空行业

开发平台:

Visual C++

  1. // UserTypeDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "GpsSC.h"
  5. #include "UserTypeDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CUserTypeDlg dialog
  13. CUserTypeDlg::CUserTypeDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(CUserTypeDlg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CUserTypeDlg)
  17. m_nType = -1;
  18. m_nNormalUser = -1;
  19. //}}AFX_DATA_INIT
  20. m_nUserType = 0;
  21. }
  22. CUserTypeDlg::CUserTypeDlg(int nUserType,CWnd* pParent)
  23.   :CDialog(CUserTypeDlg::IDD, pParent)
  24. {
  25. m_nUserType = nUserType;
  26. }
  27. void CUserTypeDlg::DoDataExchange(CDataExchange* pDX)
  28. {
  29. CDialog::DoDataExchange(pDX);
  30. //{{AFX_DATA_MAP(CUserTypeDlg)
  31. DDX_Control(pDX, IDC_NORMALUSER, m_ctlNormalUser);
  32. DDX_Control(pDX, IDC_CENTER, m_ctlCenter);
  33. DDX_Radio(pDX, IDC_CENTER, m_nType);
  34. DDX_Radio(pDX, IDC_NORMALUSER, m_nNormalUser);
  35. //}}AFX_DATA_MAP
  36. }
  37. BEGIN_MESSAGE_MAP(CUserTypeDlg, CDialog)
  38. //{{AFX_MSG_MAP(CUserTypeDlg)
  39. ON_BN_CLICKED(IDC_CENTER, OnCenter)
  40. ON_BN_CLICKED(IDC_NORMALUSER, OnNormaluser)
  41. //}}AFX_MSG_MAP
  42. END_MESSAGE_MAP()
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CUserTypeDlg message handlers
  45. BOOL CUserTypeDlg::OnInitDialog() 
  46. {
  47. CDialog::OnInitDialog();
  48. // TODO: Add extra initialization here
  49. if(m_nUserType == 0) {
  50. m_ctlCenter.SetCheck(1);
  51. }
  52. else if(m_nUserType == 1) {
  53. m_ctlNormalUser.SetCheck(1);
  54. }
  55. return TRUE;  // return TRUE unless you set the focus to a control
  56.               // EXCEPTION: OCX Property Pages should return FALSE
  57. }
  58. void CUserTypeDlg::OnCenter() 
  59. {
  60. // TODO: Add your control notification handler code here
  61. m_nUserType = 0;
  62. m_ctlNormalUser.SetCheck(0);
  63. m_ctlCenter.SetCheck(1);
  64. }
  65. void CUserTypeDlg::OnNormaluser() 
  66. {
  67. // TODO: Add your control notification handler code here
  68. m_nUserType = 1;
  69. m_ctlCenter.SetCheck(0);
  70. m_ctlNormalUser.SetCheck(1);
  71. }