Пример #1
0
        public override void Layout(ISystemContext ctxt, Point pos, Size space)
        {
            base.Layout(ctxt, pos, space);
            Size  myPreferredISize = PreferredSize;
            int   pad  = (int)(space.Height - myPreferredISize.Height) / Children.Count;
            float yAcc = 0;

            foreach (var tuple in Children)
            {
                IComponent comp      = tuple.Item1;
                Size       compISize = comp.PreferredSize;
                float      w         = compISize.Width;
                float      h         = compISize.Height;

                if (ExpandChildenHorizontally)
                {
                    w = myPreferredISize.Width;
                }

                if (ExpandChildrenVertically)
                {
                    h += pad;
                }

                comp.Layout(ctxt, new Point(0, yAcc),
                            new Size(w, h));
                ctxt.Log("comp Size H =" + comp.Size.Height);
                yAcc += comp.Size.Height;
            }
        }
Пример #2
0
 public override void Layout(ISystemContext ctxt, Point pos, Size space)
 {
     base.Layout(ctxt, pos, space);
     ctxt.Log("layout at " + pos.X + "," + pos.Y);
     ctxt.Log("size= " + Size.Width + "," + Size.Height);
 }
Пример #3
0
 public virtual void Layout(ISystemContext ctxt, Point pos, Size space)
 {
     ctxt.Log("!!!in Abstract Layout");
     Position = pos;
     Size     = space;
 }