You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.4 KiB
C++

#include "StdAfx.h"
#include "MouseToolMove.h"
#include "GlobalDrawMgr.h"
#include "GlobalFunction.h"
CMouseToolMove::CMouseToolMove(void)
{
m_MoveDisX = 0;
m_MoveDisY = 0;
}
CMouseToolMove::~CMouseToolMove(void)
{
}
void CMouseToolMove::OnLButtonDown(UINT nFlags, CPoint point,CClientDC &dc)
{
if(m_Status==_STATUS_1)
{
SaveDownPoint(point);
//<2F><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>
CreatOpSimulateObj();
ToNextStatus();
}
}
void CMouseToolMove::OnLButtonUp(UINT nFlags, CPoint point,CClientDC &dc)
{
gLayer.OnMove(m_MoveDisX,m_MoveDisY);
OperateOver();
m_Status = _STATUS_END;
}
void CMouseToolMove::OperateObj(Dbxy StartPt,Dbxy EndPt)
{
//obj <20><><EFBFBD><EFBFBD>
SObjOperatePar par;
par.OpType = _OP_MOVE;
par.MoveX = EndPt.x - StartPt.x;
par.MoveY = EndPt.y - StartPt.y;
//<2F><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
OpSimulateObj(par);
//<2F><>¼<EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>---<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_MoveDisX = par.MoveX;
m_MoveDisY = par.MoveY;
}
void CMouseToolMove::OnMouseMove(UINT nFlags, CPoint point,CClientDC &dc)
{
Dbxy CurPt = gDraw->CPoint2Dbxy(point);
CLayer &layer = gLayer;
if(nFlags&MK_LBUTTON && (m_Status!=_STATUS_1))
{
if(m_bFirstMove==false)
{
//<2F>ػ<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
XorRedrawOpSimulateObj(&dc);
}
m_bFirstMove = false;
OperateObj(m_DownPoint,CurPt);//<2F><><EFBFBD><EFBFBD>
XorRedrawOpSimulateObj(&dc);
}
}