Ejemplo n.º 1
0
        public static void ClickEvent(MouseEventArgs e, MapPanelEditor mapEditor, MyPanel.MyPanel control)
        {
            MapPanelMouse.NowUpTime = MapPanelMouse.CurrentTimeMillis;
            if (e.Button == MouseButtons.Right && MapPanelMouse.IsMouseHold() == false)
            {
                Point nowClick = new Point(e.X, e.Y);
                if (mapEditor.ImagBlockCus == true)
                {
                    Point     old = new Point(mapEditor.ImLineXOld, mapEditor.ImLineYOld);
                    Point     now = new Point(mapEditor.ImLineXNow, mapEditor.ImLineYNow);
                    Rectangle rec = mapEditor.GetExpandRectangleFromDiagonalPoints(old, now);

                    if (mapEditor.RectangleContainsPoint(rec, nowClick) == true)
                    {
                        control.MouseRightDownMenu.Show(control, nowClick);
                    }
                    else
                    {
                        mapEditor.DataInit();
                    }
                }
                else
                {
                    control.MouseRightDownMenu.Show(control, nowClick);
                }
            }
        }
Ejemplo n.º 2
0
        public static void UpEvent(MouseEventArgs e, MapPanelEditor mapEditor, MyPanel.MyPanel MapPanel)
        {
            MapPanelMouse.NowUpTime = MapPanelMouse.CurrentTimeMillis;
            mapEditor.MapDragEN     = false;
            mapEditor.Magnify       = false;
            mapEditor.Imaginary     = false;

            SmartPaste.HoverPasteInit();
            if (e.Button == MouseButtons.Left)
            {
                int MapTotalSizeX = mapEditor.PictureSize * MapPanelEditor.RowNum + mapEditor.MapLeft;
                int MapTotalSizeY = mapEditor.PictureSize * MapPanelEditor.RowNum + mapEditor.MapTop;
                if (MapPanelMouse.IsMouseHold() == true)
                {
                    mapEditor.ImagBlockCus = true;
                }
            }
        }