// opexectdcesptseldlg.cpp : implementation file // #include "stdafx.h" #include "geomative.h" #include "opexectdcesptseldlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // COpExecTdCESptSelDlg dialog COpExecTdCESptSelDlg::COpExecTdCESptSelDlg(CWnd* pParent /*=NULL*/) : CDialog(COpExecTdCESptSelDlg::IDD, pParent) { //{{AFX_DATA_INIT(COpExecTdCESptSelDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void COpExecTdCESptSelDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(COpExecTdCESptSelDlg) DDX_Control(pDX, IDC_TD_CESPT, m_ceSptList); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(COpExecTdCESptSelDlg, CDialog) //{{AFX_MSG_MAP(COpExecTdCESptSelDlg) ON_WM_SIZE() ON_WM_CANCELMODE() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // COpExecTdCESptSelDlg message handlers BOOL COpExecTdCESptSelDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here CString strColTitle; int iColIndex = (int)VAL_ZERO; m_ceSptList.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP | LVS_EX_ONECLICKACTIVATE | LVS_EX_GRIDLINES); strColTitle.Empty(); strColTitle.LoadString(IDS_DB_SCON_CN); m_ceSptList.InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 150); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_SCON_SNAME); m_ceSptList.InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 150); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_SCON_EAMOUNT); m_ceSptList.InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 110); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_SCON_TPAMOUNT); m_ceSptList.InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 90); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_SCON_DEFINER); m_ceSptList.InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 120); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_SCON_DEDATE); m_ceSptList.InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 120); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_SCON_DESC); m_ceSptList.InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 150); //调整m_ceSptList控件的大小 CRect rect; GetClientRect(&rect); if (m_ceSptList) { m_ceSptList.MoveWindow(rect); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } BOOL COpExecTdCESptSelDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_RETURN) { return TRUE; } if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_ESCAPE) { return TRUE; } return CDialog::PreTranslateMessage(pMsg); } void COpExecTdCESptSelDlg::OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy); // TODO: Add your message handler code here CRect rect; GetClientRect(&rect); if (m_ceSptList) { m_ceSptList.MoveWindow(rect); } } void COpExecTdCESptSelDlg::OnCancelMode() { CDialog::OnCancelMode(); // TODO: Add your message handler code here }