Exemplo n.º 1
0
        protected override GoObject CreateBody()
        {
            var container = new GoListGroup
            {
                Selectable        = false,
                BrushColor        = Color.White,
                Spacing           = 2,
                TopLeftMargin     = new SizeF(0, 0),
                BottomRightMargin = new SizeF(0, 2),
                Width             = DefaultWidth
            };

            GoListGroup header = new GoListGroup
            {
                Orientation  = Orientation.Horizontal,
                Selectable   = false,
                AutoRescales = false,
                Width        = DefaultWidth,
                Spacing      = 2
            };

            GoText headerText = new GoText
            {
                DragsNode      = true,
                Selectable     = false,
                Editable       = false,
                Wrapping       = false,
                AutoRescales   = false,
                AutoResizes    = false,
                StringTrimming = StringTrimming.EllipsisCharacter,
                FontSize       = 9,
                Width          = DefaultWidth - DefaultMargin,
                TextColor      = Color.White,
                Height         = 16 * Dpi.Factor.Height
            };

            header.Add(headerText);

            GoImage img = new GoImage
            {
                Selectable   = false,
                AutoRescales = false,
                AutoResizes  = false,
                Size         = new SizeF(16 * Dpi.Factor.Width, 16 * Dpi.Factor.Height),
                Visible      = false
            };

            header.Add(img);

            container.Add(header);

            GoListGroup items = new GoListGroup();

            items.Selectable = false;
            container.Add(items);

            return(container);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Create an empty-lookng node, containing no items and only the top and bottom ports.
 /// </summary>
 /// <remarks>
 /// The <see cref="P:Northwoods.Go.GoMultiTextNode.LinePen" /> and <see cref="P:Northwoods.Go.GoMultiTextNode.BorderPen" /> properties default to black pens.
 /// This constructs a <see cref="T:Northwoods.Go.GoListGroup" /> as the initial value for <see cref="P:Northwoods.Go.GoMultiTextNode.ListGroup" />.
 /// This calls <see cref="M:Northwoods.Go.GoMultiTextNode.CreateEndPort(System.Boolean)" /> to get initial values for both
 /// <see cref="P:Northwoods.Go.GoMultiTextNode.TopPort" /> and <see cref="P:Northwoods.Go.GoMultiTextNode.BottomPort" />.
 /// </remarks>
 public GoMultiTextNode()
 {
     base.Initializing      = true;
     myListGroup            = new GoMultiTextNodeListGroup();
     myListGroup.Selectable = false;
     myListGroup.LinePen    = GoShape.Pens_Black;
     myListGroup.BorderPen  = GoShape.Pens_Black;
     myListGroup.Alignment  = 1;
     Add(myListGroup);
     myTopPort = CreateEndPort(top: true);
     Add(myTopPort);
     myBottomPort = CreateEndPort(top: false);
     Add(myBottomPort);
     base.InternalFlags &= -17;
     base.Initializing   = false;
     LayoutChildren(null);
 }