SelWaiter2.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // SelWaiter2.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "LYFZIPManage.h"
  5. #include "SelWaiter2.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // SelWaiter2 dialog
  13. SelWaiter2::SelWaiter2(CWnd* pParent /*=NULL*/)
  14. : CDialog(SelWaiter2::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(SelWaiter2)
  17. // NOTE: the ClassWizard will add member initialization here
  18. //}}AFX_DATA_INIT
  19. }
  20. void SelWaiter2::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(SelWaiter2)
  24. DDX_Control(pDX, IDC_COMBOwaiter2, m_combowaiter2);
  25. //}}AFX_DATA_MAP
  26. }
  27. BEGIN_MESSAGE_MAP(SelWaiter2, CDialog)
  28. //{{AFX_MSG_MAP(SelWaiter2)
  29. //}}AFX_MSG_MAP
  30. END_MESSAGE_MAP()
  31. /////////////////////////////////////////////////////////////////////////////
  32. // SelWaiter2 message handlers
  33. BOOL SelWaiter2::OnInitDialog()
  34. {
  35. CDialog::OnInitDialog();
  36. // TODO: Add extra initialization here
  37. for(int i=0; i<g_userarray.GetSize (); i++)
  38. {
  39. m_combowaiter2.AddString (g_userarray.ElementAt (i).ElementAt (1));
  40. }
  41. int pos=m_combowaiter2.FindString (0, waiter2);
  42. if(pos==-1)
  43. {
  44. m_combowaiter2.InsertString (0, waiter2);
  45. m_combowaiter2.SetCurSel (0);
  46. }
  47. else
  48. m_combowaiter2.SetCurSel (pos);
  49. return TRUE; // return TRUE unless you set the focus to a control
  50. // EXCEPTION: OCX Property Pages should return FALSE
  51. }
  52. void SelWaiter2::OnOK()
  53. {
  54. // TODO: Add extra validation here
  55. int pos=m_combowaiter2.GetCurSel ();
  56. if(pos!=-1)
  57. {
  58. m_combowaiter2.GetLBText (pos, waiter2);
  59. }
  60. CDialog::OnOK();
  61. }