Exemple #1
0
 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 ();
     }
 }
Exemple #2
0
 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 ();
     }
 }
Exemple #3
0
 public _Frame(Visual visual, FrameKind kind, bool filled)
     : base(visual)
 {
     Kind = kind;
     Filled = filled;
 }
Exemple #4
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);
 }
Exemple #5
0
            public _Connector(Visual visual, _Anchor target, VisualDirection direction, 
				HAlign horizAlign, VAlign vertAlign, ConnectorKind kind)
                : base(visual, horizAlign, vertAlign)
            {
                Target = target;
                Direction = direction;
                Kind = kind;
            }
Exemple #6
0
 public _Styled(Visual visual, VisualStyle style)
     : base(visual)
 {
     Style = style;
 }
Exemple #7
0
 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();
     }
 }
Exemple #8
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, 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);
        }
Exemple #9
0
 public static Visual Margin(Visual visual, float margin)
 {
     return new _Margin (visual, margin, margin, margin, margin);
 }
Exemple #10
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);
        }
Exemple #11
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));
 }
Exemple #12
0
 /// <summary>
 /// Hide a visual.
 /// </summary>
 public static Visual Hidden(Visual visual)
 {
     return new _Hidden (visual);
 }
Exemple #13
0
 public _Wrapped(Visual visual)
 {
     Visual = visual;
 }
Exemple #14
0
 /// <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);
 }
Exemple #15
0
 public static Visual Clickable(Visual visual, Action<RectangleF> setClickRegion)
 {
     return new _Clickable (visual, setClickRegion);
 }
Exemple #16
0
 public _Hidden(Visual visual)
     : base(visual)
 {
 }
Exemple #17
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 (")"));
 }
Exemple #18
0
 public _Margin(Visual visual, float left, float right, float top, float bottom)
     : base(visual)
 {
     Left = left;
     Right = right;
     Top = top;
     Bottom = bottom;
 }
Exemple #19
0
 public static Visual Styled(Visual visual, VisualStyle style)
 {
     return new _Styled (visual, style);
 }
Exemple #20
0
 public Label(Visual visual)
 {
     Visual = visual;
 }
Exemple #21
0
 public _Anchor(Visual visual, HAlign horizAlign, VAlign vertAlign)
     : base(visual)
 {
     HorizAlign = horizAlign;
     VertAlign = vertAlign;
 }
Exemple #22
0
 public override Visual ToVisual(SizeF panelSize)
 {
     _anchor = Visual.Anchor (Source.ToVisual (panelSize), HorizAlign, VertAlign);
     return _anchor;
 }
Exemple #23
0
 public _Clickable(Visual visual, Action<RectangleF> setClickRegion)
     : base(visual)
 {
     SetClickRegion = setClickRegion;
 }