// opexec2drsptesttdlistview.cpp : implementation file // #include "stdafx.h" #include "geomative.h" #include "opexec2drsptesttdlistview.h" #include "Constant.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif extern int g_iCurrListColIndex; extern int g_iCurrListColOrder; extern int CALLBACK ListStrCompare(LPARAM lParam1, LPARAM lParam2, LPARAM lSortObject); extern BOOL DoEvent(HWND hWnd); ///////////////////////////////////////////////////////////////////////////// // COpExec2DRSPTestTdListView IMPLEMENT_DYNCREATE(COpExec2DRSPTestTdListView, CListView) COpExec2DRSPTestTdListView::COpExec2DRSPTestTdListView() { } COpExec2DRSPTestTdListView::~COpExec2DRSPTestTdListView() { } BEGIN_MESSAGE_MAP(COpExec2DRSPTestTdListView, CListView) //{{AFX_MSG_MAP(COpExec2DRSPTestTdListView) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // COpExec2DRSPTestTdListView drawing void COpExec2DRSPTestTdListView::OnDraw(CDC* pDC) { CDocument* pDoc = GetDocument(); // TODO: add draw code here } ///////////////////////////////////////////////////////////////////////////// // COpExec2DRSPTestTdListView diagnostics #ifdef _DEBUG void COpExec2DRSPTestTdListView::AssertValid() const { CListView::AssertValid(); } void COpExec2DRSPTestTdListView::Dump(CDumpContext& dc) const { CListView::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // COpExec2DRSPTestTdListView message handlers void COpExec2DRSPTestTdListView::OnInitialUpdate() { CListView::OnInitialUpdate(); // TODO: Add your specialized code here and/or call the base class CString strColTitle; LVCOLUMN lvCol; int iColIndex = (int)VAL_ZERO; lvCol.mask = LVCF_FMT; lvCol.fmt = LVCFMT_RIGHT; GetListCtrl().SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP | LVS_EX_ONECLICKACTIVATE | LVS_EX_GRIDLINES); g_iCurrListColIndex = (int)VAL_ZERO; g_iCurrListColOrder = (int)VAL_ZERO; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_TD2DCON_TSN); GetListCtrl().InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 60); GetListCtrl().SetColumn(iColIndex, &lvCol); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_TD2DCON_C1); GetListCtrl().InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 60); GetListCtrl().SetColumn(iColIndex, &lvCol); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_TD2DCON_C2); GetListCtrl().InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 60); GetListCtrl().SetColumn(iColIndex, &lvCol); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_TD2DCON_P1); GetListCtrl().InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 60); GetListCtrl().SetColumn(iColIndex, &lvCol); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_TD2DCON_P2); GetListCtrl().InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 60); GetListCtrl().SetColumn(iColIndex, &lvCol); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_TD2DCON_N); GetListCtrl().InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 60); GetListCtrl().SetColumn(iColIndex, &lvCol); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_TD2DCON_K); GetListCtrl().InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 120); GetListCtrl().SetColumn(iColIndex, &lvCol); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_TD2DCON_I); GetListCtrl().InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 120); GetListCtrl().SetColumn(iColIndex, &lvCol); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_TD2DCON_V); GetListCtrl().InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 120); GetListCtrl().SetColumn(iColIndex, &lvCol); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_TD2DCON_R0); GetListCtrl().InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 120); GetListCtrl().SetColumn(iColIndex, &lvCol); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_DB_TD2DCON_SP); GetListCtrl().InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 120); GetListCtrl().SetColumn(iColIndex, &lvCol); } BOOL COpExec2DRSPTestTdListView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Add your specialized code here and/or call the base class cs.style &= ~LVS_TYPEMASK; cs.style |= LVS_REPORT | LVS_SINGLESEL; return CListView::PreCreateWindow(cs); }