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

📄 stmtreventhandle.cpp

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

#include "stdafx.h"
#include "stmeditor.h"
#include "STMTREventHandle.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

#include "TRNameInputDlg.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CSTMTREventHandle::CSTMTREventHandle()
{
	m_pDoc=NULL;
}

CSTMTREventHandle::~CSTMTREventHandle()
{

}


void CSTMTREventHandle::OnLButtonUp(UINT nFlags, CPoint point)
{
	if(m_pDoc->m_focusEI.eleType==ET_CROSS ||
		m_pDoc->m_focusEI.eleType==ET_BS)
	{
		if(m_pDoc->m_activeType==ACT_TR_PICK_BEGIN)
		{
			if(m_pDoc->m_focusEI.index==-1) return;
			m_pDoc->m_activeType=ACT_TR_PICK_NEXT;
			m_arrStation.Add(m_pDoc->m_focusEI);
		}else if(m_pDoc->m_activeType==ACT_TR_PICK_NEXT)
		{
			if(m_pDoc->m_focusEI.index==-1) return;
			m_arrStation.Add(m_pDoc->m_focusEI);
		}
	}
}

void CSTMTREventHandle::OnRButtonUp(UINT nFlags, CPoint point)
{
	if(m_pDoc->m_activeType==ACT_TR_PICK_NEXT) //finish the pick active
	{
		m_pDoc->m_activeType=ACT_TR_PICK_BEGIN;
		CTRNameInputDlg inputdlg;
		if(inputdlg.DoModal()==IDOK)
		{
			TRAFFICROUTEINFO tri;
			tri.type=inputdlg.m_TRType;
			strcpy(tri.name,inputdlg.m_TRName);
			tri.nStations=m_arrStation.GetSize();
			tri.pEI=new ELEINFO[tri.nStations];
			for(int i=0;i<tri.nStations;i++)
			{
				tri.pEI[i]=m_arrStation.GetAt(i);
			}
			if(m_pDoc->AddTR(tri)==-1)
			{
				delete []tri.pEI;
				m_pMapView->MessageBox("the input data can not make a traffic route seemly!","input error");
			}
			m_pMapView->Invalidate(FALSE);//temp 
		}
		m_arrStation.RemoveAll();
	}
}

⌨️ 快捷键说明

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