SelBranch.cpp 1.4 KB

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