void timelineSelectionBox_SelectionAreaDefined(TimelineSelectionBox source) { if (AddSelection.HeldDown) { foreach (TimelineViewTrack track in tracks) { track.addSelection(selectionCollection, source); } } else if (RemoveSelection.HeldDown) { foreach (TimelineViewTrack track in tracks) { track.removeSelection(selectionCollection, source); } } else { selectionCollection.clearSelection(); foreach (TimelineViewTrack track in tracks) { track.addSelection(selectionCollection, source); } } }
internal void addSelection(TimelineSelectionCollection selectionCollection, TimelineSelectionBox timelineSelectionBox) { foreach (TimelineViewButton button in buttons) { if (timelineSelectionBox.intersects(button)) { selectionCollection.addButton(button); } } }
public TimelineView(ScrollView scrollView) { timelineSelectionBox = new TimelineSelectionBox(scrollView); timelineSelectionBox.SelectionAreaDefined += new EventDelegate <TimelineSelectionBox>(timelineSelectionBox_SelectionAreaDefined); selectionCollection = new TimelineSelectionCollection(this); timelineScrollView = new TimelineScrollView(scrollView); scrollView.ClientWidget.MouseLostFocus += new MyGUIEvent(scrollView_MouseLostFocus); scrollView.MouseWheel += new MyGUIEvent(scrollView_MouseWheel); scrollView.KeyButtonPressed += new MyGUIEvent(scrollView_KeyButtonPressed); scrollView.KeyButtonReleased += new MyGUIEvent(scrollView_KeyButtonReleased); timelineMarker = new TimelineMarker(this, scrollView); timelineMarker.CoordChanged += new EventHandler(timelineMarker_CoordChanged); }