ajouut sequi

This commit is contained in:
tzim 2013-04-10 18:08:26 +00:00
parent 1e1c65592c
commit ad943a0a3c
10 changed files with 416 additions and 53 deletions

View file

@ -66,6 +66,13 @@ namespace DMX2
}
}
public void AjoutSequenceur (Sequenceur seq)
{
lock (this) {
sequenceurs.Add(seq);
}
}
List<UniversDMX> univers;
public List<UniversDMX> Patch {

View file

@ -98,6 +98,9 @@
<Compile Include="IDriverDMX.cs" />
<Compile Include="GestionCircuits.cs" />
<Compile Include="gtk-gui\DMX2.GestionCircuits.cs" />
<Compile Include="SequenceurUI.cs" />
<Compile Include="SeqLinUI.cs" />
<Compile Include="gtk-gui\DMX2.SeqLinUI.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -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();
}
}
}

22
DMX-2.0/SeqLinUI.cs Normal file
View file

@ -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
}
}

View file

@ -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();
}
}

View file

@ -131,6 +131,12 @@ namespace DMX2
}
public override System.Xml.XmlElement Save ()
{
throw new System.NotImplementedException ();
}
public override SequenceurUI GetUI ()
{
throw new System.NotImplementedException ();
}

23
DMX-2.0/SequenceurUI.cs Normal file
View file

@ -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();
}
}

View file

@ -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 ("<ui><toolbar name='toolbar3'><toolitem name='circAction' action='circAction'/><toolitem name='seqLinAction' action='seqLinAction'/></toolbar></ui>");
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 ("<ui><toolbar name='toolbar7'><toolitem name='circAction' action='circAction'/><toolitem name='seqLinAction' action='seqLinAction'/></toolbar></ui>");
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 ("<ui><toolbar name='toolbar2'><toolitem name='newAction' action='newAction'/><toolitem name='openAction' action='openAction'/><toolitem name='saveAction' action='saveAction'/><toolitem name='saveAsAction' action='saveAsAction'/><toolitem name='closeAction' action='closeAction'/><toolitem name='quitAction' action='quitAction'/></toolbar></ui>");
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 ("<ui><toolbar name='toolbar8'><toolitem name='newAction' action='newAction'/><toolitem name='openAction' action='openAction'/><toolitem name='saveAction' action='saveAction'/><toolitem name='saveAsAction' action='saveAsAction'/><toolitem name='closeAction' action='closeAction'/><toolitem name='quitAction' action='quitAction'/></toolbar></ui>");
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);
}
}
}

View file

@ -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)

View file

@ -130,6 +130,7 @@
<property name="Label" translatable="yes" />
<property name="Sensitive">False</property>
<property name="StockId">tirettes</property>
<signal name="Activated" handler="OnSeqLinActionActivated" />
</action>
</action-group>
<property name="MemberName" />
@ -211,7 +212,7 @@
</packing>
</child>
<child>
<widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
<widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow2">
<property name="MemberName" />
<property name="ShadowType">In</property>
<child>
@ -283,14 +284,14 @@
</packing>
</child>
<child>
<widget class="Gtk.HBox" id="hbox2">
<widget class="Gtk.HBox" id="hbox4">
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
<widget class="Gtk.Toolbar" id="toolbar3">
<widget class="Gtk.Toolbar" id="toolbar7">
<property name="MemberName" />
<property name="ShowArrow">False</property>
<node name="toolbar3" type="Toolbar">
<node name="toolbar7" type="Toolbar">
<node type="Toolitem" action="circAction" />
<node type="Toolitem" action="seqLinAction" />
</node>
@ -303,7 +304,7 @@
</packing>
</child>
<child>
<widget class="Gtk.Fixed" id="fixed3">
<widget class="Gtk.Fixed" id="fixed5">
<property name="MemberName" />
<property name="HasWindow">False</property>
</widget>
@ -313,11 +314,11 @@
</packing>
</child>
<child>
<widget class="Gtk.Toolbar" id="toolbar2">
<widget class="Gtk.Toolbar" id="toolbar8">
<property name="MemberName" />
<property name="ShowArrow">False</property>
<property name="ButtonStyle">Icons</property>
<node name="toolbar2" type="Toolbar">
<node name="toolbar8" type="Toolbar">
<node type="Toolitem" action="newAction" />
<node type="Toolitem" action="openAction" />
<node type="Toolitem" action="saveAction" />
@ -447,4 +448,251 @@
</widget>
</child>
</widget>
<widget class="Gtk.Bin" id="DMX2.SeqLinUI" design-size="618 270">
<action-group name="Default">
<action id="goBackAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
<property name="StockId">gtk-go-back</property>
</action>
<action id="goForwardAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
<property name="StockId">gtk-go-forward</property>
</action>
<action id="revertToSavedAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
<property name="StockId">gtk-revert-to-saved</property>
</action>
<action id="mediaPauseAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
<property name="StockId">gtk-media-pause</property>
</action>
<action id="mediaNextAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
<property name="StockId">gtk-media-next</property>
</action>
<action id="saveAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
<property name="StockId">gtk-save</property>
</action>
<action id="saveAsAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
<property name="StockId">gtk-save-as</property>
</action>
<action id="deleteAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
<property name="StockId">gtk-delete</property>
</action>
<action id="goUpAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
<property name="StockId">gtk-go-up</property>
</action>
<action id="goDownAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
<property name="StockId">gtk-go-down</property>
</action>
</action-group>
<property name="MemberName" />
<property name="HeightRequest">270</property>
<property name="Visible">False</property>
<child>
<widget class="Gtk.Frame" id="frame1">
<property name="MemberName" />
<property name="ShadowType">In</property>
<child>
<widget class="Gtk.Alignment" id="GtkAlignment">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="Yalign">0</property>
<property name="LeftPadding">12</property>
<child>
<widget class="Gtk.VBox" id="vbox2">
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
<widget class="Gtk.HBox" id="hbox1">
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
<widget class="Gtk.VBox" id="vbox3">
<property name="MemberName" />
<property name="WidthRequest">121</property>
<property name="Spacing">6</property>
<child>
<widget class="Gtk.Label" id="label2">
<property name="MemberName" />
<property name="HeightRequest">37</property>
<property name="LabelProp" translatable="yes">label2</property>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.ProgressBar" id="progressbar1">
<property name="MemberName" />
<property name="HeightRequest">15</property>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.ProgressBar" id="progressbar2">
<property name="MemberName" />
<property name="HeightRequest">15</property>
</widget>
<packing>
<property name="Position">2</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.VBox" id="vbox4">
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
<widget class="Gtk.Toolbar" id="toolbar1">
<property name="MemberName" />
<property name="ShowArrow">False</property>
<property name="ButtonStyle">Icons</property>
<property name="IconSize">SmallToolbar</property>
<node name="toolbar1" type="Toolbar">
<node type="Toolitem" action="goForwardAction" />
<node type="Toolitem" action="goBackAction" />
<node type="Toolitem" action="mediaPauseAction" />
<node type="Toolitem" action="mediaNextAction" />
</node>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Toolbar" id="toolbar2">
<property name="MemberName" />
<property name="ShowArrow">False</property>
<property name="IconSize">SmallToolbar</property>
<node name="toolbar2" type="Toolbar">
<node type="Toolitem" action="revertToSavedAction" />
<node type="Toolitem" action="saveAction" />
<node type="Toolitem" action="saveAsAction" />
<node type="Toolitem" action="deleteAction" />
</node>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
<property name="MemberName" />
<property name="HscrollbarPolicy">Never</property>
<property name="ShadowType">In</property>
<child>
<widget class="Gtk.TreeView" id="treeview1">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="ShowScrollbars">True</property>
</widget>
</child>
</widget>
<packing>
<property name="Position">2</property>
<property name="AutoSize">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Toolbar" id="toolbar3">
<property name="MemberName" />
<property name="Orientation">Vertical</property>
<property name="ShowArrow">False</property>
<property name="ButtonStyle">Icons</property>
<property name="IconSize">SmallToolbar</property>
<node name="toolbar3" type="Toolbar">
<node type="Toolitem" action="goUpAction" />
<node type="Toolitem" action="goDownAction" />
</node>
</widget>
<packing>
<property name="Position">3</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Fixed" id="fixed2">
<property name="MemberName" />
<property name="HasWindow">False</property>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="Gtk.Label" id="titreLabel">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Sequenceur Lineaire</property>
<property name="UseMarkup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
</child>
</widget>
</stetic-interface>