Exemplo n.º 1
0
        protected override Services.ViewRect GenerateSlotBoundaries(SlotBox.SlotHandler slotId, int newWidth, int newHeight)
        {
            if (slotId.DrawBox == Scrollbar)
            {
                return(new Services.ViewRect(RealX + Width - Scrollbar.Width, RealY, Scrollbar.Width, Scrollbar.Height));
            }

            return(base.GenerateSlotBoundaries(slotId, newWidth - Scrollbar.Width, newHeight));
        }
Exemplo n.º 2
0
        protected override Origin GenerateChildOrigin(SlotBox.SlotHandler id)
        {
            if (id.DrawBox != Scrollbar && Scrollbar.MaxValue != 0)
            {
                return(new Origin(0, (int)Math.Round(-(highestY - Height) * ((float)Scrollbar.ScrollerPosition / Scrollbar.MaxValue), 0)));
            }

            return(base.GenerateChildOrigin(id));
        }
Exemplo n.º 3
0
        protected override ViewRect GenerateSlotBoundaries(SlotBox.SlotHandler handler, int newWidth, int newHeight)
        {
            if (handler == leftSlot)
            {
                return(new ViewRect(RealX, RealY, BorderPositon - 1, newHeight));
            }
            if (handler == rightSlot)
            {
                return(new ViewRect(RealX + BorderPositon + BorderSize - 1, RealY, newWidth - BorderPositon, newHeight));
            }

            return(base.GenerateSlotBoundaries(handler, newWidth, newHeight));
        }
Exemplo n.º 4
0
        protected override void DrawBoxHasBeenAdded(DrawBox box, SlotBox.SlotHandler handler)
        {
            base.DrawBoxHasBeenAdded(box, handler);

            foreach (var d in DrawBoxList)
            {
                if (d.Y + d.Height > highestY)
                {
                    highestY = d.Y + d.Height;
                }
            }

            Scrollbar.Height   = Height;
            Scrollbar.MaxValue = highestY - Height;
        }
Exemplo n.º 5
0
        protected override void DrawBoxHasBeenRemoved(DrawBox box, SlotBox.SlotHandler handler)
        {
            base.DrawBoxHasBeenRemoved(box, handler);

            if (DrawBoxList.Count != 0)
            {
                SelectDrawBox(DrawBoxList[0]);
            }

            foreach (var pair in drawBoxesWithKey)
            {
                if (pair.Value == box)
                {
                    drawBoxesWithKey.Remove(pair.Key);
                    break;
                }
            }
        }
Exemplo n.º 6
0
        protected override void DrawBoxHasBeenAdded(DrawBox box, SlotBox.SlotHandler handler)
        {
            base.DrawBoxHasBeenAdded(box, handler);

            SelectDrawBox(box);
        }