Beispiel #1
0
        public static void DownEvent(MouseEventArgs e, MapPanelEditor mapEditor, MyPanel.MyPanel MapPanel)
        {
            MapPanelMouse.NowDownTime = MapPanelMouse.CurrentTimeMillis;
            MapPanel.Focus();
            MapPanelMouse.RecordDownPoint(e, mapEditor);
            MapPanelShow showTemp      = new MapPanelShow(mapEditor);
            int          MapTotalSizeX = showTemp.MapTotalSizeX;
            int          MapTotalSizeY = showTemp.MapTotalSizeY;

            if (e.X >= MapTotalSizeX || e.Y >= MapTotalSizeY)
            {
                return;
            }
            if (e.X < 0 || e.Y < 0)
            {
                return;
            }
            if (e.Button == MouseButtons.Right)
            {
                MapDragPlace.IsEnter = false;
                MapDragPlace.IsOver  = false;
                MoveXOld             = e.X;
                MoveYOld             = e.Y;
                mapEditor.MapDragEN  = true;

                mapEditor.SelectedIndex = MapPanelMouse.DownSelectIndex(e, mapEditor);
            }
            else if (e.Button == MouseButtons.Left)
            {
                SmartPaste.HoverPasteInit();
                mapEditor.SelectedIndex = MapPanelMouse.DownSelectIndex(e, mapEditor);

                MapPanelMouse.ImLineFisrtDown(e, mapEditor);

                mapEditor.Imaginary    = true;
                mapEditor.ImagBlockCus = false;
            }
            else if (e.Button == MouseButtons.Middle)
            {
                mapEditor.ImagBlockCus = false;
                MoveXOld          = e.X;
                MoveYOld          = e.Y;
                mapEditor.Magnify = true;

                mapEditor.SelectedIndex = MapPanelMouse.DownSelectIndex(e, mapEditor);

                MapPanel.Refresh();
            }
        }
Beispiel #2
0
        public static void DragEnterEvent(DragEventArgs e, MapPanelEditor mapEditor, MyPanel.MyPanel MapPanel)
        {
            MapPanel.Focus();
            string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();

            if (MyPublicFuntion.StringOperation.GetFileexc(path) ==
                MyPublicFuntion.StringOperation.GetFileexc(new FileMap.FileOperator().MapLoadFilter))
            {
                e.Effect    = DragDropEffects.All;
                IsFileEnter = true;
            }
            else
            {
                IsFileEnter = false;
                e.Effect    = DragDropEffects.None;
            }

            MapPanel.Refresh();
        }