// SelBrunDevice.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "SelBrunDevice.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif SelBrunDevice::SelBrunDevice(CWnd* pParent /*=NULL*/) : CDialog(SelBrunDevice::IDD, pParent) { m_sel=0; m_mode=0; } void SelBrunDevice::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_COMBO1, m_cbxDevices); } BEGIN_MESSAGE_MAP(SelBrunDevice, CDialog) END_MESSAGE_MAP() BOOL SelBrunDevice::OnInitDialog() { CDialog::OnInitDialog(); if(m_mode==1) // 选片模式; { m_cbxDevices.AddString ("修片"); m_cbxDevices.AddString ("原片"); int bSelPhoto = AfxGetApp()->GetProfileInt (LYFZVERSION, "SelPhotoModel", 0); if(bSelPhoto) m_cbxDevices.AddString ("修片&原片"); SetWindowText("请选择选片照片类型"); CRect rc,rc2; GetDlgItem(IDOK)->GetWindowRect(rc); GetDlgItem(IDCANCEL)->GetWindowRect(rc2); int dt=rc2.left -rc.right ; dt+=rc.Width(); dt/=2; ScreenToClient(rc); rc.left +=dt; rc.right +=dt; GetDlgItem(IDOK)->MoveWindow(rc); GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE); } else // 看设计模式; { for(int i=0; iGetSize (); i++) m_cbxDevices.AddString (pArray->ElementAt (i)); } m_cbxDevices.SetCurSel (0); return TRUE; } void SelBrunDevice::OnOK() { UpdateData(); m_sel = m_cbxDevices.GetCurSel (); CDialog::OnOK(); }