1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #include "stdafx.h"
- #include "ylgl.h"
- #include "InStock.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- InStock::InStock(CWnd* pParent )
- : CDialog(InStock::IDD, pParent)
- {
-
-
-
- }
- void InStock::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
-
- DDX_Control(pDX, IDC_LIST1, m_List1);
-
- }
- BEGIN_MESSAGE_MAP(InStock, CDialog)
-
-
- END_MESSAGE_MAP()
- BOOL InStock::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
-
- int pos=m_instock.Find (",");
- if(pos!=-1)
- {
- if(m_List1.GetCount()%2)
- m_List1.AddEntry( m_instock.Left (pos) , g_gridcol1, m_List1.GetCount());
- else
- m_List1.AddEntry( m_instock.Left (pos) , g_gridcol2, m_List1.GetCount());
- m_instock=m_instock.Right (m_instock.GetLength ()-pos-1);
- pos=m_instock.Find (",");
- while(pos!=-1)
- {
- if(m_List1.GetCount()%2)
- m_List1.AddEntry( m_instock.Left (pos) , g_gridcol1, m_List1.GetCount());
- else
- m_List1.AddEntry( m_instock.Left (pos) , g_gridcol2, m_List1.GetCount());
- m_instock=m_instock.Right (m_instock.GetLength ()-pos-1);
- pos=m_instock.Find (",");
- }
- if(m_List1.GetCount()%2)
- m_List1.AddEntry( m_instock , g_gridcol1, m_List1.GetCount());
- else
- m_List1.AddEntry( m_instock , g_gridcol2, m_List1.GetCount());
- }
- else
- {
- if(m_List1.GetCount()%2)
- m_List1.AddEntry( m_instock , g_gridcol1, m_List1.GetCount());
- else
- m_List1.AddEntry( m_instock , g_gridcol2, m_List1.GetCount());
- }
- m_List1.Invalidate ();
- return TRUE;
-
- }
|