public override void OnMouseDown(int Button, int Shift, int X, int Y) { if (Button != 1) { return; } if (m_frmQuery == null) { m_frmQuery = new frmQuery(m_MapControl, m_enumQueryMode); m_frmQuery.Owner = m_mainFrm; m_frmQuery.FormClosed += new FormClosedEventHandler(frmQuery_FormClosed); } ESRI.ArcGIS.Geometry.IPoint pPoint = m_MapControl.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); frmBufferSet pFrmBufSet = new frmBufferSet(pPoint as IGeometry, m_MapControl.Map, m_frmQuery); IGeometry pGeometry = pFrmBufSet.GetBufferGeometry(); if (pGeometry == null || pFrmBufSet.Res == false) { return; } m_frmQuery.Show(); m_frmQuery.FillData(m_MapControl.ActiveView.FocusMap, pGeometry); }
public override void OnMouseUp(int Button, int Shift, int X, int Y) { if (m_pNewEnvelope == null) { return; } IEnvelope pEnvelope = m_pNewEnvelope.Stop(); int iPiexl = 3; double iMapTolerance = ConvertPixelsToMapUnits(m_MapControl.ActiveView, iPiexl); IGeometry pGeometry = null; if (pEnvelope == null || pEnvelope.IsEmpty) { ITopologicalOperator pTopo = (ITopologicalOperator)m_pPoint; if (pTopo != null) { pGeometry = pTopo.Buffer(iMapTolerance); } } else { pEnvelope.SpatialReference = m_MapControl.ActiveView.FocusMap.SpatialReference; pGeometry = pEnvelope; } m_pNewEnvelope = null; if (m_frmQuery == null) { m_frmQuery = new frmQuery(m_MapControl, m_enumQueryMode); m_frmQuery.Owner = m_mainFrm; m_frmQuery.FormClosed += new FormClosedEventHandler(frmQuery_FormClosed); } m_frmQuery.Show(); m_frmQuery.FillData(m_MapControl.ActiveView.FocusMap, pGeometry); // _QuerBar.m_pMapControl = m_MapControl; // _QuerBar.EmergeQueryData(m_MapControl.ActiveView.FocusMap, pGeometry,esriSpatialRelEnum.esriSpatialRelIntersects); }