123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- // SetPathDlg2.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "SetPathDlg2.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // SetPathDlg2 dialog
- SetPathDlg2::SetPathDlg2(CWnd* pParent /*=NULL*/)
- : CDialog(SetPathDlg2::IDD, pParent)
- {
- //{{AFX_DATA_INIT(SetPathDlg2)
- m_server1 = _T("");
- m_server2 = _T("");
- m_server3 = _T("");
- m_server4 = _T("");
- m_server5 = _T("");
- //}}AFX_DATA_INIT
- }
- void SetPathDlg2::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(SetPathDlg2)
- DDX_Text(pDX, IDC_server1, m_server1);
- DDX_Text(pDX, IDC_server2, m_server2);
- DDX_Text(pDX, IDC_server3, m_server3);
- DDX_Text(pDX, IDC_server4, m_server4);
- DDX_Text(pDX, IDC_path1, m_path1);
- DDX_Text(pDX, IDC_path2, m_path2);
- DDX_Text(pDX, IDC_path3, m_path3);
- DDX_Text(pDX, IDC_path4, m_path4);
- DDX_Text(pDX, IDC_path5, m_path5);
- DDX_Text(pDX, IDC_server5, m_server5);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(SetPathDlg2, CDialog)
- //{{AFX_MSG_MAP(SetPathDlg2)
- ON_WM_CTLCOLOR()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // SetPathDlg2 message handlers
- BOOL SetPathDlg2::OnInitDialog()
- {
- CDialog::OnInitDialog();
- #ifdef ENTERPRISE_VERSION
- ((CEdit*)GetDlgItem(IDC_server1))->SetReadOnly ();
- #endif
- // TODO: Add extra initialization here
- g_sendhead.bsql=0;
- g_sendhead.code[0] = 29;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(23);
- if(g_bSendOK==0)
- {
- CDialog::OnCancel();
- return 1;
- }
- CArray<CStringArray, CStringArray>patharray;
- DataToArray(&patharray);
- if(patharray.GetSize())
- {
- m_server1=patharray.ElementAt(0).ElementAt(0);
- if(m_server1.Find (".ly.com")==-1)m_server1.Empty ();
- UpdateData(false);
- }
- CenterWindow(g_pMainWnd);
- return false; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void SetPathDlg2::OnOK()
- {
- // TODO: Add extra validation here
- #ifndef ENTERPRISE_VERSION
- UpdateData();
- m_server1.MakeLower ();
- CString sql;
- sql= "update path set path1='"+m_server1+"'";
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if(g_bSendOK==0)return;
- AfxMessageBox("保存成功!", MB_ICONINFORMATION);
- #endif
- CDialog::OnOK();
- }
- HBRUSH SetPathDlg2::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
- {
- HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
-
- // TODO: Change any attributes of the DC here
- if (nCtlColor==CTLCOLOR_STATIC && pWnd->GetDlgCtrlID ()==IDC_STATIC1)
- {
- pDC-> SetBkMode(TRANSPARENT); //设置字体背景为透明
- return (HBRUSH)::GetStockObject(NULL_BRUSH); // 设置背景色
- }
- // TODO: Return a different brush if the default is not desired
- return hbr;
- }
|