private void ReselectClipboardMenuItem_Click(object sender, EventArgs e) { TasView.DeselectAll(); foreach (var item in _tasClipboard) { TasView.SelectItem(item.Frame, true); } }
private void SelectBetweenMarkersMenuItem_Click(object sender, EventArgs e) { if (TasView.SelectedIndices().Any()) { var prevMarker = _tas.Markers.PreviousOrCurrent(LastSelectedIndex); var nextMarker = _tas.Markers.Next(LastSelectedIndex); int prev = prevMarker != null ? prevMarker.Frame : 0; int next = nextMarker != null ? nextMarker.Frame : _tas.InputLogLength; for (int i = prev; i < next; i++) { TasView.SelectItem(i, true); } } }
private void TasView_PointedCellChanged(object sender, TasListView.CellEventArgs e) { int startVal, endVal; if (e.OldCell.Row.Value < e.NewCell.Row.Value) { startVal = e.OldCell.Row.Value; endVal = e.NewCell.Row.Value; } else { startVal = e.NewCell.Row.Value; endVal = e.OldCell.Row.Value; } if (_startMarkerDrag) { if (e.NewCell.Row.HasValue) { GoToFrame(e.NewCell.Row.Value); } } else if (_startFrameDrag) { if (e.OldCell.Row.HasValue && e.NewCell.Row.HasValue) { for (var i = startVal + 1; i <= endVal; i++) { TasView.SelectItem(i, true); } } } else if (TasView.IsPaintDown && e.NewCell.Row.HasValue && !string.IsNullOrEmpty(_startBoolDrawColumn)) { if (e.OldCell.Row.HasValue && e.NewCell.Row.HasValue) { for (var i = startVal; i < endVal; i++) { SetBoolState(i, _startBoolDrawColumn, _boolPaintState); // Notice it uses new row, old column, you can only paint across a single column GoToLastEmulatedFrameIfNecessary(TasView.PointedCell.Row.Value); } TasView.Refresh(); } } else if (TasView.IsPaintDown && e.NewCell.Row.HasValue && !string.IsNullOrEmpty(_startFloatDrawColumn)) { if (e.OldCell.Row.HasValue && e.NewCell.Row.HasValue) { for (var i = startVal; i < endVal; i++) { if (i < _tas.InputLogLength) // TODO: how do we really want to handle the user setting the float state of the pending frame? { _tas.SetFloatState(i, _startFloatDrawColumn, _floatPaintState); // Notice it uses new row, old column, you can only paint across a single column GoToLastEmulatedFrameIfNecessary(TasView.PointedCell.Row.Value); } } TasView.Refresh(); } } }