From 284076263feebb8d96ee214e128ffc2a913e3367 Mon Sep 17 00:00:00 2001 From: tzim Date: Wed, 8 May 2013 18:44:44 +0000 Subject: [PATCH] Ajout ID sur labels circuits --- DMX-2.0/EditionUnivers.cs | 10 +++++----- DMX-2.0/GestionCircuits.cs | 15 +++++++++++++++ DMX-2.0/SeqLinUI.cs | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/DMX-2.0/EditionUnivers.cs b/DMX-2.0/EditionUnivers.cs index 3ede688..2617e3c 100644 --- a/DMX-2.0/EditionUnivers.cs +++ b/DMX-2.0/EditionUnivers.cs @@ -64,7 +64,7 @@ namespace DMX2 { Circuit c = tree_model.GetValue (iter, 0) as Circuit; if(c != null) - (cell as Gtk.CellRendererText).Text = c.Name; + (cell as Gtk.CellRendererText).Text = c.ID + "-" + c.Name; else (cell as Gtk.CellRendererText).Text = "--Aucun--"; @@ -77,12 +77,12 @@ namespace DMX2 { var values = Enum.GetValues(typeof(UniversDMX.FTransfer)); cbFT.Model = lsCbFT; - var cellCbFt = new CellRendererText(); - cbFT.PackStart(cellCbFt,true); - cbFT.SetCellDataFunc(cellCbFt,new CellLayoutDataFunc(RenderFTName)); + //var cellCbFt = new CellRendererText(); + //cbFT.PackStart(cellCbFt,true); + //cbFT.SetCellDataFunc(cellCbFt,new CellLayoutDataFunc(RenderFTName)); foreach(var v in values) - lsCbFT.AppendValues( (UniversDMX.FTransfer)v ); + lsCbFT.AppendValues(v.ToString(), (UniversDMX.FTransfer)v ); } protected void OnCbUniversChanged (object sender, EventArgs e) diff --git a/DMX-2.0/GestionCircuits.cs b/DMX-2.0/GestionCircuits.cs index b57a139..8747206 100644 --- a/DMX-2.0/GestionCircuits.cs +++ b/DMX-2.0/GestionCircuits.cs @@ -12,6 +12,16 @@ namespace DMX2 this.Build (); + var idCol = new Gtk.TreeViewColumn(); + var idCell = new Gtk.CellRendererText(); + idCol.Title = "ID"; + idCol.PackStart(idCell,true); + idCol.SetCellDataFunc(idCell, new Gtk.TreeCellDataFunc( RenderCircuitID) ); + idCell.Editable =true; + idCell.Edited += OnNameCellEdited; + this.listeCircuits.AppendColumn(idCol); + + var nameCol = new Gtk.TreeViewColumn(); var nameCell = new Gtk.CellRendererText(); nameCol.Title = "Circuit"; @@ -55,6 +65,11 @@ namespace DMX2 c.ShortName = args.NewText; } + void RenderCircuitID (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + { + Circuit c = tree_model.GetValue (iter, 0) as Circuit; + (cell as Gtk.CellRendererText).Text = c.ID.ToString(); + } void RenderCircuitShortName (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) { Circuit c = tree_model.GetValue (iter, 0) as Circuit; diff --git a/DMX-2.0/SeqLinUI.cs b/DMX-2.0/SeqLinUI.cs index de7c725..43bfca3 100644 --- a/DMX-2.0/SeqLinUI.cs +++ b/DMX-2.0/SeqLinUI.cs @@ -246,7 +246,7 @@ namespace DMX2 fx = ( zoneWid[label] as Fixed.FixedChild); fx.X = xpos-30; fx.Y = ypos+150; - label.LabelProp = "" + c.ShortName + ""; + label.LabelProp = ""+c.ID + "-" + c.ShortName + ""; label.Show(); xpos+=30;