bouton 100% vs 255

This commit is contained in:
manu 2014-03-22 10:01:49 +00:00
parent eb7c20d395
commit 5c8728e9fb
5 changed files with 38 additions and 8 deletions

View file

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

View file

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

View file

@ -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 ("<ui><toolbar name='toolbar3'><toolitem name='closeAction' action='closeAction'/><toolitem name='circuitsAction' action='circuitsAction'/><toolitem name='moveUpAction' action='moveUpAction'/><toolitem name='moveDownAction' action='moveDownAction'/></toolbar></ui>");
this.UIManager.AddUiFromString ("<ui><toolbar name='toolbar3'><toolitem name='closeAction' action='closeAction'/><toolitem name='circuitsAction' action='circuitsAction'/><toolitem name='moveUpAction' action='moveUpAction'/><toolitem name='moveDownAction' action='moveDownAction'/><toolitem name='pourcentBtn' action='pourcentBtn'/></toolbar></ui>");
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);
}

View file

@ -5,7 +5,7 @@
<target-gtk-version>2.12</target-gtk-version>
</configuration>
<import>
<widget-library name="../bin/Debug/DMX-2.0.exe" internal="true" />
<widget-library name="../bin/Release/DMX-2.0.exe" internal="true" />
</import>
<icon-factory>
<icon-set id="tirettes">
@ -751,6 +751,14 @@ au sequenceur</property>
<property name="StockId">gtk-close</property>
<signal name="Activated" handler="OnCloseActionActivated" />
</action>
<action id="pourcentBtn">
<property name="Type">Toggle</property>
<property name="Label" translatable="yes" />
<property name="StockId">gtk-zoom-100</property>
<property name="DrawAsRadio">False</property>
<property name="Active">False</property>
<signal name="Toggled" handler="OnPourcentBtnToggled" />
</action>
</action-group>
<property name="MemberName" />
<child>
@ -947,6 +955,7 @@ au sequenceur</property>
<node type="Toolitem" action="circuitsAction" />
<node type="Toolitem" action="moveUpAction" />
<node type="Toolitem" action="moveDownAction" />
<node type="Toolitem" action="pourcentBtn" />
</node>
</widget>
<packing>
@ -2565,7 +2574,7 @@ au sequenceur</property>
</widget>
</child>
</widget>
<widget class="Gtk.Dialog" id="DMX2.About" design-size="400 194">
<widget class="Gtk.Dialog" id="DMX2.About" design-size="400 300">
<property name="MemberName" />
<property name="WindowPosition">CenterOnParent</property>
<property name="Modal">True</property>

View file

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