ListCtrlEx.cpp
上传用户:yffx2008
上传日期:2014-10-12
资源大小:12414k
文件大小:1k
- // 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;
- }