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)); }
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)); }
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)); }
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; }
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; } } }
protected override void DrawBoxHasBeenAdded(DrawBox box, SlotBox.SlotHandler handler) { base.DrawBoxHasBeenAdded(box, handler); SelectDrawBox(box); }