SelBrunDevice.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. /////////////////////////////////////////////////////////////////////////////
  12. // SelBrunDevice dialog
  13. SelBrunDevice::SelBrunDevice(CWnd* pParent /*=NULL*/)
  14. : CDialog(SelBrunDevice::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(SelBrunDevice)
  17. // NOTE: the ClassWizard will add member initialization here
  18. //}}AFX_DATA_INIT
  19. m_sel=0;
  20. m_mode=0;
  21. }
  22. void SelBrunDevice::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(SelBrunDevice)
  26. DDX_Control(pDX, IDC_COMBO1, m_cbxDevices);
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(SelBrunDevice, CDialog)
  30. //{{AFX_MSG_MAP(SelBrunDevice)
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // SelBrunDevice message handlers
  35. BOOL SelBrunDevice::OnInitDialog()
  36. {
  37. CDialog::OnInitDialog();
  38. if(m_mode==1) // 选片模式;
  39. {
  40. m_cbxDevices.AddString ("修片&原片");
  41. m_cbxDevices.AddString ("修片");
  42. m_cbxDevices.AddString ("原片");
  43. SetWindowText("请选择选片照片类型");
  44. CRect rc,rc2;
  45. GetDlgItem(IDOK)->GetWindowRect(rc);
  46. GetDlgItem(IDCANCEL)->GetWindowRect(rc2);
  47. int dt=rc2.left -rc.right ;
  48. dt+=rc.Width();
  49. dt/=2;
  50. ScreenToClient(rc);
  51. rc.left +=dt;
  52. rc.right +=dt;
  53. GetDlgItem(IDOK)->MoveWindow(rc);
  54. GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE);
  55. }
  56. else // 看设计模式;
  57. {
  58. for(int i=0; i<pArray->GetSize (); i++)
  59. m_cbxDevices.AddString (pArray->ElementAt (i));
  60. }
  61. m_cbxDevices.SetCurSel (0);
  62. return TRUE;
  63. }
  64. void SelBrunDevice::OnOK()
  65. {
  66. UpdateData();
  67. m_sel = m_cbxDevices.GetCurSel ();
  68. CDialog::OnOK();
  69. }