Exemple #1
0
        public override Control GeneratePad()
        {
            var layout = new DynamicLayout {
                Padding = Padding.Empty, Spacing = Size.Empty
            };

            layout.Add(TopSeparator());
            layout.BeginVertical(Padding.Empty);
            layout.BeginHorizontal();

            var b = new ImageButton {
                Image   = ImageCache.BitmapFromResource("Pablo.Formats.Rip.Icons.Pixel-Multi.png"),
                Toggle  = true,
                Pressed = enableMulti
            };

            b.Click += delegate {
                enableMulti = b.Pressed;
            };

            layout.Add(b);
            layout.Add(null);
            layout.EndHorizontal();
            layout.EndVertical();

            return(layout);
        }
Exemple #2
0
        public override Control GeneratePad()
        {
            var layout = new DynamicLayout {
                Padding = Padding.Empty, Spacing = Size.Empty
            };

            layout.BeginHorizontal();

            var b = new ImageButton {
                Image = ImageCache.BitmapFromResource("Pablo.Formats.Rip.Icons.Copy-Clear.png"),
#if DESKTOP
                ToolTip = "Clear copied region",
#endif
                Toggle  = true,
                Pressed = enableClear
            };

            b.Click += delegate {
                enableClear = b.Pressed;
            };

            layout.Add(b);
            layout.Add(null);
            layout.EndHorizontal();

            return(layout);
        }
Exemple #3
0
        Control FGButton()
        {
            var control = new ImageButton {
                Image   = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.DrawForeground.png"),
                Toggle  = true,
                Pressed = PaintForeground,
#if DESKTOP
                ToolTip = "Paint foreground (shift)"
#endif
            };

            control.Click += delegate {
                PaintForeground = control.Pressed;
            };
            return(control);
        }
Exemple #4
0
        Control FilledButton()
        {
            var control = new ImageButton {
                Image   = ImageCache.BitmapFromResource("Pablo.Formats.Rip.Icons.FilledOval.png"),
                Toggle  = true,
                Pressed = Filled,
#if DESKTOP
                ToolTip = "Filled ellipse"
#endif
            };

            control.Click += delegate {
                Filled = control.Pressed;
            };
            return(control);
        }
Exemple #5
0
        Control ApplyCharacterButton()
        {
            var control = new ImageButton {
                Image   = ImageCache.BitmapFromResource("Pablo.Formats.Rip.Icons.Text-Horizontal.png"),
                Toggle  = true,
                Pressed = ApplyCharacter,
#if DESKTOP
                ToolTip = "Draw with character"
#endif
            };

            control.Click += delegate {
                ApplyCharacter = control.Pressed;
            };
            return(control);
        }
Exemple #6
0
        Control CenteredButton()
        {
            var control = new ImageButton {
                Image   = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.Centered.png"),
                Toggle  = true,
                Pressed = IsCentered,
#if DESKTOP
                ToolTip = "Centered (alt)"
#endif
            };

            control.Click += delegate {
                IsCentered = control.Pressed;
            };
            return(control);
        }
Exemple #7
0
        Control SquareButton()
        {
            var control = new ImageButton {
                Image   = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.Square.png"),
                Toggle  = true,
                Pressed = IsSquare,
#if DESKTOP
                ToolTip = "Square aspect (shift)"
#endif
            };

            control.Click += delegate {
                IsSquare = control.Pressed;
            };
            return(control);
        }
Exemple #8
0
        Control VerticalButton()
        {
            var control = vertical = new ImageButton
            {
                Image      = ImageCache.BitmapFromResource("Pablo.Formats.Rip.Icons.Text-Vertical.png"),
                Persistent = true,
                Pressed    = handler.TextDirection == BGICanvas.Direction.Vertical
            };

            control.Click += delegate
            {
                handler.TextDirection = BGICanvas.Direction.Vertical;
                horizontal.Pressed    = false;
                DrawCanvas();
            };

            return(control);
        }
Exemple #9
0
        Control InvertButton()
        {
            var control = new ImageButton
            {
                Image   = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.Erase.png"),
                Toggle  = true,
                Pressed = Inverted,
#if DESKTOP
                ToolTip = "Erase mode (shift)"
#endif
            };

            control.Click += delegate
            {
                Inverted = control.Pressed;
            };
            return(control);
        }
Exemple #10
0
        Control ColourButton()
        {
            var control = new ImageButton
            {
                Image   = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.ApplyColour.png"),
                Toggle  = true,
                Pressed = ApplyColour,
#if DESKTOP
                ToolTip = "Draw with color (alt)"
#endif
            };

            control.Click += delegate
            {
                ApplyColour = control.Pressed;
            };
            return(control);
        }
Exemple #11
0
        public override Control GeneratePad()
        {
            var layout = new DynamicLayout {
                Padding = Padding.Empty
            };

            layout.Add(Separator());
            layout.BeginVertical(Padding.Empty);
            layout.BeginHorizontal();

            var b = new ImageButton {
                Image   = ImageCache.BitmapFromResource("Pablo.Formats.Rip.Icons.Brush-Multi.png"),
                Toggle  = true,
                Pressed = enableMulti
            };

            b.Click += delegate {
                enableMulti = b.Pressed;
            };

            layout.Add(b);
            layout.Add(null);
            layout.EndHorizontal();
            layout.EndVertical();

            var font       = new Font(SystemFont.Default, 7);
            var updownfont = new Font(SystemFont.Default, 8);

            layout.BeginVertical(Padding.Empty, Size.Empty);
            layout.Add(new Label {
                Text = "Width", Font = font, HorizontalAlign = HorizontalAlign.Center
            });
            var widthBox = new NumericUpDown {
                Font     = updownfont,
                Value    = width,
                MinValue = 1,
                MaxValue = MAX_WIDTH,
                Size     = new Size(20, -1)
            };

            widthBox.ValueChanged += delegate {
                width = Math.Max(1, Math.Min(MAX_WIDTH, (int)widthBox.Value));
            };
            layout.Add(widthBox);
            layout.EndBeginVertical(Padding.Empty, Size.Empty);

            layout.Add(new Label {
                Text = "Density", Font = font, HorizontalAlign = HorizontalAlign.Center
            });
            var pointsBox = new NumericUpDown {
                Font     = updownfont,
                Value    = points,
                MinValue = 1,
                MaxValue = MAX_POINTS,
                Size     = new Size(20, -1)
            };

            pointsBox.ValueChanged += delegate {
                points = Math.Max(1, Math.Min(MAX_POINTS, (int)pointsBox.Value));
            };
            layout.Add(pointsBox);
            layout.EndVertical();

            return(layout);
        }