Example #1
0
        public ResizableContainer()
        {
            var   borderColor = Colour4.Black;
            float borderSize  = 2f;

            AddInternal(new Box()
            {
                RelativeSizeAxes = Axes.Y, Width = borderSize, Colour = borderColor, Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft
            });
            AddInternal(new Box()
            {
                RelativeSizeAxes = Axes.Y, Width = borderSize, Colour = borderColor, Anchor = Anchor.TopRight, Origin = Anchor.TopRight
            });
            AddInternal(new Box()
            {
                RelativeSizeAxes = Axes.X, Height = borderSize, Colour = borderColor, Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft
            });
            AddInternal(new Box()
            {
                RelativeSizeAxes = Axes.X, Height = borderSize, Colour = borderColor, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft
            });

            AddInternal(TopRight    = CreateBox(Anchor.TopRight));
            AddInternal(BottomRight = CreateBox(Anchor.BottomRight));

            AddInternal(Right = CreateBox(Anchor.CentreRight));
            AddInternal(Left  = CreateBox(Anchor.CentreLeft));

            AddInternal(Top    = CreateBox(Anchor.TopCentre));
            AddInternal(Bottom = CreateBox(Anchor.BottomCentre));

            AddInternal(TopLeft    = CreateBox(Anchor.TopLeft));
            AddInternal(BottomLeft = CreateBox(Anchor.BottomLeft));
        }
Example #2
0
    private DraggableBox NewDraggableBox(Rect rect)
    {
        var box = new DraggableBox(rect);

        m_partsSelector.Register(box);
        m_partsDragger.Register(box);
        m_drawList.Add(box);

        return(box);
    }