public void SetRectangleMode(RectangleMode mode) { _jsRuntime.InvokeVoid( _p5InvokeFunction, "rectMode", Rectangle.ToString(mode) ); }
internal Style(Font font, Pen pen, SolidBrush brush, SolidBrush textBrush, StringFormat format, RectangleMode rectMode, ImageMode imageMode, LineCap strokeMode, DBColorMode colorMode, bool fill) { Font = new Font(font.FontFamily, font.Size); Pen = new Pen(pen.Color, pen.Width); Brush = new SolidBrush(brush.Color); TextBrush = new SolidBrush(textBrush.Color); Format = new StringFormat(); Format.LineAlignment = format.LineAlignment; Format.Alignment = format.Alignment; RectMode = rectMode; ImageMode = imageMode; StrokeMode = strokeMode; ColorMode = colorMode; Fill = fill; }
public virtual void LoadFrom(MyReader mr) { bool isRect = mr.LoadBool(); if (isRect && ShowShape is CircleMode) { ShowShape = new RectangleMode(); } else if (!isRect && ShowShape is RectangleMode) { ShowShape = new CircleMode(); } ShowShape.X = mr.LoadInt(); ShowShape.Y = mr.LoadInt(); ShowShape.Width = mr.LoadInt(); ShowShape.Height = mr.LoadInt(); ShowShape.Angle = mr.LoadDouble(); mr.LoadLineEnd(); foreach (var item in uis) { item.LoadFrom(mr); } mr.LoadLineEnd(); }
public void SetRectangleMode(RectangleMode mode) { RectangleMode = mode; }
public void SetRectangleMode(RectangleMode mode) { ((IStyle)Style).SetRectangleMode(mode); }
public SubBoard() { ShowShape = new RectangleMode(500, 500); initialize(); }
/// <summary> /// Creates a rectangle. /// </summary> public GuiRect(RectangleMode mode, GuiVector2 arg1, GuiVector2 arg2) { this.mode = mode; this.arg1 = arg1; this.arg2 = arg2; }
public void Parse(CompileContext context, Stack <Token> stream) { // We have following parsing: // [Type:]GuiVector2, GuiVector2 // where Type = MinMax | LeftBottomAndSize | RightBottomAndSize | LeftTopAndSize | RightTopAndSize // We first check for type. Token token = stream.Pop(); RectangleMode mode = RectangleMode.MinMax; if (token.TokenId == TokenId.Identifier) { string id = token.Identifier; switch (id.ToLower()) { case "minmax": mode = RectangleMode.MinMax; break; case "leftbottomandsize": mode = RectangleMode.LeftBottomAndSize; break; case "rightbottomandsize": mode = RectangleMode.RightBottomAndSize; break; case "lefttopandsize": mode = RectangleMode.LeftTopAndSize; break; case "righttopandsize": mode = RectangleMode.RightTopAndSize; break; default: stream.Push(token); throw new ParseException("Expected a valid type identifier for rectangle."); } token = stream.Pop(); if (token.TokenId != TokenId.Colon) { stream.Push(token); throw new ParseException("If specifier for rectangle is used, it must be followed by ':'."); } token = stream.Pop(); } stream.Push(token); ASTVector2 v1 = new ASTVector2(), v2 = new ASTVector2(); v1.Parse(context, stream); token = stream.Pop(); if (token.TokenId != TokenId.Comma) { stream.Push(token); throw new ParseException("Comma expected to seperate vectors in rectangle."); } v2.Parse(context, stream); // We now apply data. rectangle = new GuiRect(mode, v1.Vector, v2.Vector); }