310 lines
8.1 KiB
C++
310 lines
8.1 KiB
C++
// AppMarineTdDetailListView.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "geomative.h"
|
|
#include "AppMarineTdDetailListView.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CAppMarineTdDetailListView
|
|
|
|
IMPLEMENT_DYNCREATE(CAppMarineTdDetailListView, CListView)
|
|
|
|
extern int g_UIOffset;
|
|
CAppMarineTdDetailListView::CAppMarineTdDetailListView()
|
|
{
|
|
m_pDetailList = NULL;
|
|
m_pMngFrm = NULL;
|
|
}
|
|
|
|
CAppMarineTdDetailListView::~CAppMarineTdDetailListView()
|
|
{
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CAppMarineTdDetailListView, CListView)
|
|
//{{AFX_MSG_MAP(CAppMarineTdDetailListView)
|
|
// NOTE - the ClassWizard will add and remove mapping macros here.
|
|
ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomdrawDetailList)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CAppMarineTdDetailListView drawing
|
|
|
|
void CAppMarineTdDetailListView::OnDraw(CDC* pDC)
|
|
{
|
|
CDocument* pDoc = GetDocument();
|
|
// TODO: add draw code here
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CAppMarineTdDetailListView diagnostics
|
|
|
|
#ifdef _DEBUG
|
|
void CAppMarineTdDetailListView::AssertValid() const
|
|
{
|
|
CListView::AssertValid();
|
|
}
|
|
|
|
void CAppMarineTdDetailListView::Dump(CDumpContext& dc) const
|
|
{
|
|
CListView::Dump(dc);
|
|
}
|
|
#endif //_DEBUG
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CAppMarineTdDetailListView message handlers
|
|
|
|
void CAppMarineTdDetailListView::OnCustomdrawDetailList (NMHDR* pNMHDR, LRESULT* pResult)
|
|
{
|
|
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
|
|
|
|
*pResult = CDRF_DODEFAULT;
|
|
|
|
if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
|
|
{
|
|
*pResult = CDRF_NOTIFYITEMDRAW;
|
|
}
|
|
else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
|
|
{
|
|
*pResult = CDRF_NOTIFYSUBITEMDRAW;
|
|
}
|
|
else if ((CDDS_ITEMPREPAINT | CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage)
|
|
{
|
|
COLORREF clrNewTextColor, clrNewBkColor;
|
|
|
|
if ((int)VAL_ZERO == pLVCD->iSubItem)
|
|
{
|
|
clrNewTextColor = RGB(0, 0, 255);
|
|
clrNewBkColor = ::GetSysColor (COLOR_BTNFACE);
|
|
}
|
|
else
|
|
{
|
|
clrNewTextColor = RGB(0, 0, 0);
|
|
clrNewBkColor = RGB(255, 255, 230);
|
|
}
|
|
|
|
pLVCD->clrText = clrNewTextColor;
|
|
pLVCD->clrTextBk = clrNewBkColor;
|
|
*pResult = CDRF_DODEFAULT;
|
|
}
|
|
}
|
|
|
|
|
|
void CAppMarineTdDetailListView::OnInitialUpdate()
|
|
{
|
|
CListView::OnInitialUpdate();
|
|
|
|
// TODO: Add your specialized code here and/or call the base class
|
|
CString strRowTitle;
|
|
int iRowIndex = (int)VAL_ZERO;
|
|
LVCOLUMN lvCol;
|
|
memset(&lvCol, (int)VAL_ZERO, sizeof(LVCOLUMN));
|
|
|
|
lvCol.mask = LVCF_FMT;
|
|
lvCol.fmt = LVCFMT_RIGHT;
|
|
|
|
m_pDetailList = &GetListCtrl();
|
|
m_pDetailList->SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_GRIDLINES);
|
|
|
|
m_pMngFrm = (CMDIChildWnd*)GetParentFrame();
|
|
|
|
m_pDetailList->InsertColumn(0, _T(""), LVCFMT_RIGHT, LIST_DETAIL_WIDTH_TITLE);
|
|
m_pDetailList->InsertColumn(1, _T(""), LVCFMT_LEFT, LIST_DETAIL_WIDTH_VALUE);
|
|
m_pDetailList->SetColumn(0, &lvCol);
|
|
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_TDNAME+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_DESN+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_SNAME+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_STYPE+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_TTYPE+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_ARRAY_TYPE+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_EAMOUNT+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_TPAMOUNT+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_CHAMOUNT+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_N+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_TRWAVE+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_TRFREQUENCY+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_IFREQUENCY+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_CLAYOUT+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_EDISTANCE+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_SPACING+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_INTERVAL+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_DIPOLE_NO+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_REC_MODE+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_CUR_POLE_DEPOLE+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_MOVE_SPEED+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_REC_DISTANCE+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_WEATHER+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_WDIR+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_TEMPERATURE+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_HEIGHT+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_HUMIDITY+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_CDATE+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_CTIME+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_TDATE+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_TTIME+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_OP+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
iRowIndex++;
|
|
strRowTitle.Empty();
|
|
strRowTitle.LoadString(IDS_DB_TD_QA+g_UIOffset);
|
|
m_pDetailList->InsertItem(iRowIndex, strRowTitle);
|
|
|
|
|
|
|
|
while (VAL_ZERO != (LIST_DETAIL_AMOUNT_ROW - (UINT)iRowIndex))
|
|
{
|
|
m_pDetailList->InsertItem(iRowIndex, _T(""));
|
|
iRowIndex++;
|
|
}
|
|
}
|
|
|
|
BOOL CAppMarineTdDetailListView::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 | LVS_NOCOLUMNHEADER | LVS_NOSCROLL;
|
|
return CListView::PreCreateWindow(cs);
|
|
}
|