コード例 #1
0
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            // TODO:  Add MeasuredisTool.OnMouseDown implementation
            frm = GetFrm();
            frm.Show();
            frm.TopMost = true;


            IPoint      pPnt;
            IMap        pMap     = m_hookHelper.FocusMap;
            IActiveView pActView = m_hookHelper.ActiveView;

            if (Button == 1)
            {
                pPnt = m_hookHelper.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);

                if (frm.CheckedBtn == 1)
                {
                    if (m_FeedbackLine == null)
                    {
                        m_hookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewForeground, null, null);
                        m_FeedbackLine         = new NewLineFeedbackClass();
                        m_FeedbackLine.Display = m_hookHelper.ActiveView.ScreenDisplay;
                        m_FeedbackLine.Start(pPnt);
                    }
                    else
                    {
                        m_FeedbackLine.AddPoint(pPnt);
                    }

                    frm.frmLineDown(ref pPnt);
                }

                if (frm.CheckedBtn == 2)
                {
                    if (m_FeedbackPolygon == null)
                    {
                        m_hookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewForeground, null, null);
                        m_FeedbackPolygon         = new NewPolygonFeedbackClass();
                        m_FeedbackPolygon.Display = m_hookHelper.ActiveView.ScreenDisplay;
                        m_FeedbackPolygon.Start(pPnt);
                    }
                    else
                    {
                        m_FeedbackPolygon.AddPoint(pPnt);
                    }

                    frm.frmAreaDown(ref pPnt);
                }

                if (frm.CheckedBtn == 3)
                {
                    frm.frmFeatDown(ref pMap, ref pPnt, pActView);
                }
            }
        }