SelBrunDevice.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // SelBrunDevice.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "SelBrunDevice.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. SelBrunDevice::SelBrunDevice(CWnd* pParent /*=NULL*/) : CDialog(SelBrunDevice::IDD, pParent)
  12. {
  13. m_sel=0;
  14. m_mode=0;
  15. }
  16. void SelBrunDevice::DoDataExchange(CDataExchange* pDX)
  17. {
  18. CDialog::DoDataExchange(pDX);
  19. DDX_Control(pDX, IDC_COMBO1, m_cbxDevices);
  20. }
  21. BEGIN_MESSAGE_MAP(SelBrunDevice, CDialog)
  22. END_MESSAGE_MAP()
  23. BOOL SelBrunDevice::OnInitDialog()
  24. {
  25. CDialog::OnInitDialog();
  26. if(m_mode==1) // 选片模式;
  27. {
  28. m_cbxDevices.AddString ("修片&原片");
  29. m_cbxDevices.AddString ("修片");
  30. m_cbxDevices.AddString ("原片");
  31. SetWindowText("请选择选片照片类型");
  32. CRect rc,rc2;
  33. GetDlgItem(IDOK)->GetWindowRect(rc);
  34. GetDlgItem(IDCANCEL)->GetWindowRect(rc2);
  35. int dt=rc2.left -rc.right ;
  36. dt+=rc.Width();
  37. dt/=2;
  38. ScreenToClient(rc);
  39. rc.left +=dt;
  40. rc.right +=dt;
  41. GetDlgItem(IDOK)->MoveWindow(rc);
  42. GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE);
  43. }
  44. else // 看设计模式;
  45. {
  46. for(int i=0; i<pArray->GetSize (); i++)
  47. m_cbxDevices.AddString (pArray->ElementAt (i));
  48. }
  49. m_cbxDevices.SetCurSel (0);
  50. return TRUE;
  51. }
  52. void SelBrunDevice::OnOK()
  53. {
  54. UpdateData();
  55. m_sel = m_cbxDevices.GetCurSel ();
  56. CDialog::OnOK();
  57. }