⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stmstreeteventhandle.cpp

📁 电子交通地图
💻 CPP
字号:
// STMStreetEventHandle.cpp: implementation of the CSTMStreetEventHandle class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "stmeditor.h"
#include "STMStreetEventHandle.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#include "StreetNameInputDlg.h"//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CSTMStreetEventHandle::CSTMStreetEventHandle()
{

}

CSTMStreetEventHandle::~CSTMStreetEventHandle()
{

}
void CSTMStreetEventHandle::OnLButtonUp(UINT nFlags, CPoint point)
{
	if(m_pDoc->m_focusEI.eleType==ET_PATH)
	{
		if(m_pDoc->m_activeType==ACT_STREET_PICK_BEGIN)
		{
			if(m_pDoc->m_focusEI.index==-1) return;
			m_pDoc->m_activeType=ACT_STREET_PICK_NEXT;
			m_arrPathID.Add(m_pDoc->m_focusEI.index);
		}else if(m_pDoc->m_activeType==ACT_STREET_PICK_NEXT)
		{
			if(m_pDoc->m_focusEI.index==-1) return;
			m_arrPathID.Add(m_pDoc->m_focusEI.index);
		}
	}
}

void CSTMStreetEventHandle::OnRButtonUp(UINT nFlags, CPoint point)
{
	if(m_pDoc->m_activeType==ACT_STREET_PICK_NEXT) //finish the pick active
	{
		m_pDoc->m_activeType=ACT_STREET_PICK_BEGIN;
		CStreetNameInputDlg inputdlg;
		if(inputdlg.DoModal()==IDOK)
		{
			STREETINFO si;
			strcpy(si.name,inputdlg.m_StreetName);
			si.nPathes=m_arrPathID.GetSize();
			si.pPathID=new int[si.nPathes];
			for(int i=0;i<si.nPathes;i++)
			{
				si.pPathID[i]=m_arrPathID.GetAt(i);
			}
			if(m_pDoc->AddStreet(si)==-1)
			{
				delete []si.pPathID;
				m_pMapView->MessageBox("the input data can not make a street seemly!","input error");
			}
			m_pMapView->Invalidate(FALSE);//temp 
		}
		m_arrPathID.RemoveAll();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -