diff --git a/DMX-2.0/EventManager.cs b/DMX-2.0/EventManager.cs index a1cd9fd..2f2679f 100644 --- a/DMX-2.0/EventManager.cs +++ b/DMX-2.0/EventManager.cs @@ -87,6 +87,7 @@ namespace DMX2 bool CanFeedback{ get; } void AddFeedback(IFeedbackInfo info); + void ClearFeedBack(); } @@ -128,6 +129,8 @@ namespace DMX2 { throw new System.NotImplementedException (); } + void IEventTarget.ClearFeedBack(){ + } #endregion } @@ -179,6 +182,9 @@ namespace DMX2 void IEventTarget.Bind (string id){} // Rien a faire ici void IEventTarget.Unbind (string id){} bool IEventTarget.CanFeedback { get { return canfeedback; } } + void IEventTarget.ClearFeedBack(){ + fbInfos.Clear (); + } void IEventTarget.AddFeedback (IFeedbackInfo info) { fbInfos.Add(info); @@ -314,10 +320,11 @@ namespace DMX2 var q = from bind in bindings where bind.Value.Targets.Contains(target) select bind.Key; foreach(string id in q.ToArray()) Unbind(id,target); + target.ClearFeedBack (); } /// Desenregistrement d'une association id => cible - public void Unbind (string eventId, IEventTarget target) + void Unbind (string eventId, IEventTarget target) { if (!bindings.ContainsKey (eventId)) return; bindings [eventId].RemoveTarget (target); @@ -345,6 +352,17 @@ namespace DMX2 } } + public void ClearAll(){ + List targets = new List (); + foreach (var binding in bindings.Values) + foreach (var t in binding.Targets) + if (!targets.Contains (t)) + targets.Add (t); + foreach (var t in targets) { + Unbind (t); + } + } + public bool SaveBindings (System.Xml.XmlElement xmlParent, IEventTarget target) { bool ret=false; diff --git a/DMX-2.0/GestionMidiUI.cs b/DMX-2.0/GestionMidiUI.cs index 215a747..80afa71 100644 --- a/DMX-2.0/GestionMidiUI.cs +++ b/DMX-2.0/GestionMidiUI.cs @@ -206,6 +206,11 @@ namespace DMX2 { Conduite.Courante.Midi.Max14bValue = spinMax14b.ValueAsInt; } + + protected void OnBtnClearEventsClicked (object sender, EventArgs e) + { + Conduite.Courante.EventManager.ClearAll (); + } } } diff --git a/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs b/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs index 3728c52..c67b852 100644 --- a/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs @@ -36,6 +36,7 @@ namespace DMX2 private global::Gtk.Label label2; private global::Gtk.ScrolledWindow GtkScrolledWindow1; private global::Gtk.TreeView listKnown; + private global::Gtk.Button btnClearEvents; private global::Gtk.Button buttonClose; protected virtual void Build () @@ -333,6 +334,7 @@ namespace DMX2 this.vbox2.Spacing = 6; // Container child vbox2.Gtk.Box+BoxChild this.label1 = new global::Gtk.Label (); + this.label1.Name = "label1"; this.label1.Xalign = 0F; this.label1.LabelProp = "Interfaces disponibles :"; this.vbox2.Add (this.label1); @@ -400,6 +402,16 @@ namespace DMX2 w48.BorderWidth = ((uint)(5)); w48.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild + this.btnClearEvents = new global::Gtk.Button (); + this.btnClearEvents.CanFocus = true; + this.btnClearEvents.Name = "btnClearEvents"; + this.btnClearEvents.UseUnderline = true; + this.btnClearEvents.Label = "Delier tout les évenements"; + this.AddActionWidget (this.btnClearEvents, 0); + global::Gtk.ButtonBox.ButtonBoxChild w49 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w48 [this.btnClearEvents])); + w49.Expand = false; + w49.Fill = false; + // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonClose = new global::Gtk.Button (); this.buttonClose.CanDefault = true; this.buttonClose.CanFocus = true; @@ -408,9 +420,10 @@ namespace DMX2 this.buttonClose.UseUnderline = true; this.buttonClose.Label = "gtk-close"; this.AddActionWidget (this.buttonClose, -7); - global::Gtk.ButtonBox.ButtonBoxChild w49 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w48 [this.buttonClose])); - w49.Expand = false; - w49.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w50 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w48 [this.buttonClose])); + w50.Position = 1; + w50.Expand = false; + w50.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } @@ -428,6 +441,7 @@ namespace DMX2 this.spinMax14b.ValueChanged += new global::System.EventHandler (this.OnSpinMax14bValueChanged); this.chkPg.Toggled += new global::System.EventHandler (this.OnChkPgToggled); this.chkFourteenBits.Toggled += new global::System.EventHandler (this.OnChkFourteenBitsToggled); + this.btnClearEvents.Clicked += new global::System.EventHandler (this.OnBtnClearEventsClicked); this.buttonClose.Clicked += new global::System.EventHandler (this.OnButtonCloseClicked); } } diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 0400ede..dbd8b0b 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -5,7 +5,7 @@ 2.12 - + @@ -1822,7 +1822,6 @@ au sequenceur - True True @@ -2119,7 +2118,6 @@ au sequenceur - True @@ -3192,7 +3190,7 @@ trames DMX (ms) Connexions Midi CenterOnParent - 1 + 2 False @@ -3759,8 +3757,23 @@ trames DMX (ms) 10 5 - 1 + 2 End + + + + True + TextOnly + Delier tout les évenements + True + 0 + + + + False + False + + @@ -3774,6 +3787,7 @@ trames DMX (ms) gtk-close + 1 False False