* DriverBoitierV2.cs: * DriverBoitierV1.cs: Sauvegarde * Conduite.cs: * EventManager.cs: * gui.stetic: * DMX2.DriverBoitierV2UI.cs: * DMX2.DriverBoitierV1UI.cs: * DriverBoitierV2UI.cs: * DriverBoitierV1UI.cs: Affichage etat driver * GestionDriversUI.cs: Gestion plusieurs drivers chargés
67 lines
No EOL
1.6 KiB
C#
67 lines
No EOL
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Gtk;
|
|
using System.IO;
|
|
|
|
namespace DMX2
|
|
{
|
|
[System.ComponentModel.ToolboxItem(true)]
|
|
public partial class DriverBoitierV1UI : Gtk.Bin
|
|
{
|
|
DriverBoitierV1 drv;
|
|
public DriverBoitierV1UI (DriverBoitierV1 _drv)
|
|
{
|
|
drv = _drv;
|
|
this.Build ();
|
|
ConstruitCBUnivers();
|
|
}
|
|
|
|
ListStore lsCbUnivers = new ListStore(typeof(UniversDMX));
|
|
void ConstruitCBUnivers ()
|
|
{
|
|
cbUnivers.Model = lsCbUnivers;
|
|
var cellCbUnivers = new CellRendererText ();
|
|
cbUnivers.PackStart (cellCbUnivers, false);
|
|
cbUnivers.SetCellDataFunc (cellCbUnivers, new CellLayoutDataFunc (RenderUniversName));
|
|
int indx = 0;
|
|
int i=0;
|
|
foreach (UniversDMX u in Conduite.Courante.Patches) {
|
|
lsCbUnivers.AppendValues (u);
|
|
if (u==drv.patch) indx=i;
|
|
i++;
|
|
}
|
|
|
|
TreeIter iter;
|
|
lsCbUnivers.GetIterFirst(out iter);
|
|
cbUnivers.SetActiveIter(iter);
|
|
cbUnivers.Active=indx;
|
|
|
|
}
|
|
|
|
void RenderUniversName (CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
|
{
|
|
UniversDMX univers = tree_model.GetValue (iter, 0) as UniversDMX;
|
|
if(univers != null)
|
|
(cell as Gtk.CellRendererText).Text = univers.Nom;
|
|
}
|
|
|
|
protected void OnCbUniversChanged (object sender, EventArgs e)
|
|
{
|
|
TreeIter iter;
|
|
if(cbUnivers.GetActiveIter(out iter))
|
|
{
|
|
drv.patch = lsCbUnivers.GetValue(iter,0) as UniversDMX;
|
|
|
|
}
|
|
}
|
|
|
|
protected void OnBtnValiderClicked (object sender, EventArgs e)
|
|
{
|
|
TreeIter iter;
|
|
if (cbUnivers.GetActiveIter (out iter)) {
|
|
drv.patch = lsCbUnivers.GetValue (iter, 0) as UniversDMX;
|
|
}
|
|
}
|
|
|
|
}
|
|
} |