Exemplo n.º 1
0
        public static Button ToButton(this string name, List<Button> Buttons)
        {
            Button retVal = new Button();

            foreach (Button button in Buttons)
            {
                if (button.Name == name)
                    return button;
            }

            return retVal;
        }
Exemplo n.º 2
0
        //Button btnPencil;
        //Button btnEraser;
        //Button btnLine;
        //Button btnShowGrid;
        public WorkSpaceScreen(String name, Vector2 position, Vector2 size)
        {
            Name = name;
            Position = position;
            Size = size;

            Button btnPencil = new Button(new Vector2(this.Bounds.X + 5, this.Bounds.Y + 5), new Vector2(20, 20));
            btnPencil.Image = Textures.Pencil;
            btnPencil.IsSelected = true;
            btnPencil.Name = "Pencil";

            Button btnEraser = new Button(new Vector2(btnPencil.Bounds.X + btnPencil.Bounds.Width + 5, this.Bounds.Y + 5), new Vector2(20, 20));
            btnEraser.Image = Textures.Eraser;
            btnEraser.IsSelected = false;
            btnEraser.Name = "Eraser";

            Button btnLine = new Button(new Vector2(btnEraser.Bounds.X + btnEraser.Bounds.Width + 5, this.Bounds.Y + 5), new Vector2(20, 20));
            btnLine.Image = Textures.Line;
            btnLine.IsSelected = false;
            btnLine.Name = "Line";

            Button btnFill = new Button(new Vector2(btnLine.Bounds.X + btnLine.Bounds.Width + 5, this.Bounds.Y + 5), new Vector2(20, 20));
            btnFill.Image = Textures.PaintCan;
            btnFill.IsSelected = false;
            btnFill.Name = "Fill";

            Button btnRectangle = new Button(new Vector2(btnFill.Bounds.X + btnFill.Bounds.Width + 5, this.Bounds.Y + 5), new Vector2(20, 20));
            btnRectangle.Image = Textures.Rectangle;
            btnRectangle.IsSelected = false;
            btnRectangle.Name = "Rectangle";

            Button btnCircle = new Button(new Vector2(btnRectangle.Bounds.X + btnRectangle.Bounds.Width + 5, this.Bounds.Y + 5), new Vector2(20, 20));
            btnCircle.Image = Textures.Circle;
            btnCircle.IsSelected = false;
            btnCircle.Name = "Circle";

            Button btnShowGrid = new Button(new Vector2(btnCircle.Bounds.X + btnCircle.Bounds.Width + 5, this.Bounds.Y + 5), new Vector2(20, 20));
            btnShowGrid.Image = Textures.Grid;
            btnShowGrid.IsSelected = true;
            btnShowGrid.Name = "ShowGrid";

            toolbar.Buttons.Add(btnPencil);
            toolbar.Buttons.Add(btnEraser);
            toolbar.Buttons.Add(btnLine);
            toolbar.Buttons.Add(btnFill);
            toolbar.Buttons.Add(btnRectangle);
            toolbar.Buttons.Add(btnCircle);
            toolbar.Buttons.Add(btnShowGrid);
        }
Exemplo n.º 3
0
        public FramePalette(Vector2 position, Vector2 size)
        {
            this.Position = position;
            this.Size = size;

            toolbar.Position = new Vector2(this.Bounds.X, this.Bounds.Y + 2);

            buildThumbnails();

            Button btnNewFrame = new Button(new Vector2(this.Bounds.X + 5, this.Bounds.Y + 5), new Vector2(20, 20));
            btnNewFrame.Image = Textures.AddFrame;
            btnNewFrame.IsSelected = false;
            btnNewFrame.Name = "New Frame";

            Button btnDeleteFrame = new Button(new Vector2(this.Bounds.X + 5 + btnNewFrame.Bounds.Width, this.Bounds.Y + 5), new Vector2(20, 20));
            btnDeleteFrame.Image = Textures.DeleteFrame;
            btnDeleteFrame.IsSelected = false;
            btnDeleteFrame.Name = "Delete Frame";

            toolbar.Buttons.Add(btnNewFrame);
            toolbar.Buttons.Add(btnDeleteFrame);
        }