diff --git a/DMX-2.0/Conduite.cs b/DMX-2.0/Conduite.cs index 57849e5..6e7221f 100644 --- a/DMX-2.0/Conduite.cs +++ b/DMX-2.0/Conduite.cs @@ -66,6 +66,13 @@ namespace DMX2 } } + public void AjoutSequenceur (Sequenceur seq) + { + lock (this) { + sequenceurs.Add(seq); + } + } + List univers; public List Patch { diff --git a/DMX-2.0/DMX-2.0.csproj b/DMX-2.0/DMX-2.0.csproj index 269a832..ce0ec42 100644 --- a/DMX-2.0/DMX-2.0.csproj +++ b/DMX-2.0/DMX-2.0.csproj @@ -98,6 +98,9 @@ + + + \ No newline at end of file diff --git a/DMX-2.0/MainWindow.cs b/DMX-2.0/MainWindow.cs index 783fb44..2c9c611 100644 --- a/DMX-2.0/MainWindow.cs +++ b/DMX-2.0/MainWindow.cs @@ -15,15 +15,14 @@ namespace DMX2 protected void MajWidgets () { if (Conduite.Courante != null) { - circAction.Sensitive = saveAction.Sensitive = saveAsAction.Sensitive = closeAction.Sensitive = true; + seqLinAction.Sensitive = circAction.Sensitive = saveAction.Sensitive = saveAsAction.Sensitive = closeAction.Sensitive = true; openAction.Sensitive = newAction.Sensitive = false; this.Title = "DMX 2.0 - " + Conduite.Courante.Name; } else { - circAction.Sensitive = saveAction.Sensitive = saveAsAction.Sensitive = closeAction.Sensitive = false; + seqLinAction.Sensitive = circAction.Sensitive = saveAction.Sensitive = saveAsAction.Sensitive = closeAction.Sensitive = false; openAction.Sensitive = newAction.Sensitive = true; this.Title = "DMX 2.0"; } - } protected void MajCircuits () @@ -45,11 +44,8 @@ namespace DMX2 pb.Fraction = (double) c.ValeurCourante / 255; pb.HeightRequest = 22; } - - } - protected void OnDeleteEvent (object sender, DeleteEventArgs a) { Application.Quit (); @@ -87,8 +83,11 @@ namespace DMX2 Conduite.Courante.Dispose(); Conduite.Courante= null; MajWidgets(); + } + + protected void OnSeqLinActionActivated (object sender, EventArgs e) + { + SequenceurLineaire s = new SequenceurLineaire(); } - - } } \ No newline at end of file diff --git a/DMX-2.0/SeqLinUI.cs b/DMX-2.0/SeqLinUI.cs new file mode 100644 index 0000000..6c2bb94 --- /dev/null +++ b/DMX-2.0/SeqLinUI.cs @@ -0,0 +1,22 @@ +using System; + +namespace DMX2 +{ + [System.ComponentModel.ToolboxItem(true)] + public partial class SeqLinUI : SequenceurUI + { + public SeqLinUI () : base (null) + { + this.Build (); + titreLabel.Text ="Hello !"; + } + #region implemented abstract members of DMX2.SequenceurUI + public override void Update () + { + throw new System.NotImplementedException (); + } + #endregion + + } +} + diff --git a/DMX-2.0/Sequenceur.cs b/DMX-2.0/Sequenceur.cs index 3dc0dbc..c534fb0 100644 --- a/DMX-2.0/Sequenceur.cs +++ b/DMX-2.0/Sequenceur.cs @@ -28,6 +28,7 @@ namespace DMX2 } } + public abstract SequenceurUI GetUI(); public abstract int EtatCircuit(Circuit c); public abstract void Tick(TimeSpan time); @@ -38,5 +39,6 @@ namespace DMX2 public abstract XmlElement Save(); } + } diff --git a/DMX-2.0/SequenceurLineaire.cs b/DMX-2.0/SequenceurLineaire.cs index 7e8a839..7e0ae1d 100644 --- a/DMX-2.0/SequenceurLineaire.cs +++ b/DMX-2.0/SequenceurLineaire.cs @@ -131,6 +131,12 @@ namespace DMX2 } public override System.Xml.XmlElement Save () + { + throw new System.NotImplementedException (); + } + + + public override SequenceurUI GetUI () { throw new System.NotImplementedException (); } diff --git a/DMX-2.0/SequenceurUI.cs b/DMX-2.0/SequenceurUI.cs new file mode 100644 index 0000000..5412d37 --- /dev/null +++ b/DMX-2.0/SequenceurUI.cs @@ -0,0 +1,23 @@ +using System; + +namespace DMX2 +{ + public abstract class SequenceurUI : Gtk.Bin + { + protected SequenceurUI (Sequenceur s) + { + sequenceur =s; + } + + Sequenceur sequenceur; + + public Sequenceur Sequenceur { + get { + return sequenceur; + } + } + + public abstract void Update(); + } +} + diff --git a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs index 9d8dafe..2976949 100644 --- a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs +++ b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs @@ -24,15 +24,15 @@ namespace DMX2 private global::Gtk.HPaned hpaned2; private global::Gtk.ScrolledWindow scrolledwindow1; private global::Gtk.VBox vbox3; - private global::Gtk.ScrolledWindow GtkScrolledWindow; + private global::Gtk.ScrolledWindow GtkScrolledWindow2; private global::Gtk.NodeView nodeview1; private global::Gtk.ScrolledWindow scrolledwindow2; private global::Gtk.VBox vboxCircuits; private global::Gtk.HSeparator hseparator1; - private global::Gtk.HBox hbox2; - private global::Gtk.Toolbar toolbar3; - private global::Gtk.Fixed fixed3; - private global::Gtk.Toolbar toolbar2; + private global::Gtk.HBox hbox4; + private global::Gtk.Toolbar toolbar7; + private global::Gtk.Fixed fixed5; + private global::Gtk.Toolbar toolbar8; protected virtual void Build () { @@ -132,16 +132,16 @@ namespace DMX2 w7.Resize = false; w7.Shrink = false; // Container child hpaned2.Gtk.Paned+PanedChild - this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); - this.GtkScrolledWindow.Name = "GtkScrolledWindow"; - this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); - // Container child GtkScrolledWindow.Gtk.Container+ContainerChild + this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow2.Name = "GtkScrolledWindow2"; + this.GtkScrolledWindow2.ShadowType = ((global::Gtk.ShadowType)(1)); + // Container child GtkScrolledWindow2.Gtk.Container+ContainerChild this.nodeview1 = new global::Gtk.NodeView (); this.nodeview1.CanFocus = true; this.nodeview1.Name = "nodeview1"; - this.GtkScrolledWindow.Add (this.nodeview1); - this.hpaned2.Add (this.GtkScrolledWindow); - global::Gtk.Paned.PanedChild w9 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.GtkScrolledWindow])); + this.GtkScrolledWindow2.Add (this.nodeview1); + this.hpaned2.Add (this.GtkScrolledWindow2); + global::Gtk.Paned.PanedChild w9 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.GtkScrolledWindow2])); w9.Resize = false; w9.Shrink = false; this.hpaned1.Add (this.hpaned2); @@ -181,39 +181,39 @@ namespace DMX2 w17.Expand = false; w17.Fill = false; // Container child vbox1.Gtk.Box+BoxChild - this.hbox2 = new global::Gtk.HBox (); - this.hbox2.Name = "hbox2"; - this.hbox2.Spacing = 6; - // Container child hbox2.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); - this.toolbar3 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar3"))); - this.toolbar3.Name = "toolbar3"; - this.toolbar3.ShowArrow = false; - this.hbox2.Add (this.toolbar3); - global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.toolbar3])); + this.hbox4 = new global::Gtk.HBox (); + this.hbox4.Name = "hbox4"; + this.hbox4.Spacing = 6; + // Container child hbox4.Gtk.Box+BoxChild + this.UIManager.AddUiFromString (""); + this.toolbar7 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar7"))); + this.toolbar7.Name = "toolbar7"; + this.toolbar7.ShowArrow = false; + this.hbox4.Add (this.toolbar7); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar7])); w18.Position = 0; w18.Expand = false; w18.Fill = false; - // Container child hbox2.Gtk.Box+BoxChild - this.fixed3 = new global::Gtk.Fixed (); - this.fixed3.Name = "fixed3"; - this.fixed3.HasWindow = false; - this.hbox2.Add (this.fixed3); - global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.fixed3])); + // Container child hbox4.Gtk.Box+BoxChild + this.fixed5 = new global::Gtk.Fixed (); + this.fixed5.Name = "fixed5"; + this.fixed5.HasWindow = false; + this.hbox4.Add (this.fixed5); + global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.fixed5])); w19.Position = 1; - // Container child hbox2.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); - this.toolbar2 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar2"))); - this.toolbar2.Name = "toolbar2"; - this.toolbar2.ShowArrow = false; - this.toolbar2.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); - this.hbox2.Add (this.toolbar2); - global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.toolbar2])); + // Container child hbox4.Gtk.Box+BoxChild + this.UIManager.AddUiFromString (""); + this.toolbar8 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar8"))); + this.toolbar8.Name = "toolbar8"; + this.toolbar8.ShowArrow = false; + this.toolbar8.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); + this.hbox4.Add (this.toolbar8); + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar8])); w20.Position = 2; w20.Expand = false; w20.Fill = false; - this.vbox1.Add (this.hbox2); - global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox2])); + this.vbox1.Add (this.hbox4); + global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox4])); w21.Position = 2; w21.Expand = false; w21.Fill = false; @@ -229,6 +229,7 @@ namespace DMX2 this.closeAction.Activated += new global::System.EventHandler (this.OnCloseActionActivated); this.circAction.Activated += new global::System.EventHandler (this.OnCircuitsActionActivated); this.newAction.Activated += new global::System.EventHandler (this.OnNewActionActivated); + this.seqLinAction.Activated += new global::System.EventHandler (this.OnSeqLinActionActivated); } } } diff --git a/DMX-2.0/gtk-gui/generated.cs b/DMX-2.0/gtk-gui/generated.cs index e2ddeff..6844911 100644 --- a/DMX-2.0/gtk-gui/generated.cs +++ b/DMX-2.0/gtk-gui/generated.cs @@ -80,6 +80,58 @@ namespace Stetic } } + internal class BinContainer + { + private Gtk.Widget child; + private Gtk.UIManager uimanager; + + public static BinContainer Attach (Gtk.Bin bin) + { + BinContainer bc = new BinContainer (); + bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); + bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); + bin.Added += new Gtk.AddedHandler (bc.OnAdded); + return bc; + } + + private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) + { + if ((this.child != null)) { + args.Requisition = this.child.SizeRequest (); + } + } + + private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) + { + if ((this.child != null)) { + this.child.Allocation = args.Allocation; + } + } + + private void OnAdded (object sender, Gtk.AddedArgs args) + { + this.child = args.Widget; + } + + public void SetUiManager (Gtk.UIManager uim) + { + this.uimanager = uim; + this.child.Realized += new System.EventHandler (this.OnRealized); + } + + private void OnRealized (object sender, System.EventArgs args) + { + if ((this.uimanager != null)) { + Gtk.Widget w; + w = this.child.Toplevel; + if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) { + ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup); + this.uimanager = null; + } + } + } + } + internal class ActionGroups { public static Gtk.ActionGroup GetActionGroup (System.Type type) diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index b09c63a..9952612 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -130,6 +130,7 @@ False tirettes + @@ -211,7 +212,7 @@ - + In @@ -283,14 +284,14 @@ - + 6 - + False - + @@ -303,7 +304,7 @@ - + False @@ -313,11 +314,11 @@ - + False Icons - + @@ -447,4 +448,251 @@ + + + + Action + + gtk-go-back + + + Action + + gtk-go-forward + + + Action + + gtk-revert-to-saved + + + Action + + gtk-media-pause + + + Action + + gtk-media-next + + + Action + + gtk-save + + + Action + + gtk-save-as + + + Action + + gtk-delete + + + Action + + gtk-go-up + + + Action + + gtk-go-down + + + + 270 + False + + + + In + + + + 0 + 0 + 12 + + + + 6 + + + + 6 + + + + 121 + 6 + + + + 37 + label2 + + + 0 + False + False + False + + + + + + 15 + + + 1 + False + False + False + + + + + + 15 + + + 2 + False + False + False + + + + + 0 + False + False + False + + + + + + 6 + + + + False + Icons + SmallToolbar + + + + + + + + + 0 + True + False + False + + + + + + False + SmallToolbar + + + + + + + + + 1 + True + False + False + + + + + 1 + False + False + False + + + + + + Never + In + + + + True + True + + + + + 2 + False + + + + + + Vertical + False + Icons + SmallToolbar + + + + + + + 3 + True + False + False + + + + + 0 + True + False + False + + + + + + False + + + 1 + False + + + + + + + + + + Sequenceur Lineaire + True + + + label_item + + + + + \ No newline at end of file