Пример #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);

            }
        }
Пример #2
0
 /// <summary>
 /// Occurs when this tool is clicked
 /// </summary>
 public override void OnClick()
 {
     // TODO: Add MeasureDisTool.OnClick implementation
     frm = GetFrm();
     frm.GetMapUnit(m_hookHelper.FocusMap);
        frm.Show();
        frm.TopMost = true;
 }