Esempio n. 1
0
        public Rectangle getButtonRect(CustomPanelButton b)
        {
            int lft = 0;

            Rectangle ret = new Rectangle(0, 0, 20, 20);

            if (b.Anchor == CustomPanelButton.Anchors.left)
            {
                lft = b.Pos * 22;
            }
            else
            {
                lft = width - (((b.Pos + 1) * 20) + (b.Pos * 2));
            }

            ret.X = lft;

            return(ret);
        }
Esempio n. 2
0
        public bool isOverButton(Point P, CustomPanelButton b)
        {
            int lft = 0;

            if (P.Y >= 0 && P.Y <= 20)
            {
                if (b.Anchor == CustomPanelButton.Anchors.left)
                {
                    lft = b.Pos * 22;
                }
                else
                {
                    lft = width - (((b.Pos + 1) * 20) + (b.Pos * 2));
                }
            }

            Rectangle r = new Rectangle(lft, 0, 20, 20);

            return(r.Contains(P));
        }
Esempio n. 3
0
 public void Remove(CustomPanelButton button)
 {
     btns.Remove(button);
 }
Esempio n. 4
0
        private void SetupButtons()
        {
            #region BUTTONS
            CustomPanelButton b_Resize = new CustomPanelButton()
            {
                Image1      = IconChar.ArrowsAlt.ToBitmap(buttonSize, Color.Black),
                Image2      = IconChar.ArrowsAlt.ToBitmap(buttonSize, Color.White),
                Pos         = 0,
                PadRight    = 1,
                Anchor      = CustomPanelButton.Anchors.left,
                BorderWidth = 8,
                Value       = 0,
                HiddenAtVal = CustomPanelButton.HiddenVal.W065,
                Tooltiptext = "Resize\r\nResize image to original dimentions"
            };
            _buttons.Add(b_Resize);

            CustomPanelButton b_FullScreen = new CustomPanelButton()
            {
                Image1      = IconChar.ExpandArrowsAlt.ToBitmap(buttonSize, Color.Black),
                Image2      = IconChar.ExpandArrowsAlt.ToBitmap(buttonSize, Color.White),
                PadTop      = 2,
                PadRight    = 0,
                Pos         = 1,
                Anchor      = CustomPanelButton.Anchors.left,
                BorderWidth = 2,
                Value       = 1,
                HiddenAtVal = CustomPanelButton.HiddenVal.W175,
                Tooltiptext = "Full Screen\r\nResize image to fit the screen size\r\n(keeping aspect ratio)"
            };
            _buttons.Add(b_FullScreen);

            CustomPanelButton b_LayerUp = new CustomPanelButton()
            {
                Image1      = IconChar.ArrowCircleUp.ToBitmap(buttonSize, Color.Black),
                Image2      = IconChar.ArrowCircleUp.ToBitmap(buttonSize, Color.White),
                Pos         = 2,
                Anchor      = CustomPanelButton.Anchors.left,
                BorderWidth = 2,
                Value       = 2,
                HiddenAtVal = CustomPanelButton.HiddenVal.W175,
                Tooltiptext = "Layer Up\r\nMoves the image to a higher layer"
            };
            _buttons.Add(b_LayerUp);

            CustomPanelButton b_LayerDown = new CustomPanelButton()
            {
                Image1      = IconChar.ArrowCircleDown.ToBitmap(buttonSize, Color.Black),
                Image2      = IconChar.ArrowCircleDown.ToBitmap(buttonSize, Color.White),
                Pos         = 3,
                Anchor      = CustomPanelButton.Anchors.left,
                BorderWidth = 2,
                Value       = 3,
                HiddenAtVal = CustomPanelButton.HiddenVal.W175,
                Tooltiptext = "Layer Down\r\nMoves the image to a lower layer"
            };
            _buttons.Add(b_LayerDown);

            CustomPanelButton b_CMS = new CustomPanelButton()
            {
                Image1      = IconChar.CaretUp.ToBitmap(buttonSize, Color.Black),
                Image2      = IconChar.CaretUp.ToBitmap(buttonSize, Color.White),
                Pos         = 4,
                Anchor      = CustomPanelButton.Anchors.right,
                BorderWidth = 2,
                Value       = 10,
                HiddenAtVal = CustomPanelButton.HiddenVal.FullWidthOnly,
                Tooltiptext = "Open Menu\r\nOpens the dropdown menu allowing you to see more buttoins than can appear currently"
            };
            _buttons.Add(b_CMS);

            CustomPanelButton b_EditImage = new CustomPanelButton()
            {
                Image1      = IconChar.PaintBrush.ToBitmap(buttonSize, Color.Black),
                Image2      = IconChar.PaintBrush.ToBitmap(buttonSize, Color.White),
                Pos         = 3,
                PadRight    = -1,
                Anchor      = CustomPanelButton.Anchors.right,
                BorderWidth = 2,
                Value       = 4,
                HiddenAtVal = CustomPanelButton.HiddenVal.W135,
                Tooltiptext = "Edit Image\r\nOpens this image for editing"
            };
            _buttons.Add(b_EditImage);

            CustomPanelButton b_SaveImage = new CustomPanelButton()
            {
                Image1      = IconChar.Save.ToBitmap(buttonSize, Color.Black),
                Image2      = IconChar.Save.ToBitmap(buttonSize, Color.White),
                Pos         = 2,
                Anchor      = CustomPanelButton.Anchors.right,
                BorderWidth = 2,
                Value       = 5,
                HiddenAtVal = CustomPanelButton.HiddenVal.W135,
                Tooltiptext = "Save Image\r\nSaves this image into a separate file"
            };
            _buttons.Add(b_SaveImage);

            CustomPanelButton b_CopyImage = new CustomPanelButton()
            {
                Image1      = IconChar.Clone.ToBitmap(buttonSize, Color.Black),
                Image2      = IconChar.Clone.ToBitmap(buttonSize, Color.White),
                Pos         = 1,
                PadRight    = 1,
                Anchor      = CustomPanelButton.Anchors.right,
                BorderWidth = 2,
                Value       = 6,
                HiddenAtVal = CustomPanelButton.HiddenVal.W135,
                Tooltiptext = "Copy Image\r\nCopies this image to the clipboard"
            };
            _buttons.Add(b_CopyImage);

            CustomPanelButton b_DeleteImage = new CustomPanelButton()
            {
                Image1      = IconChar.Trash.ToBitmap(buttonSize, Color.Black),
                Image2      = IconChar.Trash.ToBitmap(buttonSize, Color.White),
                Pos         = 0,
                PadRight    = 2,
                Anchor      = CustomPanelButton.Anchors.right,
                BorderWidth = 2,
                Value       = -1,
                HiddenAtVal = CustomPanelButton.HiddenVal.W065,
                Tooltiptext = "Delete Image\r\nRemoves this image from the screen"
            };
            _buttons.Add(b_DeleteImage);

            foreach (CustomPanelButton bb in _buttons.btns)
            {
                bb.originalPos = bb.Pos;
            }

            #endregion
        }
Esempio n. 5
0
 public void Add(CustomPanelButton button)
 {
     btns.Add(button);
 }