SetPathDlg2.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // SetPathDlg2.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "SetPathDlg2.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // SetPathDlg2 dialog
  13. SetPathDlg2::SetPathDlg2(CWnd* pParent /*=NULL*/)
  14. : CDialog(SetPathDlg2::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(SetPathDlg2)
  17. m_server1 = _T("");
  18. m_server2 = _T("");
  19. m_server3 = _T("");
  20. m_server4 = _T("");
  21. m_server5 = _T("");
  22. //}}AFX_DATA_INIT
  23. }
  24. void SetPathDlg2::DoDataExchange(CDataExchange* pDX)
  25. {
  26. CDialog::DoDataExchange(pDX);
  27. //{{AFX_DATA_MAP(SetPathDlg2)
  28. DDX_Text(pDX, IDC_server1, m_server1);
  29. DDX_Text(pDX, IDC_server2, m_server2);
  30. DDX_Text(pDX, IDC_server3, m_server3);
  31. DDX_Text(pDX, IDC_server4, m_server4);
  32. DDX_Text(pDX, IDC_path1, m_path1);
  33. DDX_Text(pDX, IDC_path2, m_path2);
  34. DDX_Text(pDX, IDC_path3, m_path3);
  35. DDX_Text(pDX, IDC_path4, m_path4);
  36. DDX_Text(pDX, IDC_path5, m_path5);
  37. DDX_Text(pDX, IDC_server5, m_server5);
  38. //}}AFX_DATA_MAP
  39. }
  40. BEGIN_MESSAGE_MAP(SetPathDlg2, CDialog)
  41. //{{AFX_MSG_MAP(SetPathDlg2)
  42. ON_WM_CTLCOLOR()
  43. //}}AFX_MSG_MAP
  44. END_MESSAGE_MAP()
  45. /////////////////////////////////////////////////////////////////////////////
  46. // SetPathDlg2 message handlers
  47. BOOL SetPathDlg2::OnInitDialog()
  48. {
  49. CDialog::OnInitDialog();
  50. #ifdef ENTERPRISE_VERSION
  51. ((CEdit*)GetDlgItem(IDC_server1))->SetReadOnly ();
  52. #endif
  53. // TODO: Add extra initialization here
  54. g_sendhead.bsql=0;
  55. g_sendhead.code[0] = 29;
  56. g_sendhead.tabcount=1;
  57. g_pMainWnd->ProcessChatMessageRequest2(23);
  58. if(g_bSendOK==0)
  59. {
  60. CDialog::OnCancel();
  61. return 1;
  62. }
  63. CArray<CStringArray, CStringArray>patharray;
  64. DataToArray(&patharray);
  65. if(patharray.GetSize())
  66. {
  67. m_server1=patharray.ElementAt(0).ElementAt(0);
  68. if(m_server1.Find (".ly.com")==-1)m_server1.Empty ();
  69. UpdateData(false);
  70. }
  71. CenterWindow(g_pMainWnd);
  72. return false; // return TRUE unless you set the focus to a control
  73. // EXCEPTION: OCX Property Pages should return FALSE
  74. }
  75. void SetPathDlg2::OnOK()
  76. {
  77. // TODO: Add extra validation here
  78. #ifndef ENTERPRISE_VERSION
  79. UpdateData();
  80. m_server1.MakeLower ();
  81. CString sql;
  82. sql= "update path set path1='"+m_server1+"'";
  83. g_sendhead.bsql=1;
  84. g_pMainWnd->ProcessChatMessageRequest2(sql);
  85. if(g_bSendOK==0)return;
  86. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  87. #endif
  88. CDialog::OnOK();
  89. }
  90. HBRUSH SetPathDlg2::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
  91. {
  92. HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
  93. // TODO: Change any attributes of the DC here
  94. if (nCtlColor==CTLCOLOR_STATIC && pWnd->GetDlgCtrlID ()==IDC_STATIC1)
  95. {
  96. pDC-> SetBkMode(TRANSPARENT); //设置字体背景为透明
  97. return (HBRUSH)::GetStockObject(NULL_BRUSH); // 设置背景色
  98. }
  99. // TODO: Return a different brush if the default is not desired
  100. return hbr;
  101. }