Beispiel #1
0
 /// <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, HAlign horizAlign, VAlign vertAlign)
 {
     if (!(target is _Anchor))
         throw new ArgumentException ("Target visual must be surronded by an anchor", "target");
     return new _Connector(visual, target as _Anchor, horizAlign, vertAlign);
 }
Beispiel #2
0
 public _Wrapped(Visual visual)
 {
     Visual = visual;
 }
Beispiel #3
0
 /// <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);
 }
Beispiel #4
0
 public _Styled(Visual visual, VisualStyle style)
     : base(visual)
 {
     Style = style;
 }
Beispiel #5
0
 public _Hidden(Visual visual)
     : base(visual)
 {
 }
Beispiel #6
0
 public _Margin(Visual visual, float left, float right, float top, float bottom)
     : base(visual)
 {
     Left = left;
     Right = right;
     Top = top;
     Bottom = bottom;
 }
Beispiel #7
0
 public _Connector(Visual visual, _Anchor target, HAlign horizAlign, VAlign vertAlign)
     : base(visual, horizAlign, vertAlign)
 {
     Target = target;
 }
Beispiel #8
0
 public _Frame(Visual visual, FrameKind kind)
     : base(visual)
 {
     Kind = kind;
 }
Beispiel #9
0
 /// <summary>
 /// Map a list of S-expressions to a sequence of visuals interlaved with a separator.
 /// </summary>
 private static StrictList<Visual> FromSExpList(IStream<SExpr> sexps, Visual separator)
 {
     if (sexps.IsEmpty)
         return StrictList<Visual>.Empty;
     if (sexps.Rest.IsEmpty)
         return List.Create (Depiction (sexps.First));
     return Depiction (sexps.First) | (separator | FromSExpList (sexps.Rest, separator));
 }
Beispiel #10
0
 public _Anchor(Visual visual, HAlign horizAlign, VAlign vertAlign)
     : base(visual)
 {
     HorizAlign = horizAlign;
     VertAlign = vertAlign;
 }
Beispiel #11
0
 /// <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 (")"));
 }
Beispiel #12
0
        /// <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);
        }
Beispiel #13
0
 /// <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));
 }
Beispiel #14
0
 /// <summary>
 /// Hide a visual.
 /// </summary>
 public static Visual Hidden(Visual visual)
 {
     return new _Hidden (visual);
 }
Beispiel #15
0
 /// <summary>
 /// Frame a visual with a rectangle.
 /// </summary>
 public static Visual Frame(Visual visual, FrameKind kind)
 {
     return new _Frame (visual, kind);
 }