diff --git a/DMX-2.0.userprefs b/DMX-2.0.userprefs index a15ef10..d07f687 100644 --- a/DMX-2.0.userprefs +++ b/DMX-2.0.userprefs @@ -1,15 +1,15 @@  - + - - - + + - - - + + + + diff --git a/DMX-2.0/Conduite.cs b/DMX-2.0/Conduite.cs index 6de1b12..01f87cf 100644 --- a/DMX-2.0/Conduite.cs +++ b/DMX-2.0/Conduite.cs @@ -8,7 +8,7 @@ namespace DMX2 public class Conduite { - public static Conduite ConduiteCourante = new Conduite(); + public static Conduite ConduiteCourante = null; public Conduite() { @@ -43,8 +43,14 @@ namespace DMX2 public class Circuit { + static int maxid=1; string name; + public Circuit() + { + id=maxid++; + } + public string Name { get { return name; diff --git a/DMX-2.0/Main.cs b/DMX-2.0/Main.cs index 586ada4..1084a95 100644 --- a/DMX-2.0/Main.cs +++ b/DMX-2.0/Main.cs @@ -7,10 +7,13 @@ namespace DMX2 { public static void Main (string[] args) { + Application.Init (); + MainWindow win = new MainWindow (); + win.Show (); Application.Run (); } } -} +} \ No newline at end of file diff --git a/DMX-2.0/MainWindow.cs b/DMX-2.0/MainWindow.cs index 25b181e..965e556 100644 --- a/DMX-2.0/MainWindow.cs +++ b/DMX-2.0/MainWindow.cs @@ -16,5 +16,11 @@ namespace DMX2 Application.Quit (); a.RetVal = true; } + protected void OnQuitActionActivated (object sender, EventArgs e) + { + Application.Quit (); + } + + } } \ No newline at end of file diff --git a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs index 32830db..b9d4e81 100644 --- a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs +++ b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs @@ -4,20 +4,271 @@ namespace DMX2 { public partial class MainWindow { + private global::Gtk.UIManager UIManager; + private global::Gtk.Action newAction; + private global::Gtk.Action openAction; + private global::Gtk.Action saveAction; + private global::Gtk.Action saveAsAction; + private global::Gtk.Action quitAction; + private global::Gtk.Action closeAction; + private global::Gtk.Action TestAction; + private global::Gtk.Action FileAction; + private global::Gtk.Action newAction3; + private global::Gtk.Action CircuitsAction; + private global::Gtk.Action UniversDMXAction; + private global::Gtk.Action FichierAction; + private global::Gtk.Action newAction2; + private global::Gtk.VBox vbox1; + private global::Gtk.MenuBar menubar34; + private global::Gtk.HBox hbox1; + private global::Gtk.Fixed fixed2; + private global::Gtk.VSeparator vseparator1; + private global::Gtk.HPaned hpaned1; + private global::Gtk.HPaned hpaned2; + private global::Gtk.ScrolledWindow scrolledwindow1; + private global::Gtk.VBox vbox3; + private global::Gtk.ScrolledWindow GtkScrolledWindow; + private global::Gtk.NodeView nodeview1; + private global::Gtk.VBox vbox2; + private global::Gtk.Button button15; + private global::Gtk.Image image5; + private global::Gtk.ProgressBar progressbar1; + private global::Gtk.ProgressBar progressbar2; + private global::Gtk.ProgressBar progressbar3; + 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; + protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget DMX2.MainWindow + this.UIManager = new global::Gtk.UIManager (); + global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup ("Default"); + this.newAction = new global::Gtk.Action ("newAction", global::Mono.Unix.Catalog.GetString ("_Nouveau"), null, "gtk-new"); + this.newAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Nouveau"); + w1.Add (this.newAction, null); + this.openAction = new global::Gtk.Action ("openAction", global::Mono.Unix.Catalog.GetString ("_Ouvrir"), null, "gtk-open"); + this.openAction.Sensitive = false; + this.openAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Ouvrir"); + w1.Add (this.openAction, null); + this.saveAction = new global::Gtk.Action ("saveAction", null, null, "gtk-save"); + this.saveAction.Sensitive = false; + w1.Add (this.saveAction, null); + this.saveAsAction = new global::Gtk.Action ("saveAsAction", null, null, "gtk-save-as"); + this.saveAsAction.Sensitive = false; + w1.Add (this.saveAsAction, null); + this.quitAction = new global::Gtk.Action ("quitAction", null, null, "gtk-quit"); + w1.Add (this.quitAction, null); + this.closeAction = new global::Gtk.Action ("closeAction", null, null, "gtk-close"); + this.closeAction.Sensitive = false; + w1.Add (this.closeAction, null); + this.TestAction = new global::Gtk.Action ("TestAction", global::Mono.Unix.Catalog.GetString ("Test"), null, null); + this.TestAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Test"); + w1.Add (this.TestAction, null); + this.FileAction = new global::Gtk.Action ("FileAction", global::Mono.Unix.Catalog.GetString ("File"), null, null); + this.FileAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("File"); + w1.Add (this.FileAction, null); + this.newAction3 = new global::Gtk.Action ("newAction3", global::Mono.Unix.Catalog.GetString ("_Nouveau"), null, "gtk-new"); + this.newAction3.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Nouveau"); + w1.Add (this.newAction3, null); + this.CircuitsAction = new global::Gtk.Action ("CircuitsAction", global::Mono.Unix.Catalog.GetString ("Circuits"), null, "circuits"); + this.CircuitsAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Circuits"); + w1.Add (this.CircuitsAction, null); + this.UniversDMXAction = new global::Gtk.Action ("UniversDMXAction", null, null, "UniversDMX"); + w1.Add (this.UniversDMXAction, null); + this.FichierAction = new global::Gtk.Action ("FichierAction", global::Mono.Unix.Catalog.GetString ("Fichier"), null, null); + this.FichierAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Fichier"); + w1.Add (this.FichierAction, null); + this.newAction2 = new global::Gtk.Action ("newAction2", global::Mono.Unix.Catalog.GetString ("_Nouveau"), null, "gtk-new"); + this.newAction2.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Nouveau"); + w1.Add (this.newAction2, null); + this.UIManager.InsertActionGroup (w1, 0); + this.AddAccelGroup (this.UIManager.AccelGroup); this.Name = "DMX2.MainWindow"; this.Title = global::Mono.Unix.Catalog.GetString ("MainWindow"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); + // Container child DMX2.MainWindow.Gtk.Container+ContainerChild + this.vbox1 = new global::Gtk.VBox (); + this.vbox1.Name = "vbox1"; + this.vbox1.Spacing = 6; + // Container child vbox1.Gtk.Box+BoxChild + this.UIManager.AddUiFromString (""); + this.menubar34 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menubar34"))); + this.menubar34.Name = "menubar34"; + this.vbox1.Add (this.menubar34); + global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.menubar34])); + w2.Position = 0; + w2.Expand = false; + w2.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + this.hbox1 = new global::Gtk.HBox (); + this.hbox1.Name = "hbox1"; + this.hbox1.Spacing = 6; + // Container child hbox1.Gtk.Box+BoxChild + this.fixed2 = new global::Gtk.Fixed (); + this.fixed2.WidthRequest = 50; + this.fixed2.Name = "fixed2"; + this.fixed2.HasWindow = false; + this.hbox1.Add (this.fixed2); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.fixed2])); + w3.Position = 0; + w3.Expand = false; + w3.Fill = false; + // Container child hbox1.Gtk.Box+BoxChild + this.vseparator1 = new global::Gtk.VSeparator (); + this.vseparator1.Name = "vseparator1"; + this.hbox1.Add (this.vseparator1); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vseparator1])); + w4.Position = 1; + w4.Expand = false; + w4.Fill = false; + // Container child hbox1.Gtk.Box+BoxChild + this.hpaned1 = new global::Gtk.HPaned (); + this.hpaned1.CanFocus = true; + this.hpaned1.Name = "hpaned1"; + this.hpaned1.Position = 651; + // Container child hpaned1.Gtk.Paned+PanedChild + this.hpaned2 = new global::Gtk.HPaned (); + this.hpaned2.CanFocus = true; + this.hpaned2.Name = "hpaned2"; + this.hpaned2.Position = 313; + // Container child hpaned2.Gtk.Paned+PanedChild + this.scrolledwindow1 = new global::Gtk.ScrolledWindow (); + this.scrolledwindow1.CanFocus = true; + this.scrolledwindow1.Name = "scrolledwindow1"; + this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1)); + // Container child scrolledwindow1.Gtk.Container+ContainerChild + global::Gtk.Viewport w5 = new global::Gtk.Viewport (); + w5.ShadowType = ((global::Gtk.ShadowType)(0)); + // Container child GtkViewport.Gtk.Container+ContainerChild + this.vbox3 = new global::Gtk.VBox (); + this.vbox3.Name = "vbox3"; + this.vbox3.Spacing = 6; + w5.Add (this.vbox3); + this.scrolledwindow1.Add (w5); + this.hpaned2.Add (this.scrolledwindow1); + global::Gtk.Paned.PanedChild w8 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.scrolledwindow1])); + w8.Resize = 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.nodeview1 = new global::Gtk.NodeView (); + this.nodeview1.CanFocus = true; + this.nodeview1.Name = "nodeview1"; + this.GtkScrolledWindow.Add (this.nodeview1); + this.hpaned2.Add (this.GtkScrolledWindow); + this.hpaned1.Add (this.hpaned2); + global::Gtk.Paned.PanedChild w11 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.hpaned2])); + w11.Resize = false; + // Container child hpaned1.Gtk.Paned+PanedChild + this.vbox2 = new global::Gtk.VBox (); + this.vbox2.WidthRequest = 150; + this.vbox2.Name = "vbox2"; + this.vbox2.Spacing = 2; + // Container child vbox2.Gtk.Box+BoxChild + this.button15 = new global::Gtk.Button (); + this.button15.CanFocus = true; + this.button15.Name = "button15"; + // Container child button15.Gtk.Container+ContainerChild + this.image5 = new global::Gtk.Image (); + this.image5.Name = "image5"; + this.image5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-properties", global::Gtk.IconSize.Button); + this.button15.Add (this.image5); + this.button15.Label = null; + this.vbox2.Add (this.button15); + global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.button15])); + w13.Position = 0; + w13.Expand = false; + w13.Fill = false; + // Container child vbox2.Gtk.Box+BoxChild + this.progressbar1 = new global::Gtk.ProgressBar (); + this.progressbar1.Name = "progressbar1"; + this.vbox2.Add (this.progressbar1); + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.progressbar1])); + w14.Position = 1; + w14.Expand = false; + w14.Fill = false; + // Container child vbox2.Gtk.Box+BoxChild + this.progressbar2 = new global::Gtk.ProgressBar (); + this.progressbar2.Name = "progressbar2"; + this.vbox2.Add (this.progressbar2); + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.progressbar2])); + w15.Position = 2; + w15.Expand = false; + w15.Fill = false; + // Container child vbox2.Gtk.Box+BoxChild + this.progressbar3 = new global::Gtk.ProgressBar (); + this.progressbar3.Name = "progressbar3"; + this.vbox2.Add (this.progressbar3); + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.progressbar3])); + w16.Position = 3; + w16.Expand = false; + w16.Fill = false; + this.hpaned1.Add (this.vbox2); + this.hbox1.Add (this.hpaned1); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.hpaned1])); + w18.Position = 2; + this.vbox1.Add (this.hbox1); + global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1])); + w19.Position = 1; + // Container child vbox1.Gtk.Box+BoxChild + this.hseparator1 = new global::Gtk.HSeparator (); + this.hseparator1.Name = "hseparator1"; + this.vbox1.Add (this.hseparator1); + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hseparator1])); + w20.Position = 2; + w20.Expand = false; + w20.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 w21 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.toolbar3])); + w21.Position = 0; + // 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 w22 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.fixed3])); + w22.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 w23 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.toolbar2])); + w23.Position = 2; + w23.Expand = false; + w23.Fill = false; + this.vbox1.Add (this.hbox2); + global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox2])); + w24.Position = 3; + w24.Expand = false; + w24.Fill = false; + this.Add (this.vbox1); if ((this.Child != null)) { this.Child.ShowAll (); } - this.DefaultWidth = 400; - this.DefaultHeight = 300; + this.DefaultWidth = 1027; + this.DefaultHeight = 709; + this.menubar34.Hide (); this.Show (); this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent); + this.quitAction.Activated += new global::System.EventHandler (this.OnQuitActionActivated); } } } diff --git a/DMX-2.0/gtk-gui/generated.cs b/DMX-2.0/gtk-gui/generated.cs index 9636f6f..8407c26 100644 --- a/DMX-2.0/gtk-gui/generated.cs +++ b/DMX-2.0/gtk-gui/generated.cs @@ -10,6 +10,64 @@ namespace Stetic { if ((Stetic.Gui.initialized == false)) { Stetic.Gui.initialized = true; + global::Gtk.IconFactory w1 = new global::Gtk.IconFactory (); + global::Gtk.IconSet w2 = new global::Gtk.IconSet (); + global::Gtk.IconSource w3 = new global::Gtk.IconSource (); + w3.Pixbuf = global::Stetic.IconLoader.LoadIcon (iconRenderer, "gtk-properties", global::Gtk.IconSize.Button); + w2.AddSource (w3); + global::Gtk.IconSource w4 = new global::Gtk.IconSource (); + w4.Pixbuf = global::Stetic.IconLoader.LoadIcon (iconRenderer, "gtk-properties", global::Gtk.IconSize.LargeToolbar); + w2.AddSource (w4); + global::Gtk.IconSource w5 = new global::Gtk.IconSource (); + w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (iconRenderer, "gtk-properties", global::Gtk.IconSize.SmallToolbar); + w2.AddSource (w5); + global::Gtk.IconSource w6 = new global::Gtk.IconSource (); + w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (iconRenderer, "gtk-properties", global::Gtk.IconSize.LargeToolbar); + w2.AddSource (w6); + w1.Add ("circuits", w2); + global::Gtk.IconSet w7 = new global::Gtk.IconSet (); + global::Gtk.IconSource w8 = new global::Gtk.IconSource (); + w8.Pixbuf = global::Stetic.IconLoader.LoadIcon (iconRenderer, "gtk-preferences", global::Gtk.IconSize.SmallToolbar); + w7.AddSource (w8); + global::Gtk.IconSource w9 = new global::Gtk.IconSource (); + w9.Pixbuf = global::Stetic.IconLoader.LoadIcon (iconRenderer, "gtk-preferences", global::Gtk.IconSize.LargeToolbar); + w7.AddSource (w9); + w1.Add ("UniversDMX", w7); + w1.AddDefault (); + } + } + } + + internal class IconLoader + { + public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size) + { + Gdk.Pixbuf res = widget.RenderIcon (name, size, null); + if ((res != null)) { + return res; + } else { + int sz; + int sy; + global::Gtk.Icon.SizeLookup (size, out sz, out sy); + try { + return Gtk.IconTheme.Default.LoadIcon (name, sz, 0); + } catch (System.Exception) { + if ((name != "gtk-missing-image")) { + return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size); + } else { + Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz); + Gdk.GC gc = new Gdk.GC (pmap); + gc.RgbFgColor = new Gdk.Color (255, 255, 255); + pmap.DrawRectangle (gc, true, 0, 0, sz, sz); + gc.RgbFgColor = new Gdk.Color (0, 0, 0); + pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1)); + gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); + gc.RgbFgColor = new Gdk.Color (255, 0, 0); + pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4))); + pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4))); + return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); + } + } } } } diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index bd8cb6f..d0f23fc 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -8,13 +8,356 @@ - + + + + stock:gtk-properties Button + + + stock:gtk-properties LargeToolbar + + + stock:gtk-properties SmallToolbar + + + stock:gtk-properties LargeToolbar + + + + + stock:gtk-preferences SmallToolbar + + + stock:gtk-preferences LargeToolbar + + + + + + + Action + _Nouveau + _Nouveau + gtk-new + + + Action + _Ouvrir + False + _Ouvrir + gtk-open + + + Action + + False + gtk-save + + + Action + + False + gtk-save-as + + + Action + + gtk-quit + + + + Action + + False + gtk-close + + + Action + Test + Test + + + Action + File + File + + + Action + _Nouveau + _Nouveau + gtk-new + + + Action + Circuits + Circuits + circuits + + + Action + + UniversDMX + + + Action + Fichier + Fichier + + + Action + _Nouveau + _Nouveau + gtk-new + + MainWindow CenterOnParent - + + + 6 + + + + False + + + + 0 + True + False + False + + + + + + 6 + + + + 50 + False + + + 0 + False + False + False + + + + + + + + 1 + True + False + False + + + + + + True + 651 + + + + True + 313 + + + + True + In + + + + None + + + + 6 + + + + + + + + + + + + + + + + False + + + + + + In + + + + True + True + + + + + + + False + + + + + + 150 + 2 + + + + True + Custom + + + + stock:gtk-properties Button + + + + + 0 + True + False + False + + + + + + + + 1 + True + False + False + + + + + + + + 2 + True + False + False + + + + + + + + 3 + True + False + False + + + + + + + 2 + True + + + + + 1 + False + + + + + + + + 2 + True + False + False + + + + + + 6 + + + + False + + + + + + + 0 + True + + + + + + False + + + 1 + False + + + + + + False + Icons + + + + + + + + + + + 2 + False + False + False + + + + + 3 + True + False + False + + + \ No newline at end of file