WizardDlg.cpp
上传用户:sycq158
上传日期:2008-10-22
资源大小:15361k
文件大小:2k
源码类别:

游戏

开发平台:

Visual C++

  1. // WizardDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "Billiards.h"
  5. #include "WizardDlg.h"
  6. #include "MainFrm.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CWizardDlg dialog
  14. CWizardDlg::CWizardDlg(CWnd* pParent /*=NULL*/)
  15. : CDialog(CWizardDlg::IDD, pParent)
  16. {
  17. //{{AFX_DATA_INIT(CWizardDlg)
  18.     m_WhiteBrush=new CBrush(HS_CROSS,RGB(255,255,255));
  19. m_BlueBrush=new CBrush(HS_CROSS,RGB(200,200,255));
  20. // NOTE: the ClassWizard will add member initialization here
  21. //}}AFX_DATA_INIT
  22. }
  23. void CWizardDlg::DoDataExchange(CDataExchange* pDX)
  24. {
  25. CDialog::DoDataExchange(pDX);
  26. //{{AFX_DATA_MAP(CWizardDlg)
  27.     DDX_Control(pDX,IDC_RADIO_SERVER,m_ctlRadioServer);
  28.     DDX_Control(pDX,IDC_RADIO_CLIENT,m_ctlRadioClient);
  29.     DDX_Control(pDX,IDC_RADIO_PRACTICE,m_ctlRadioPractice);
  30. // NOTE: the ClassWizard will add DDX and DDV calls here
  31. //}}AFX_DATA_MAP
  32. }
  33. BEGIN_MESSAGE_MAP(CWizardDlg, CDialog)
  34. //{{AFX_MSG_MAP(CWizardDlg)
  35. ON_BN_CLICKED(IDC_RADIO_CLIENT, OnRadioClient)
  36. ON_BN_CLICKED(IDC_RADIO_PRACTICE, OnRadioPractice)
  37. ON_BN_CLICKED(IDC_RADIO_SERVER, OnRadioServer)
  38. ON_WM_CTLCOLOR()
  39. //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CWizardDlg message handlers
  43. void CWizardDlg::OnRadioClient() 
  44. {
  45. EndDialog(IDOK);
  46.     ((CMainFrame *)AfxGetMainWnd())->OnJoingame();
  47. }
  48. void CWizardDlg::OnRadioPractice() 
  49. {
  50.     EndDialog(IDOK);
  51. }
  52. void CWizardDlg::OnRadioServer() 
  53. {
  54. EndDialog(IDOK);
  55.     ((CMainFrame *)AfxGetMainWnd())->OnNewgame();
  56. }
  57. HBRUSH CWizardDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
  58. {
  59. HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
  60.     /*
  61.     if(nCtlColor==CTLCOLOR_DLG||nCtlColor==CTLCOLOR_STATIC||nCtlColor==CTLCOLOR_BTN){
  62.         pDC->SetBkColor(RGB(255,255,255));
  63.         return (HBRUSH)(m_WhiteBrush->GetSafeHandle());
  64.     }
  65. if(nCtlColor==CTLCOLOR_EDIT){
  66. pDC->SetBkColor(RGB(200,200,255));
  67.         return (HBRUSH)(m_BlueBrush->GetSafeHandle());
  68. }
  69.     */
  70. return hbr;
  71. }