void AddStringTrack(SvgWidget widget, object newValue, object delta) { var track = new TLStringTrack(FTrackCount++.ToString()); track.Order.Value = Document.Tracks.Count; History.Insert(Command.Add(Document.Tracks, track)); }
void ChangeTrackMenuEntry(SvgWidget editor, object newValue, object delta) { var cmds = new CompoundCommand(); SendValue(ref cmds, TrackMenuDict[editor], editor.Name, delta); History.Insert(cmds); }
void ChangeKeyframeText(SvgWidget widget, object newValue, object delta) { var cmds = new CompoundCommand(); foreach (var kf in Keyframes.Where(x => x.Model.Selected.Value)) { cmds.Append(Command.Set(kf.Model.Text, (string)newValue)); } History.Insert(cmds); }
void ChangeKeyframeMenuEntry(SvgWidget editor, object newValue, object delta) { var cmds = new CompoundCommand(); foreach (var track in Parent.Document.Tracks) { foreach (var kf in track.KeyframeModels.Where(x => x.Selected.Value)) { SendValue(ref cmds, kf, editor.Name, delta); } } History.Insert(cmds); }
public void CollapseTrack(SvgWidget editor, object newValue, object delta) { var newHeight = 0f; if (Model.Height.Value > Model.CollapsedHeight) { Model.UncollapsedHeight.Value = Model.Height.Value; newHeight = Model.CollapsedHeight; } else { newHeight = Model.UncollapsedHeight.Value; } History.Insert(Command.Set(Model.Height, newHeight)); }
public void AddItem(SvgWidget item, int order) { if (item is SvgButtonWidget) (item as SvgButtonWidget).ValueChanged += item_OnButtonPressed; item.Transforms = new SvgTransformCollection(); item.Transforms.Add(new SvgTranslate(0, 0)); item.Width = FWidth; MenuEntries.Add(item.Name, item); order = Math.Min(Children.Count-1, order); this.Children.Insert(order, item); //update entry positions FHeight = 0; foreach (var entry in Children.Where(x => x is SvgWidget)) { entry.Transforms[0] = new SvgTranslate(0, FHeight); FHeight += (entry as SvgWidget).Height; } }
public void AddItem(SvgWidget item, int order) { if (item is SvgButtonWidget) { (item as SvgButtonWidget).ValueChanged += item_OnButtonPressed; } item.Transforms = new SvgTransformCollection(); item.Transforms.Add(new SvgTranslate(0, 0)); item.Width = FWidth; MenuEntries.Add(item.Name, item); order = Math.Min(Children.Count - 1, order); this.Children.Insert(order, item); //update entry positions FHeight = 0; foreach (var entry in Children.Where(x => x is SvgWidget)) { entry.Transforms[0] = new SvgTranslate(0, FHeight); FHeight += (entry as SvgWidget).Height; } }
void item_OnButtonPressed(SvgWidget widget, object newValue, object delta) { Hide(); }
void RemoveTrack(SvgWidget widget, object newValue, object delta) { History.Insert(Command.Remove(Parent.Document.Tracks, Model)); }
void ChangeTrackMenuEntry(SvgWidget editor, object newValue, object delta) { var cmds = new CompoundCommand(); SendValue(ref cmds, TrackMenuDict[editor], editor.Name, newValue); History.Insert(cmds); }
void ChangeKeyframeText(SvgWidget widget, object newValue, object delta) { var cmds = new CompoundCommand(); foreach(var kf in Keyframes.Where(x => x.Model.Selected.Value)) cmds.Append(Command.Set(kf.Model.Text, (string) newValue)); History.Insert(cmds); }
void ChangeKeyframeMenuEntry(SvgWidget editor, object newValue, object delta) { var cmds = new CompoundCommand(); foreach (var track in Parent.Document.Tracks) foreach (var kf in track.KeyframeModels.Where(x => x.Selected.Value)) SendValue(ref cmds, kf, editor.Name, delta); History.Insert(cmds); }
public void CollapseTrack(SvgWidget editor, object newValue, object delta) { var newHeight = 0f; if (Model.Height.Value > Model.CollapsedHeight) { Model.UncollapsedHeight.Value = Model.Height.Value; newHeight = Model.CollapsedHeight; } else newHeight = Model.UncollapsedHeight.Value; History.Insert(Command.Set(Model.Height, newHeight)); }