// outsourcingDlg2.cpp : implementation file // #include "stdafx.h" #include "LYFZIPManage.h" #include "outsourcingDlg2.h" #include "SelProvider.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // outsourcingDlg2 outsourcingDlg2::outsourcingDlg2(CWnd* pParent /*=NULL*/) : CDialog(outsourcingDlg2::IDD) { //{{AFX_DATA_INIT(outsourcingDlg2)IDC_COMBOid m_name1 = _T(""); m_name2 = _T(""); m_id = _T(""); m_money1 = _T(""); m_money2 = _T(""); m_money3 = _T(""); //}}AFX_DATA_INIT } void outsourcingDlg2::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(outsourcingDlg2) DDX_Control(pDX, IDC_LIST1, m_List1); DDX_Text(pDX, IDC_EDITname1, m_name1); DDX_Text(pDX, IDC_EDITname2, m_name2); DDX_Text(pDX, IDC_EDITid2, m_id); DDX_Text(pDX, IDC_EDITmoney1, m_money1); DDX_Text(pDX, IDC_EDITmoney2, m_money2); DDX_Text(pDX, IDC_EDITmoney3, m_money3); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(outsourcingDlg2, CDialog) //{{AFX_MSG_MAP(outsourcingDlg2) ON_BN_CLICKED(IDC_BUTclose, OnBUTclose) ON_BN_CLICKED(IDC_BUTTON1, OnButton1) ON_BN_CLICKED(IDC_BUTTON2, OnButton2) ON_BN_CLICKED(IDC_BUTget, OnBUTget) ON_BN_CLICKED(IDC_BUTTON3, OnButton3) ON_BN_CLICKED(IDC_BUTTON4, OnButton4) ON_WM_TIMER() ON_BN_CLICKED(IDC_BTNdel, OnBTNdel) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // outsourcingDlg2 diagnostics ///////////////////////////////////////////////////////////////////////////// // outsourcingDlg2 message handlers BOOL outsourcingDlg2::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if(pMsg->message==WM_LBUTTONDBLCLK) {//list1 CPoint pt; CRect rc,rc2; ::GetCursorPos (&pt); m_List1.GetWindowRect (rc2); if(rc2.PtInRect (pt)==0) return CDialog::PreTranslateMessage(pMsg); pt.x-=rc2.left ; pt.y-=rc2.top ; int iItem=m_List1.GetItemCount ()-1; if(iItem<0) { m_List1.GetHeaderCtrl()->GetItemRect (0, rc); int hei=rc.Height (); rc.top +=hei; rc.bottom +=hei; if(rc.PtInRect (pt)) { m_List1.InsertItem(m_List1.GetItemCount (), ""); } m_List1.GetHeaderCtrl()->GetItemRect (1, rc); rc.top +=hei; rc.bottom +=hei; if(rc.PtInRect (pt)) { m_List1.InsertItem(m_List1.GetItemCount (), ""); } UpdateZ(); } else { m_List1.GetSubItemRect( iItem, 0, LVIR_BOUNDS, rc); int hei=rc.Height (); rc.top +=hei; rc.bottom +=hei; if(rc.PtInRect (pt)) { if(m_List1.GetItemText (iItem, 0).IsEmpty ()) return CDialog::PreTranslateMessage(pMsg); m_List1.InsertItem(m_List1.GetItemCount (), ""); UpdateZ(); } } } return CDialog::PreTranslateMessage(pMsg); } void outsourcingDlg2::OnBUTclose() { // TODO: Add your control notification handler code here CDialog::OnCancel (); } void outsourcingDlg2::GetData() { // TODO: Add your control notification handler code here CString filter="id='"+m_id+"';"; g_sendhead.code[0]=36; g_sendhead.code[1]=9; g_sendhead.tabcount=2; g_sendhead.bsql=0; g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return; DataToArray(&m_sparray,&g_List1array); m_List1.DeleteAllItems (); for(int i=0; iProcessChatMessageRequest2(pData2, length); g_nSendCode=0; delete []pData2; if(g_bSendOK==0)return; AfxMessageBox("保存成功!", MB_ICONINFORMATION); CDialog::OnOK(); } void outsourcingDlg2::OnButton1() { // TODO: Add your control notification handler code here SelProvider dlg; if(dlg.DoModal ()!=IDOK)return; for(int i=0; iSetWindowText( str); }