// SPBox.cpp : implementation file // #include "stdafx.h" #include "LYFZIPManage.h" #include "SPBox.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // SPBox dialog SPBox::SPBox(CWnd* pParent /*=NULL*/) : CDialog(SPBox::IDD, pParent) { //{{AFX_DATA_INIT(SPBox) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_mode=0; } void SPBox::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(SPBox) DDX_Control(pDX, IDC_LIST2, m_List1); DDX_Control(pDX, IDC_COMBOsplb, m_combosplb); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(SPBox, CDialog) //{{AFX_MSG_MAP(SPBox) ON_CBN_SELCHANGE(IDC_COMBOsplb, OnSelchangeCOMBOsplb) ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // SPBox message handlers BOOL SPBox::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_List1.SetHeadings( "编号,50;商品名称,150;销售价,80" ); m_List1.LoadColumnInfo (103); g_sendhead.bsql=0; g_sendhead.code[0]=8; g_sendhead.code[1]=2; g_sendhead.tabcount=2; g_pMainWnd->ProcessChatMessageRequest2(2);if(g_bSendOK==0)return 1; DataToArray(&m_List1array,&m_List2array); for(int i=0; iCenterWindow (g_pMainWnd); m_combosplb.SetFocus(); return false; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void SPBox::OnCancel() { // TODO: Add extra cleanup here CDialog::OnCancel(); } void SPBox::OnOK() { // TODO: Add extra validation here if(m_mode==0) { POSITION pos; pos=m_List1.GetFirstSelectedItemPosition(); if(pos==NULL) { AfxMessageBox("请先选中一个商品!"); return; } int iItem=m_List1.GetNextSelectedItem(pos); m_spid=m_List1.GetItemText (iItem, 0); m_spname=m_List1.GetItemText (iItem, 1); } CDialog::OnOK(); } void SPBox::OnSelchangeCOMBOsplb() { // TODO: Add your control notification handler code here int pos=m_combosplb.GetCurSel (); if(pos==-1)return; CString str; m_combosplb.GetLBText (pos, str); FillGrid(str); } void SPBox::FillGrid(CString str) { m_List1.DeleteAllItems2 (); int ii=0; m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 ); int count=0; for(ii=0; ii