// DinDanForm2.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "DinDanForm2.h" #include "DinDanForm.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // DinDanForm2 dialog DinDanForm2::DinDanForm2(CWnd* pParent /*=NULL*/) : CDialog(DinDanForm2::IDD, pParent) { //{{AFX_DATA_INIT(DinDanForm2) m_radio1 = 0; //}}AFX_DATA_INIT } void DinDanForm2::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(DinDanForm2) DDX_Control(pDX, IDC_LIST5, m_List2); DDX_Control(pDX, IDC_LIST1, m_List1); DDX_Radio(pDX, IDC_RADIO1, m_radio1); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(DinDanForm2, CDialog) //{{AFX_MSG_MAP(DinDanForm2) ON_LBN_SELCHANGE(IDC_LIST1, OnSelchangeList1) ON_BN_CLICKED(IDC_RADIO2, OnRadio2) ON_BN_CLICKED(IDC_RADIO1, OnRadio1) ON_LBN_SELCHANGE(IDC_LIST5, OnSelchangeList5) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // DinDanForm2 message handlers void DinDanForm2::Init() { CRect rc; GetDlgItem(IDC_RADIO1)->GetWindowRect(rc); ScreenToClient(rc); rc.left=5; GetDlgItem(IDC_RADIO1)->MoveWindow(rc); int botoom=rc.bottom; GetClientRect(rc); rc.left+=5; rc.top=botoom+5; rc.right-=5; rc.bottom-=5; m_List1.MoveWindow(rc); m_rc=rc; m_List1.GetWindowRect(rc); ScreenToClient(rc); int hei=rc.Height()/2; rc.bottom-=hei; m_List1.MoveWindow(rc); rc.top=rc.bottom; rc.bottom+=hei; m_List2.MoveWindow(rc); } void DinDanForm2::TypeChange(CStringArray *pArray) { m_array.Copy(*pArray); m_List1.ResetContent(); for(int i=0; iGetSize(); i++) { m_List1.AddString(pArray->ElementAt(i)); if(i<10) m_List1.SetSel(i); }m_radio1 = 0;UpdateData(0); FilterChange(); } void DinDanForm2::TypeChange2(CStringArray *pArray) { m_List2.ResetContent(); for(int i=0; iGetSize(); i++) { m_List2.AddString(pArray->ElementAt(i)); if(i<1) m_List2.SetSel(i); } } void DinDanForm2::FilterChange() { m_pfilterarray->RemoveAll(); int count= m_List1.GetSelCount() ; if(count==0)return; if(count>10) { for(int i=0; iAdd (str); } delete []pIndex; if(m_pfilterarray2->GetSize()==0) m_pfilterarray2->Add("全部(前期+二销)"); ((DinDanForm*)m_parent)->KindChange(); } void DinDanForm2::OnSelchangeList1() { // TODO: Add your control notification handler code here FilterChange(); } void DinDanForm2::OnRadio2() { // TODO: Add your control notification handler code here UpdateData(); m_List1.ResetContent(); if(m_radio1==0) { for(int i=0; i=0; i--) { m_List1.AddString(m_array.ElementAt(i)); if(i>=m_array.GetSize()-10) m_List1.SetSel(m_array.GetSize()-1-i); } } FilterChange(); } void DinDanForm2::OnRadio1() { // TODO: Add your control notification handler code here OnRadio2(); } void DinDanForm2::OnSelchangeList5() { // TODO: Add your control notification handler code here m_pfilterarray2->RemoveAll(); CString str; int pos=m_List2.GetCurSel(); if(pos!=-1 && m_List2.GetSel(pos) ) { m_List2.GetText (pos, str); if(str=="预约收款" || str=="预约补款") { m_List2.SetSel(0, 0); m_List2.SetSel(1, 0); } if(str!="预约收款" && str!="预约补款" && pos>2) { m_List2.SetSel(0, 0); m_List2.SetSel(2, 0); } if(pos==1 || pos==2) { m_List2.SetSel(0, 0); } } BOOL bAll=0; BOOL bAll1=0; BOOL bAll2=0; if(m_List2.GetSel(0))bAll=1; if(m_List2.GetSel(1))bAll1=1; if(m_List2.GetSel(2))bAll2=1; if(bAll) { for(int i=1; iAdd (str); } delete []pIndex; m_pfilterarray->RemoveAll(); ((DinDanForm*)m_parent)->KindChange(); } void DinDanForm2::ModeChange(int mode) { if(mode==0||mode==1||mode==8) { ShowWindow(SW_SHOW); m_List2.ShowWindow(SW_HIDE); m_List1.MoveWindow(m_rc); } else if(mode==7) { CRect rc=m_rc; int hei=rc.Height()/2; rc.bottom-=hei; m_List1.MoveWindow(rc); rc.top=rc.bottom; rc.bottom+=hei; m_List2.MoveWindow(rc); ShowWindow(SW_SHOW); m_List2.ShowWindow(SW_SHOW); } else ShowWindow(SW_HIDE); }