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; }
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; }
public Animate(RipHandler handler) { //this.handler = handler; ID = ActionID; MenuText = "Animate"; Shortcut = Keys.Alt | Keys.A; }
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(); }
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; }
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; }
public override void Set(RipHandler handler, bool forDrawing) { if (forDrawing) { Mode = BGICanvas.WriteMode.Xor; } else { Mode = BGICanvas.WriteMode.Copy; } }
public override void Set(RipHandler handler, bool forDrawing) { if (forDrawing && (handler.BGI.Palette[handler.Foreground].ToArgb() & 0xFFFFFF) == 0) { Value = 7; } else { Value = handler.Foreground; } }
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; }
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; }
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; }
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(); }
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 }; } }
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; }
public override void Set(RipHandler handler, bool forDrawing) { this.Font = handler.FontType; this.Direction = handler.TextDirection; this.CharacterSize = handler.FontSize; }
public SendCommands(RipHandler handler) { this.handler = handler; }
public override void Set(RipHandler handler, bool forDrawing) { this.Value = handler.Background; }
public override void Set(RipHandler handler, bool forDrawing) { isUserStyle = handler.FillStyle == BGICanvas.FillStyle.User; Pattern = handler.FillPattern; Color = handler.Background; }
public override void Set(RipHandler handler, bool forDrawing) { this.Color = handler.Background; this.Style = handler.FillStyle; }