listctrlex.cpp
来自「用VC写的监控中心后台程序。 代码全」· C++ 代码 · 共 60 行
CPP
60 行
// ListCtrlEx.cpp : implementation file
//
#include "stdafx.h"
#include "GpsSC.h"
#include "ListCtrlEx.h"
#include "GpsSCView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CListCtrlEx
CListCtrlEx::CListCtrlEx()
{
m_pCurrView = NULL;
}
CListCtrlEx::~CListCtrlEx()
{
}
BEGIN_MESSAGE_MAP(CListCtrlEx, CListCtrl)
//{{AFX_MSG_MAP(CListCtrlEx)
ON_WM_LBUTTONDBLCLK()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CListCtrlEx message handlers
void CListCtrlEx::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
int nItemIndex = -1;
CString strLongitude,strLatitude,strVehicleNO;
nItemIndex = GetNextItem(nItemIndex,LVNI_SELECTED);
if(nItemIndex!=-1)
{
strLongitude = GetItemText(nItemIndex,5);
strLatitude = GetItemText(nItemIndex,6);
strVehicleNO = GetItemText(nItemIndex,1);
if(m_pCurrView!=NULL)
((CGpsSCView*)m_pCurrView)->SendGXGY(strLongitude,strLatitude,strVehicleNO);
}
CListCtrl::OnLButtonDblClk(nFlags, point);
}
void CListCtrlEx::GetViewPoint(CView *pView)
{
m_pCurrView = pView;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?