private void listKeyframes_SelectedIndexChanged(object sender, EventArgs e) { int index = listKeyframes.SelectedIndex; if (index >= 0) { FloatKeyframe f = (FloatKeyframe)listKeyframes.SelectedItem; numFrame.Value = f.Index + 1; } }
private unsafe void BoxChanged(object sender, EventArgs e) { NumericInputBox box = sender as NumericInputBox; FloatKeyframe kf; float val = box.Value / 100.0f; int index = (int)box.Tag; int x; if (val != _currentValue) { int kfIndex = FindKeyframe(_currentPage); if (float.IsNaN(val)) { if (kfIndex >= 0) { listKeyframes.Items.RemoveAt(kfIndex); listKeyframes.SelectedIndex = -1; } _target.RemoveKeyframe(_currentPage); val = _target.Keyframes.GetFrameValue(_currentPage); box.Value = val * 100.0f; } else { if (kfIndex >= 0) { kf = (FloatKeyframe)listKeyframes.Items[kfIndex]; kf.Value = val; listKeyframes.Items[kfIndex] = kf; } else { kf = new FloatKeyframe(); kf.Index = _currentPage; kf.Value = val; int count = listKeyframes.Items.Count; for (x = 0; (x < count) && (((FloatKeyframe)listKeyframes.Items[x]).Index < _currentPage); x++) { ; } listKeyframes.Items.Insert(x, kf); listKeyframes.SelectedIndex = x; } _target.SetKeyframe(_currentPage, val); } _currentValue = val; UpdateBox(index); } }
private unsafe void BoxChanged(object sender, EventArgs e) { NumericInputBox box = sender as NumericInputBox; FloatKeyframe kf; float val = box.Value / 100.0f; int index = (int)box.Tag; int x; if (val != _currentValue) { int kfIndex = FindKeyframe(_currentPage); if (float.IsNaN(val)) { if (kfIndex >= 0) { listKeyframes.Items.RemoveAt(kfIndex); listKeyframes.SelectedIndex = -1; } _target.RemoveKeyframe(_currentPage); val = _target.Keyframes.GetFrameValue(_currentPage); box.Value = val * 100.0f; } else { if (kfIndex >= 0) { kf = (FloatKeyframe)listKeyframes.Items[kfIndex]; kf.Value = val; listKeyframes.Items[kfIndex] = kf; } else { kf = new FloatKeyframe(); kf.Index = _currentPage; kf.Value = val; int count = listKeyframes.Items.Count; for (x = 0; (x < count) && (((FloatKeyframe)listKeyframes.Items[x]).Index < _currentPage); x++) ; listKeyframes.Items.Insert(x, kf); listKeyframes.SelectedIndex = x; } _target.SetKeyframe(_currentPage, val); } _currentValue = val; UpdateBox(index); } }