public void ShowVisual(Visual visual) { lock (_visuals) { _visuals = visual | _visuals; _control.Visual = Visual.VStack (HAlign.Left, _visuals.Collect (v => List.Create (v, Visual.HRuler ()))); Invalidate (); } }
public void ShowVisual(Visual visual) { lock (_visuals) { _visuals.Add (visual); Control.Visual = Visual.VStack (HAlign.Left, _visuals.SelectMany (v => new Visual[] { v, Visual.HRuler () })); Invalidate (); } }
public _Frame(Visual visual, FrameKind kind, bool filled) : base(visual) { Kind = kind; Filled = filled; }
/// <summary> /// Create an anchor around a visual to act as a target of a connector. /// </summary> public static Visual Anchor(Visual visual, HAlign horizAlign, VAlign vertAlign) { return new _Anchor (visual, horizAlign, vertAlign); }
public _Connector(Visual visual, _Anchor target, VisualDirection direction, HAlign horizAlign, VAlign vertAlign, ConnectorKind kind) : base(visual, horizAlign, vertAlign) { Target = target; Direction = direction; Kind = kind; }
public _Styled(Visual visual, VisualStyle style) : base(visual) { Style = style; }
public void ShowVisual(Visual visual) { lock (_visuals) { _visuals.Add(visual); Control.Visual = Visual.VStack(HAlign.Left, _visuals.SelectMany(v => new Visual[] { v, Visual.HRuler() })); Invalidate(); } }
/// <summary> /// Draws a connector between visuals. The target visual must be wrapped by an /// anchor in order to draw a connector to it. /// </summary> public static Visual Connector(Visual visual, Visual target, VisualDirection direction, HAlign horizAlign, VAlign vertAlign, ConnectorKind kind = ConnectorKind.Line) { if (!(target is _Anchor)) throw new ArgumentException ("Target visual must be surronded by an anchor", "target"); return new _Connector(visual, target as _Anchor, direction, horizAlign, vertAlign, kind); }
public static Visual Margin(Visual visual, float margin) { return new _Margin (visual, margin, margin, margin, margin); }
/// <summary> /// Create a margin with a width of n X characters. /// </summary> public static Visual Margin(Visual visual, float left = 0, float right = 0, float top = 0, float bottom = 0) { return new _Margin (visual, left, right, top, bottom); }
/// <summary> /// Draws first a paragraph with a header and indented body. The amount /// of indentation is given as the last parameter. /// </summary> public static Visual Indented(Visual header, Visual body, int indent) { return VStack (HAlign.Left, header, Margin (body, left: indent)); }
/// <summary> /// Hide a visual. /// </summary> public static Visual Hidden(Visual visual) { return new _Hidden (visual); }
public _Wrapped(Visual visual) { Visual = visual; }
/// <summary> /// Frame a visual with a rectangle. /// </summary> public static Visual Frame(Visual visual, FrameKind kind, bool filled = false) { return new _Frame (visual, kind, filled); }
public static Visual Clickable(Visual visual, Action<RectangleF> setClickRegion) { return new _Clickable (visual, setClickRegion); }
public _Hidden(Visual visual) : base(visual) { }
/// <summary> /// Surrond a visual horizontally by parentheses. /// </summary> /// <param name="v"></param> /// <returns></returns> public static Visual Parenthesize(Visual v) { return HStack (VAlign.Top, Label ("("), v, Label (")")); }
public _Margin(Visual visual, float left, float right, float top, float bottom) : base(visual) { Left = left; Right = right; Top = top; Bottom = bottom; }
public static Visual Styled(Visual visual, VisualStyle style) { return new _Styled (visual, style); }
public Label(Visual visual) { Visual = visual; }
public _Anchor(Visual visual, HAlign horizAlign, VAlign vertAlign) : base(visual) { HorizAlign = horizAlign; VertAlign = vertAlign; }
public override Visual ToVisual(SizeF panelSize) { _anchor = Visual.Anchor (Source.ToVisual (panelSize), HorizAlign, VertAlign); return _anchor; }
public _Clickable(Visual visual, Action<RectangleF> setClickRegion) : base(visual) { SetClickRegion = setClickRegion; }