public SportDashboardCanvas(IWidget widget) : base(widget) { Accuracy = 5; Mode = DashboardMode.Edit; FitMode = FitMode.Fit; CurrentTime = new Time (0); AddTag = new Tag ("", ""); BackgroundColor = App.Current.Style.PaletteBackground; }
public void ClickButton(DashboardButton button, Tag tag = null) { tagger.Click (button, tag); }
public void FilterEventTag(EventType evType, Tag tag, bool visible) { List<Tag> tags; if (visible) { FilterEventType (evType, true); tags = eventsFilter [evType]; if (!tags.Contains (tag)) tags.Add (tag); } else { if (eventsFilter.ContainsKey (evType)) { tags = eventsFilter [evType]; if (tags.Contains (tag)) tags.Remove (tag); } } Update (); }
public void FilterTag(Tag tag, bool visible) { if (visible) { if (!tagsFilter.Contains (tag)) tagsFilter.Add (tag); } else { if (tagsFilter.Contains (tag)) tagsFilter.Remove (tag); } }
public void ClickButton(DashboardButton button, Tag tag = null) { codingwidget.ClickButton (button, tag); }
void AddTagsGroup(TimelineEventLongoMatch evt, string grp, List<Tag> tags, SizeGroup sgroup) { HBox box = new HBox (); Label label = new Label (String.IsNullOrEmpty (grp) ? Catalog.GetString ("Common tags") : grp); Table tagstable = new Table ((uint)(tags.Count / TAGS_PER_ROW), TAGS_PER_ROW, true); RadioButton first = null; Tag noneTag = new Tag (Catalog.GetString ("None")); label.WidthRequest = 200; if (!String.IsNullOrEmpty (grp)) { tags.Insert (0, noneTag); } for (int i = 0; i < tags.Count; i++) { uint row_top, row_bottom, col_left, col_right; Tag t = tags [i]; CheckButton tb; if (String.IsNullOrEmpty (grp)) { tb = new CheckButton (t.Value); } else { if (first == null) { tb = first = new RadioButton (t.Value); } else { tb = new RadioButton (first, t.Value); } } tb.Active = evt.Tags.Contains (t); tb.Toggled += (sender, e) => { if (tb.Active && t != noneTag) { evt.Tags.Add (t); } else { evt.Tags.Remove (t); } }; row_top = (uint)(i / tagstable.NColumns); row_bottom = (uint)row_top + 1; col_left = (uint)i % tagstable.NColumns; col_right = (uint)col_left + 1; tagstable.Attach (tb, col_left, col_right, row_top, row_bottom); } sgroup.AddWidget (label); box.PackStart (label, false, true, 0); box.PackEnd (tagstable, true, true, 0); box.Spacing = 5; tagsvbox.PackStart (box, false, true, 0); tagsvbox.PackStart (new HSeparator ()); }
void RemoveTag(Tag tag, TagsGroup g) { string msg = Catalog.GetString ("Do you want to remove this tag?"); if (Config.GUIToolkit.QuestionMessage (msg, null, this)) { EventType.Tags.Remove (tag); g.tags.Remove (tag); g.container.Remove (g.table); g.container.PackStart (CreateTagsTable (g), true, true, 0); g.container.ShowAll (); } }
void AddTag(TagsGroup g) { Tag t = new Tag (Catalog.GetString ("New tag"), g.nameEntry.Text); EventType.Tags.Add (t); g.tags.Add (t); g.container.Remove (g.table); g.container.PackStart (CreateTagsTable (g), true, true, 0); g.container.ShowAll (); if (focusEntry != null) { focusEntry.GrabFocus (); } }
void CreateTagBox(Table t, Tag tag, int i, TagsGroup g) { HBox box = new HBox (false, 2); Entry tagEntry = new Entry (tag.Value); Label hotkeyLabel = new Label (tag.HotKey.ToString ()); Button editHK = Button ("gtk-edit"); Button b = Button ("gtk-remove"); b.Clicked += (sender, e) => RemoveTag (tag, g); editHK.Clicked += (sender, e) => { HotKey hotkey = Config.GUIToolkit.SelectHotkey (tag.HotKey); if (hotkey != null) { try { if (EventType.Tags.Select (tt => tt.HotKey).Contains (hotkey)) { throw new HotkeyAlreadyInUse (hotkey); } tag.HotKey = hotkey; hotkeyLabel.Text = hotkey.ToString (); } catch (HotkeyAlreadyInUse ex) { Config.GUIToolkit.ErrorMessage (ex.Message, this); } } }; tagEntry.Changed += (o, e) => { tag.Value = tagEntry.Text; }; focusEntry = tagEntry; box.PackStart (tagEntry, false, false, 0); box.PackStart (hotkeyLabel, false, false, 0); box.PackStart (editHK, false, false, 0); box.PackStart (b, false, false, 0); InsertInTable (t, box, i); }
void FillTags(Project project, TimelineEvent evt) { Dictionary<string, List<Tag>> tagsByGroup; SizeGroup sgroup = new SizeGroup (SizeGroupMode.Horizontal); if (evt.EventType is AnalysisEventType) { tagsByGroup = (evt.EventType as AnalysisEventType).TagsByGroup; } else { tagsByGroup = new Dictionary<string, List<Tag>> (); } tagsByGroup = tagsByGroup.Concat (project.Dashboard.CommonTagsByGroup) .ToDictionary (x => x.Key, x => x.Value); tagsvbox.PackStart (new HSeparator ()); foreach (string grp in tagsByGroup.Keys) { HBox box = new HBox (); Label label = new Label (String.IsNullOrEmpty (grp) ? Catalog.GetString ("Common tags") : grp); List<Tag> tags = tagsByGroup [grp]; Table tagstable = new Table ((uint)(tags.Count / TAGS_PER_ROW), TAGS_PER_ROW, true); RadioButton first = null; Tag noneTag = new Tag (Catalog.GetString ("None")); label.WidthRequest = 200; if (!String.IsNullOrEmpty (grp)) { tags.Insert (0, noneTag); } for (int i = 0; i < tags.Count; i++) { uint row_top, row_bottom, col_left, col_right; Tag t = tags [i]; CheckButton tb; if (String.IsNullOrEmpty (grp)) { tb = new CheckButton (t.Value); } else { if (first == null) { tb = first = new RadioButton (t.Value); } else { tb = new RadioButton (first, t.Value); } } tb.Active = evt.Tags.Contains (t); tb.Toggled += (sender, e) => { if (tb.Active && t != noneTag) { evt.Tags.Add (t); } else { evt.Tags.Remove (t); } }; row_top = (uint)(i / tagstable.NColumns); row_bottom = (uint)row_top + 1; col_left = (uint)i % tagstable.NColumns; col_right = (uint)col_left + 1; tagstable.Attach (tb, col_left, col_right, row_top, row_bottom); } sgroup.AddWidget (label); box.PackStart (label, false, true, 0); box.PackEnd (tagstable, true, true, 0); box.Spacing = 5; tagsvbox.PackStart (box, false, true, 0); tagsvbox.PackStart (new HSeparator ()); } tagsvbox.ShowAll (); }
void TagClicked(Tag tag) { if (SelectedTags.Contains (tag)) { SelectedTags.Remove (tag); } else { SelectedTags.RemoveAll (t => t.Group == tag.Group); SelectedTags.Add (tag); } if (Button.TagMode == TagMode.Free) { StartRecording (); } else { Active = true; delayEvent = true; } ReDraw (); }
void AddSubcatAnchor(Tag tag, Point point, double width, double height) { LinkAnchorObject anchor; if (subcatAnchors.ContainsKey (tag)) { anchor = subcatAnchors [tag]; anchor.RelativePosition = point; } else { anchor = new LinkAnchorObject (this, new List<Tag> { tag }, point); anchor.RedrawEvent += (co, area) => { EmitRedrawEvent (anchor, area); }; subcatAnchors.Add (tag, anchor); } anchor.Width = width; anchor.Height = height; }
public void ClickTag(Tag tag) { SelectedTags.Add (tag); ReDraw (); }