identify.cpp

来自「在vc环境下」· C++ 代码 · 共 83 行

CPP
83
字号
#include "StdAfx.h"
#include ".\identify.h"


STDMETHODIMP CIdentify::OnClick()
{
	if (FALSE==m_IdentifyDlg.get_isShow())
	{
		HWND hWnd;
		m_hookHelper.get_hWnd(&hWnd);
		m_IdentifyDlg.Create(hWnd);
		m_IdentifyDlg.set_isShow(TRUE);
	}

	IActiveViewPtr cpActiveView;
	GetFocusMapActiveView(&cpActiveView);
	m_IdentifyDlg.ShowHelp(cpActiveView);
	return S_OK;

}



STDMETHODIMP CIdentify::OnMouseDown(LONG Button, LONG Shift, LONG X, LONG Y)
{

	// Update focus map to the place thats clicked on
	CMapToolBase::MouseDown(X,Y);

	IPointPtr       cpStartPoint;
	IActiveViewPtr  cpActiveView;

	GetFocusMapActiveView(&cpActiveView);
	ToFocusMapPoint(X,Y, &cpStartPoint);
	
	
	if (FALSE==m_IdentifyDlg.get_isShow())
	{
		HWND hWnd;
		m_hookHelper.get_hWnd(&hWnd);
		m_IdentifyDlg.Create(hWnd);
		m_IdentifyDlg.set_isShow(TRUE);
	}

	m_IdentifyDlg.Show(cpStartPoint,cpActiveView,Shift==1||Shift==3||Shift==7||Shift==5);


	
	return S_OK;
}

STDMETHODIMP CIdentify::OnMouseMove(LONG Button, LONG Shift, LONG X, LONG Y)
{
	return S_OK;
}

STDMETHODIMP CIdentify::OnMouseUp(LONG Button, LONG Shift, LONG X, LONG Y)
{
	CMapToolBase::MouseUp();
	return S_OK;
}

STDMETHODIMP CIdentify::OnKeyDown(LONG keyCode, LONG Shift)
{
	if (keyCode == VK_ESCAPE)
	{
        m_IdentifyDlg.DestroyWindow();

	}


	return S_OK;
}

STDMETHODIMP CIdentify::OnKeyUp(LONG keyCode, LONG Shift)
{


	return S_OK;
}


⌨️ 快捷键说明

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