From 5c8728e9fb0f1a0081e38cd2784d89f2b84844ab Mon Sep 17 00:00:00 2001 From: manu Date: Sat, 22 Mar 2014 10:01:49 +0000 Subject: [PATCH] bouton 100% vs 255 --- DMX-2.0/SeqLinUI.cs | 21 +++++++++++++++++---- DMX-2.0/gtk-gui/DMX2.About.cs | 2 +- DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs | 6 +++++- DMX-2.0/gtk-gui/gui.stetic | 13 +++++++++++-- DMX-2.0/style.gtkrc | 4 ++++ 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/DMX-2.0/SeqLinUI.cs b/DMX-2.0/SeqLinUI.cs index 5005ddd..12877b0 100644 --- a/DMX-2.0/SeqLinUI.cs +++ b/DMX-2.0/SeqLinUI.cs @@ -249,7 +249,7 @@ namespace DMX2 { VScale tirette = new VScale (null); tirette.WidthRequest = 25; - tirette.HeightRequest = 125; + tirette.HeightRequest = 130; tirette.CanFocus = true; tirette.Inverted = true; tirette.Adjustment.Upper = 255; @@ -356,13 +356,17 @@ namespace DMX2 foreach (Circuit c in sequenceur.Circuits) { label = new Label(); - label.LabelProp = "00.0"; + if(pourcentBtn.Active) + label.LabelProp = "00"; + else + label.LabelProp = "00,0"; label.WidthRequest = 25; label.HeightRequest = 25; zoneWid.Add(label); fx = ( zoneWid[label] as Fixed.FixedChild); fx.X = xpos; fx.Y = ypos; + label.Name = "sclTirette"; label.Show(); label.Justify = Justification.Left; @@ -371,7 +375,7 @@ namespace DMX2 zoneWid.Add(tirette); fx = ( zoneWid[tirette] as Fixed.FixedChild); fx.X = xpos; - fx.Y = ypos + 25; + fx.Y = ypos + 20; tirette.Show(); tirette.ValueChanged += TiretteActionee; tirette.Data.Add(circuitKey,c); @@ -408,7 +412,10 @@ namespace DMX2 { VScale t = sender as VScale; Label lab = t.Data[labKey] as Label; - lab.LabelProp = string.Format(@"{0:00.0}",100 * t.Value / 255 ); + if(pourcentBtn.Active) + lab.LabelProp = string.Format(@"{0:00}", t.Value ); + else + lab.LabelProp = string.Format(@"{0:00.0}",100 * t.Value / 255 ); if (updating) return; Circuit c = t.Data[circuitKey] as Circuit; sequenceur.ChangeValeur(c,(int)(t.Value)); @@ -534,6 +541,12 @@ namespace DMX2 sequenceur.Master = (int)(seqMasterScale.Value); } + protected void OnPourcentBtnToggled (object sender, EventArgs e) + { + fullUpdFlag = true; + } + + } } diff --git a/DMX-2.0/gtk-gui/DMX2.About.cs b/DMX-2.0/gtk-gui/DMX2.About.cs index 68be010..f6f6b8d 100644 --- a/DMX-2.0/gtk-gui/DMX2.About.cs +++ b/DMX-2.0/gtk-gui/DMX2.About.cs @@ -49,7 +49,7 @@ namespace DMX2 this.Child.ShowAll (); } this.DefaultWidth = 400; - this.DefaultHeight = 194; + this.DefaultHeight = 300; this.Show (); this.buttonOk.Clicked += new global::System.EventHandler (this.OnButtonOkClicked); } diff --git a/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs index 2591721..3e06327 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs @@ -17,6 +17,7 @@ namespace DMX2 private global::Gtk.Action moveDownAction; private global::Gtk.Action circuitsAction; private global::Gtk.Action closeAction; + private global::Gtk.ToggleAction pourcentBtn; private global::Gtk.Frame frame1; private global::Gtk.Alignment GtkAlignment; private global::Gtk.VBox vbox2; @@ -69,6 +70,8 @@ namespace DMX2 w2.Add (this.circuitsAction, null); this.closeAction = new global::Gtk.Action ("closeAction", null, null, "gtk-close"); w2.Add (this.closeAction, null); + this.pourcentBtn = new global::Gtk.ToggleAction ("pourcentBtn", null, null, "gtk-zoom-100"); + w2.Add (this.pourcentBtn, null); this.UIManager.InsertActionGroup (w2, 0); this.Name = "DMX2.SeqLinUI"; // Container child DMX2.SeqLinUI.Gtk.Container+ContainerChild @@ -208,7 +211,7 @@ namespace DMX2 global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow])); w14.Position = 1; // Container child hbox1.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); + this.UIManager.AddUiFromString (""); this.toolbar3 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar3"))); this.toolbar3.Name = "toolbar3"; this.toolbar3.Orientation = ((global::Gtk.Orientation)(1)); @@ -266,6 +269,7 @@ namespace DMX2 this.moveDownAction.Activated += new global::System.EventHandler (this.OnMoveDownActionActivated); this.circuitsAction.Activated += new global::System.EventHandler (this.OnCircuitsActionActivated); this.closeAction.Activated += new global::System.EventHandler (this.OnCloseActionActivated); + this.pourcentBtn.Toggled += new global::System.EventHandler (this.OnPourcentBtnToggled); this.seqMasterScale.ValueChanged += new global::System.EventHandler (this.OnSeqMasterScaleValueChanged); this.zoneWid.SizeAllocated += new global::Gtk.SizeAllocatedHandler (this.OnZoneWidSizeAllocated); } diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 35db69a..ed5bee6 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -5,7 +5,7 @@ 2.12 - + @@ -751,6 +751,14 @@ au sequenceur gtk-close + + Toggle + + gtk-zoom-100 + False + False + + @@ -947,6 +955,7 @@ au sequenceur + @@ -2565,7 +2574,7 @@ au sequenceur - + CenterOnParent True diff --git a/DMX-2.0/style.gtkrc b/DMX-2.0/style.gtkrc index 03c35e0..514000c 100644 --- a/DMX-2.0/style.gtkrc +++ b/DMX-2.0/style.gtkrc @@ -48,6 +48,7 @@ style "scale" { } style "tirettes" { + font_name = "DejaVu Sans Mono 7" GtkScale::slider-width = 19 GtkScale::slider-length = 28 bg[NORMAL] = "#A0A0B0" @@ -57,6 +58,7 @@ style "tirettes" { } style "tirettesc" { + font_name = "DejaVu Sans Mono 7" GtkScale::slider-width = 19 GtkScale::slider-length = 28 bg[NORMAL] = "#B08080" @@ -66,6 +68,7 @@ style "tirettesc" { } style "tirettest" { + font_name = "DejaVu Sans Mono 7" GtkScale::slider-width = 19 GtkScale::slider-length = 28 bg[NORMAL] = "#80B080" @@ -75,6 +78,7 @@ style "tirettest" { } style "tirettesm" { + font_name = "DejaVu Sans Mono 7" GtkScale::slider-width = 19 GtkScale::slider-length = 28 bg[NORMAL] = "#6070B0"