SelProvider.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // SelProvider.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "SelProvider.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // SelProvider dialog
  13. SelProvider::SelProvider(CWnd* pParent /*=NULL*/)
  14. : CDialog(SelProvider::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(SelProvider)
  17. // NOTE: the ClassWizard will add member initialization here
  18. m_pArray=NULL;
  19. m_mode=0;
  20. //}}AFX_DATA_INIT
  21. }
  22. void SelProvider::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(SelProvider)
  26. DDX_Control(pDX, IDC_COMBOprovider, m_comboprovider);
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(SelProvider, CDialog)
  30. //{{AFX_MSG_MAP(SelProvider)
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // SelProvider message handlers
  35. BOOL SelProvider::OnInitDialog()
  36. {
  37. CDialog::OnInitDialog();
  38. // TODO: Add extra initialization here
  39. if(m_mode==1)
  40. {
  41. SetWindowText("¾°µãÑ¡Ôñ");
  42. GetDlgItem(IDC_STATIC1)->SetWindowText("¾°µã:");
  43. m_comboprovider.AddString ("È«²¿");
  44. CString temp;
  45. for(int i=0; i<m_pArray->GetSize (); i++)
  46. {
  47. temp=m_pArray->ElementAt (i);
  48. temp.TrimRight ("\\");
  49. temp=temp.Right (temp.GetLength ()-temp.ReverseFind ('\\')-1);
  50. m_comboprovider.AddString (temp);
  51. }
  52. m_comboprovider.SetCurSel (0);
  53. }
  54. else
  55. {
  56. for(int i=0; i<g_List1array.GetSize (); i++)
  57. m_comboprovider.AddString ("ÒÑ·¢"+g_List1array.ElementAt (i).ElementAt (1));
  58. }
  59. return TRUE; // return TRUE unless you set the focus to a control
  60. // EXCEPTION: OCX Property Pages should return FALSE
  61. }
  62. void SelProvider::OnOK()
  63. {
  64. // TODO: Add extra validation here
  65. int pos=m_comboprovider.GetCurSel ();
  66. if(pos==-1)return;
  67. m_comboprovider.GetLBText (pos, m_provider);
  68. CDialog::OnOK();
  69. }