Esempio n. 1
0
        public FontTypeSelector(RipHandler handler)
        {
            this.handler = handler;
            this.Title   = "Font Style";
#if DESKTOP
            this.Resizable = true;
#endif

            var layout = new DynamicLayout();

            layout.Add(FontAndSizes(), true, true);

            layout.AddCentered(Preview(), horizontalCenter: true, verticalCenter: false, padding: Padding.Empty);

            layout.BeginVertical(Padding.Empty);
            layout.BeginHorizontal();
            layout.Add(null, true);
            layout.Add(CancelButton());
            layout.Add(OkButton());

            layout.EndHorizontal();
            layout.EndVertical();

            Content = layout;
        }
Esempio n. 2
0
        public LineStyleEditor(RipHandler handler)
        {
            this.Title   = "Custom Line Style";
            this.handler = handler;
            //this.Resizable = true;

            var layout = new DynamicLayout();

            layout.BeginVertical(yscale: true);

            layout.Add(Design());

            layout.Add(Preview(), yscale: true);

            layout.EndVertical();

            layout.BeginVertical();
            layout.BeginHorizontal();

            layout.Add(null, true);
            layout.Add(CancelButton());
            layout.Add(OkButton());

            layout.EndHorizontal();
            layout.EndVertical();

            Content = layout;
        }
Esempio n. 3
0
 public Animate(RipHandler handler)
 {
     //this.handler = handler;
     ID       = ActionID;
     MenuText = "Animate";
     Shortcut = Keys.Alt | Keys.A;
 }
Esempio n. 4
0
        public ColourEditor(RipHandler handler)
        {
            this.handler = handler;
            this.Title   = "Color Editor";

            colors = handler.BGI.GetPalette();

            var layout = new DynamicLayout();

            layout.BeginVertical();
            layout.BeginHorizontal();
            layout.Add(Colours());

            //layout.Add (null, true);
            layout.Add(Sliders(), true);
            //layout.Add (null, true);
            layout.Add(EGAColours());

            layout.EndHorizontal();
            layout.EndVertical();

            layout.BeginVertical();
            layout.BeginHorizontal();

            layout.Add(SetDefaultButton());
            layout.Add(null, true);
            layout.Add(CancelButton());
            layout.Add(OkButton());

            layout.EndHorizontal();
            layout.EndVertical();

            Content = layout;
            SetupSliders();
        }
Esempio n. 5
0
        public LineStylePad(RipHandler handler, bool allowStyles)
        {
            this.handler = handler;
            var layout = new DynamicLayout {
                Padding = Padding.Empty, Spacing = Size.Empty
            };

            layout.BeginVertical(Padding.Empty, Size.Empty);
            layout.BeginHorizontal();

            layout.Add(LineSize(1), true);
            layout.Add(LineSize(3), true);

            layout.EndHorizontal();
            layout.EndVertical();

            if (allowStyles)
            {
                layout.Add(LineStyle(BGICanvas.LineStyle.Solid));
                layout.Add(LineStyle(BGICanvas.LineStyle.Dotted));
                layout.Add(LineStyle(BGICanvas.LineStyle.Dashed));
                layout.Add(LineStyle(BGICanvas.LineStyle.Center));
                layout.Add(LineStyle(BGICanvas.LineStyle.User));

                layout.BeginVertical(new Padding(0, 5, 0, 0));
                layout.AddRow(null, EditLineStyle(), null);
                layout.EndVertical();
            }
            Content = layout;
        }
Esempio n. 6
0
 public Undo(RipHandler handler)
     : base(handler)
 {
     this.handler     = handler;
     this.ID          = ActionID;
     this.MenuText    = "Undo";
     this.ToolBarText = "Undo";
     this.ToolTip     = "Removes the last command and redraws the screen";
     this.Shortcut    = PabloCommand.CommonModifier | Keys.Z;
 }
Esempio n. 7
0
 public override void Set(RipHandler handler, bool forDrawing)
 {
     if (forDrawing)
     {
         Mode = BGICanvas.WriteMode.Xor;
     }
     else
     {
         Mode = BGICanvas.WriteMode.Copy;
     }
 }
Esempio n. 8
0
 public override void Set(RipHandler handler, bool forDrawing)
 {
     if (forDrawing && (handler.BGI.Palette[handler.Foreground].ToArgb() & 0xFFFFFF) == 0)
     {
         Value = 7;
     }
     else
     {
         Value = handler.Foreground;
     }
 }
Esempio n. 9
0
        public ToolboxPad(RipHandler handler)
        {
            this.Handler = handler;

            this.Handler.ToolChanged += new EventHandler <EventArgs> (HandleToolChanged).MakeWeak(e => this.Handler.ToolChanged -= HandleToolChanged);

            var layout = new DynamicLayout {
                Padding = Padding.Empty
            };

            layout.DefaultPadding = Padding.Empty;
            layout.DefaultSpacing = new Size(5, 5);


            layout.BeginVertical(spacing: Size.Empty);
            layout.BeginHorizontal();
            layout.Add(null, true);
            var tools = Handler.Tools.ToList();

            for (int i = 0; i < tools.Count; i++)
            {
                var tool   = tools [i];
                var button = new ImageButton {
                    Image      = tool.Image,
                    Persistent = true,
#if DESKTOP
                    ToolTip = tool.Description,
#endif
                    Tag     = tool,
                    Size    = new Size(20, 18),
                    Pressed = handler.SelectedTool == tool
                };
                tool.Tag      = button;
                button.Click += delegate {
                    Handler.SelectedTool = tool;
                };
                layout.Add(button);
                if ((i % 2) == 1)
                {
                    layout.Add(null, true);
                    layout.EndHorizontal();
                    layout.BeginHorizontal();
                    layout.Add(null, true);
                }
            }
            layout.EndHorizontal();
            layout.EndVertical();

            layout.Add(toolPad = new Panel());

            layout.Add(null);

            Content = layout;
        }
Esempio n. 10
0
 public override void Set(RipHandler handler, bool forDrawing)
 {
     this.Style = handler.LineStyle;
     if (forDrawing)
     {
         this.Pattern = handler.LinePattern == 0 ? 0xAAAA : handler.LinePattern;
     }
     else
     {
         this.Pattern = handler.LinePattern;
     }
     this.Thickness = handler.LineThickness;
 }
Esempio n. 11
0
        public FillStylePad(RipHandler handler)
        {
            this.handler = handler;
            var layout = new DynamicLayout {
                Padding = Padding.Empty
            };

            layout.BeginVertical(Padding.Empty, Size.Empty);

            layout.BeginHorizontal();
            layout.Add(null, true);
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.Empty));
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.Solid));
            layout.Add(null, true);

            layout.EndBeginHorizontal();
            layout.Add(null, true);
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.Line));
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.Interleave));

            layout.EndBeginHorizontal();
            layout.Add(null, true);
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.LtSlash));
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.Slash));

            layout.EndBeginHorizontal();
            layout.Add(null, true);
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.LtBkSlash));
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.BkSlash));

            layout.EndBeginHorizontal();
            layout.Add(null, true);
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.Hatch));
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.XHatch));

            layout.EndBeginHorizontal();
            layout.Add(null, true);
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.WideDot));
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.CloseDot));

            layout.EndBeginHorizontal();
            layout.Add(null, true);
            layout.Add(CreateFillStyle(BGICanvas.FillStyle.User));
            layout.EndHorizontal();

            layout.EndVertical();
            layout.AddCentered(FillStyleButton(), horizontalCenter: true, verticalCenter: false);

            Content = layout;
        }
Esempio n. 12
0
        public ColourPad(RipHandler handler)
        {
            this.Handler = handler;
            //this.Handler.ColourStart = start;

            this.Handler.AttributeChanged += new EventHandler <EventArgs>(HandleColourChanged).MakeWeak(e => this.Handler.AttributeChanged -= HandleColourChanged);

            /*this.Handler.CurrentPage.PaletteChanged += new EventHandler<EventArgs> (delegate{
             *      SetColours ();
             *      UpdateButtons ();
             *      Invalidate ();
             * }).MakeWeak ((e) => this.Handler.CurrentPage.PaletteChanged -= e);*/

            var boxSize      = new Size(30, 30);
            int boxOffset    = 10;
            int boxesPadding = 10;
            int boxesOffset  = boxSize.Width + boxOffset + boxesPadding;

            max = 8;             //Math.Min (16, Palette.Count / 2);

            Size       = new Size(40, boxesOffset + (max * 18));
            foreground = new FBColourBox {
                Size = boxSize,
                Pad  = this
            };

            background = new FBColourBox {
                Size = boxSize,
                Pad  = this
            };

            SetColours();

            var layout = new PixelLayout();

            layout.Add(background, boxOffset, boxOffset);
            layout.Add(foreground, 0, 0);

            colours = new SelectColourBox[max * 2];

            for (int i = 0; i < max; i++)
            {
                CreateButton(layout, i, 2, boxesOffset + i * 18);
                CreateButton(layout, i + max, 22, boxesOffset + i * 18);
            }

            Content = layout;

            UpdateButtons();
        }
Esempio n. 13
0
 public Redo(RipHandler handler)
     : base(handler)
 {
     this.handler     = handler;
     this.ID          = ActionID;
     this.MenuText    = "Redo";
     this.ToolBarText = "Redo";
     this.ToolTip     = "re-applies the last command removed via Undo";
     if (EtoEnvironment.Platform.IsMac)
     {
         this.Shortcut = PabloCommand.CommonModifier | Keys.Shift | Keys.Z;                 // TODO: Shortcut , PabloCommand.CommonModifier | Keys.Y };
     }
     else
     {
         this.Shortcut = PabloCommand.CommonModifier | Keys.Y;                 //, PabloCommand.CommonModifier | Keys.Shift | Keys.Z };
     }
 }
Esempio n. 14
0
        public FontStylePad(RipHandler handler)
        {
            this.handler = handler;
            var layout = new DynamicLayout {
                Padding = Padding.Empty
            };

            layout.BeginVertical(Padding.Empty, Size.Empty);
            layout.Add(new Label {
                Text = "Font Size", TextAlignment = TextAlignment.Center, Font = new Font(SystemFont.Default, 7)
            });
            layout.Add(FontSize());
            layout.EndVertical();

            layout.BeginVertical(Padding.Empty, Size.Empty);
            layout.AddRow(null, HorizontalButton(), VerticalButton(), null);
            layout.EndVertical();

            layout.AddCentered(FontType(), horizontalCenter: true, verticalCenter: false, padding: Padding.Empty);
            layout.AddCentered(FillStyleButton(), horizontalCenter: true, verticalCenter: false, padding: Padding.Empty);
            Content = layout;
        }
Esempio n. 15
0
 public override void Set(RipHandler handler, bool forDrawing)
 {
     this.Font          = handler.FontType;
     this.Direction     = handler.TextDirection;
     this.CharacterSize = handler.FontSize;
 }
Esempio n. 16
0
 public SendCommands(RipHandler handler)
 {
     this.handler = handler;
 }
Esempio n. 17
0
 public override void Set(RipHandler handler, bool forDrawing)
 {
     this.Value = handler.Background;
 }
Esempio n. 18
0
 public override void Set(RipHandler handler, bool forDrawing)
 {
     isUserStyle = handler.FillStyle == BGICanvas.FillStyle.User;
     Pattern     = handler.FillPattern;
     Color       = handler.Background;
 }
Esempio n. 19
0
 public override void Set(RipHandler handler, bool forDrawing)
 {
     this.Color = handler.Background;
     this.Style = handler.FillStyle;
 }