public CursorController(TimelineController timeline) { state = CursorState.Hover; this.timeline = timeline; rectangleProvider = timeline.RectangleProvider; handler = new ControllerHandler(this); protoCursor = new Rectangle(); cursors = new List <Cursor>(); oldCursors = new List <Cursor>(); UpdateCache(); oldCursors.AddRange(cursors); timeline.TimelineZoomChanged += Timeline_TimelineZoomChanged; timeline.TimelineLengthChanged += Timeline_TimelineLengthChanged; timeline.LocationChanged += Timeline_LocationChanged; rectangleProvider.MouseDown += RectangleProvider_MouseDown; rectangleProvider.MouseMove += RectangleProvider_MouseMove; rectangleProvider.MouseUp += RectangleProvider_MouseUp; rectangleProvider.Paint += RectangleProvider_Paint; rectangleProvider.MouseEnter += RectangleProvider_MouseEnter; }
public Timeline() { InitializeComponent(); controller = new TimelineController(this, rectangleProvider1, 540); rectangleProvider1.TimelineController = controller; controller.SizeChanged += Timeline_SizeChanged; horizontalScrollBar.Minimum = 0; UpdateHorizontalScrollbar(); }
private void Initialize(TimelineController timeline) { layers = new List <LayerController>(); this.timeline = timeline; toggleLock = false; toggleVisibility = true; rectangleProvider = timeline.RectangleProvider; rectangleProvider.Paint += TimelineContent_Paint; rectangleProvider.Resize += TimelineContent_Resize; timeline.TimelineZoomChanged += Timeline_TimelineZoomChanged; timeline.TimelineLengthChanged += Timeline_TimelineLengthChanged; timeline.LocationChanged += Timeline_LocationChanged; BackColor = ColorProvider.GetRandomSliceColor(); SetId(); CreateLayer(); lockButton = new ButtonController(this, new Point( 5 + dragWidth + ButtonController.margin, padding + ButtonController.margin)); lockButton.ButtonClicked += LockButton_ButtonClicked; lockButton.Icon = Properties.Resources.open_lock; visibilityButton = new ButtonController(this, new Point( 5 + dragWidth + ButtonController.margin * 3 + ButtonController.width, padding + ButtonController.margin)); visibilityButton.ButtonClicked += VisibilityButton_ButtonClicked; visibilityButton.Icon = Properties.Resources.open_eye; addSliceButton = new ButtonController(this, new Point( 5 + dragWidth + ButtonController.margin, padding + ButtonController.margin * 3 + ButtonController.height)); addSliceButton.ButtonClicked += AddSliceButton_ButtonClicked; addSliceButton.Icon = Properties.Resources.plus; removeSliceButton = new ButtonController(this, new Point( 5 + dragWidth + ButtonController.margin * 3 + ButtonController.width, padding + ButtonController.margin * 3 + ButtonController.height)); removeSliceButton.ButtonClicked += RemoveSliceButton_ButtonClicked; removeSliceButton.Icon = Properties.Resources.minus; UpdateCache(); UpdateUI(); }
internal RulerController(TimelineController timeline) { this.timeline = timeline; rectangleProvider = timeline.RectangleProvider; oldRect = rectangleProvider.RulerContainerRectangle; oldScreenRect = GetScreenRectangle(); oldScroll = rectangleProvider.HorizontalScroll; rulerRectangle = new Rectangle(); UpdateCache(); if (ProjectFramerate == 24) { markPattern = new int[] { 20, 35, 30, 35, 25, 35, 30, 35 }; } else if (ProjectFramerate == 25) { markPattern = new int[] { 20, 35, 35, 35, 35, }; } else if (ProjectFramerate == 30) { markPattern = new int[] { 20, 35, 35, 35, 35, 30, 35, 35, 35, 35 }; } else { markPattern = new int[] { 25 }; } rectangleProvider.Paint += TimelineContent_Paint; rectangleProvider.Resize += TimelineContent_Resize; timeline.TimelineZoomChanged += Timeline_TimelineZoomChanged; timeline.TimelineLengthChanged += Timeline_TimelineLengthChanged; timeline.LocationChanged += TimelineContent_LocationChanged; UpdateUI(); }
internal SliceController(TimelineController timeline, int id) { this.id = id; Initialize(timeline); }
internal SliceController(TimelineController timeline) { id = timeline.SliceCount; Initialize(timeline); }