[longomatch] Make tag buttons from the same group act as radio buttons



commit 0ca7c5d2e19649900f6612020ec3761bd0d5071b
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Oct 24 17:59:11 2014 +0200

    Make tag buttons from the same group act as radio buttons

 LongoMatch.Drawing/Widgets/DashboardCanvas.cs |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.Drawing/Widgets/DashboardCanvas.cs b/LongoMatch.Drawing/Widgets/DashboardCanvas.cs
index 625d53e..d454a41 100644
--- a/LongoMatch.Drawing/Widgets/DashboardCanvas.cs
+++ b/LongoMatch.Drawing/Widgets/DashboardCanvas.cs
@@ -318,6 +318,20 @@ namespace LongoMatch.Drawing.Widgets
                        Score score = null;
                        
                        tagger = co as TaggerObject;
+                       
+                       if (tagger is TagObject) {
+                               TagObject tag = tagger as TagObject;
+                               if (tag.Active) {
+                                       /* All tag buttons from the same group that are active */
+                                       foreach (TagObject to in Objects.OfType<TagObject>().
+                                                Where (t => t.TagButton.Tag.Group == tag.TagButton.Tag.Group 
&&
+                                              t.Active && t != tagger)) {
+                                               to.Active = false;
+                                       }
+                               }
+                               return;
+                       }
+
                        if (NewTagEvent == null || !(tagger.Tagger is EventButton)) {
                                return;
                        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]