Пример #1
0
        // Adds a new DrawPane and returns the index of the DrawPane
        public int AddNewFrame()
        {
            int toReturn = Frames.Count;

            currentFrameIndex = toReturn;
            DrawPane newFrame;

            // Makes the new frame the previous frame's size
            if (Frames.Count > 0)
            {
                int w = Frames[currentFrameIndex - 1].Grid.DisplayMap.Width / Frames[currentFrameIndex - 1].Grid.Scale;
                int h = Frames[currentFrameIndex - 1].Grid.DisplayMap.Height / Frames[currentFrameIndex - 1].Grid.Scale;
                newFrame = new DrawPane(w, h, GetOptionsBar().GetCurrentScale());
            }
            else
            {
                newFrame = new DrawPane();
            }

            Frames.Add(newFrame);
            drawPanePanel.Controls.Clear();
            drawPanePanel.Controls.Add(newFrame);

            return(toReturn);
        }
Пример #2
0
        public int AddNewFrame(Size nativeScale, int scale)
        {
            if (Frames.Count == 0)
            {
                int toReturn = Frames.Count;
                currentFrameIndex = toReturn;

                DrawPane newFrame = new DrawPane(nativeScale, scale);
                Frames.Add(newFrame);
                drawPanePanel.Controls.Add(newFrame);

                return(toReturn);
            }
            else
            {
                return(-1);
            }
        }
Пример #3
0
        public int CopyFrame()
        {
            if (Frames.Count > 0)
            {
                int toReturn = Frames.Count;

                DrawPane newFrame = new DrawPane(new Utilities.DrawingGrid(GetDrawPane().Grid.DisplayMap, GetOptionsBar().GetCurrentScale(), GetOptionsBar().GetCurrentScale()));
                Frames.Add(newFrame);

                currentFrameIndex = toReturn;
                drawPanePanel.Controls.Clear();
                drawPanePanel.Controls.Add(newFrame);

                return(toReturn);
            }

            else
            {
                return(AddNewFrame());
            }
        }