Ejemplo n.º 1
0
        public bool HandleMouseMoveForMove(UnitPoint mouseunitpoint)
        {
            if (m_originals.Count == 0)
            {
                return(false);
            }
            double    x      = mouseunitpoint.X - m_lastPoint.X;
            double    y      = mouseunitpoint.Y - m_lastPoint.Y;
            UnitPoint offset = new UnitPoint(x, y);

            m_lastPoint = mouseunitpoint;
            foreach (IDrawObject obj in m_copies)
            {
                obj.Move(offset);
            }
            m_canvas.DoInvalidate(true);
            return(true);
        }
Ejemplo n.º 2
0
 private void FrmSecondDMain_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.Shift && e.KeyCode == Keys.S)
         {
             this.bar1.Visible = !this.bar1.Visible;
         }
         else if (e.Control && e.KeyCode == Keys.F)
         {
             using (FrmFindLand frm = new FrmFindLand())
             {
                 if (frm.ShowDialog() == DialogResult.OK)
                 {
                     using (WaitDialogForm dialog = new WaitDialogForm("正在查找,请稍后...", "提示"))
                     {
                         IDrawObject land = (from a in m_data.ActiveLayer.Objects
                                             where a.Id == "LandMark" && (a as LandMarkTool).LandCode == frm.LandCode
                                             select a).FirstOrDefault();
                         if (land != null)
                         {
                             (land as LandMarkTool).Selected = true;
                         }
                         else
                         {
                             MsgBox.ShowWarn("未找到地标号" + frm.LandCode + "!");
                             return;
                         }
                         m_data.AddSelectedObject(land);
                         m_canvas.DoInvalidate(true);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     { MsgBox.ShowError(ex.Message); }
 }