This commit is contained in:
parent
4dc8f25bae
commit
5163fe6d82
3 changed files with 88 additions and 6 deletions
|
|
@ -10,6 +10,7 @@ namespace DMX2
|
|||
{
|
||||
static MainWindow win;
|
||||
static object circuitKey = new object();
|
||||
ListStore ls;
|
||||
|
||||
public static MainWindow Win {
|
||||
get { return win; }
|
||||
|
|
@ -29,6 +30,7 @@ namespace DMX2
|
|||
showAllAction.Sensitive = universAction.Sensitive = masterScale.Sensitive = seqLinAction.Sensitive = circAction.Sensitive = saveAction.Sensitive = saveAsAction.Sensitive = closeAction.Sensitive = true;
|
||||
openAction.Sensitive = newAction.Sensitive = false;
|
||||
this.Title = "DMX 2.0 - " + Conduite.Courante.Name;
|
||||
ConstruitMatrice();
|
||||
} else {
|
||||
showAllAction.Sensitive = universAction.Sensitive = masterScale.Sensitive = seqLinAction.Sensitive = circAction.Sensitive = saveAction.Sensitive = saveAsAction.Sensitive = closeAction.Sensitive = false;
|
||||
openAction.Sensitive = newAction.Sensitive = true;
|
||||
|
|
@ -59,6 +61,61 @@ namespace DMX2
|
|||
}
|
||||
}
|
||||
|
||||
protected void ConstruitMatrice ()
|
||||
{
|
||||
var idCol = new Gtk.TreeViewColumn();
|
||||
var idCell = new Gtk.CellRendererText();
|
||||
idCol.Title = "Num";
|
||||
idCol.PackStart(idCell,true);
|
||||
idCol.SetCellDataFunc(idCell, new Gtk.TreeCellDataFunc( RenderMatriceNum) );
|
||||
this.MatriceUI.AppendColumn(idCol);
|
||||
|
||||
var nomCol = new Gtk.TreeViewColumn();
|
||||
var nomCell = new Gtk.CellRendererText();
|
||||
nomCol.Title = "Nom";
|
||||
nomCol.PackStart(nomCell,true);
|
||||
nomCol.SetCellDataFunc(nomCell, new Gtk.TreeCellDataFunc( RenderMatriceNom) );
|
||||
nomCell.Editable =true;
|
||||
nomCell.Edited += OnNomCellEdited;
|
||||
this.MatriceUI.AppendColumn(nomCol);
|
||||
|
||||
var dureeCol = new Gtk.TreeViewColumn();
|
||||
var dureeCell = new Gtk.CellRendererText();
|
||||
dureeCol.Title = "Durée";
|
||||
dureeCol.PackStart(dureeCell,true);
|
||||
dureeCol.SetCellDataFunc(dureeCell, new Gtk.TreeCellDataFunc( RenderMatriceDuree) );
|
||||
dureeCell.Editable =true;
|
||||
dureeCell.Edited += OnDureeCellEdited;
|
||||
this.MatriceUI.AppendColumn(dureeCol);
|
||||
|
||||
ls = new Gtk.ListStore(typeof (SequenceurMaitre.Ligne));
|
||||
this.MatriceUI.Model = ls;
|
||||
}
|
||||
|
||||
void RenderMatriceNum (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
void RenderMatriceNom (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
void RenderMatriceDuree (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
void OnNomCellEdited (object o, EditedArgs args)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
void OnDureeCellEdited (object o, EditedArgs args)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
|
||||
{
|
||||
Application.Quit ();
|
||||
|
|
|
|||
|
|
@ -330,6 +330,7 @@ namespace DMX2
|
|||
protected void OnApplyActionActivated (object sender, EventArgs e)
|
||||
{
|
||||
int pos = IndexEffetSelectionne();
|
||||
if(pos==-1) return;
|
||||
sequenceur.RemplaceEffet(pos);
|
||||
UpdListeEffets();
|
||||
effetsListe.SetCursor(new TreePath( new int[1] {pos}) ,null,false);
|
||||
|
|
@ -344,7 +345,9 @@ namespace DMX2
|
|||
|
||||
protected void OnDeleteActionActivated (object sender, EventArgs e)
|
||||
{
|
||||
sequenceur.SupprimeEffet(IndexEffetSelectionne());
|
||||
int pos = IndexEffetSelectionne();
|
||||
if(pos==-1) return;
|
||||
sequenceur.SupprimeEffet(pos);
|
||||
UpdListeEffets();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,11 +7,32 @@ namespace DMX2
|
|||
{
|
||||
public class Ligne {
|
||||
public Ligne(){}
|
||||
Dictionary<Sequenceur,int> data = new Dictionary<Sequenceur, int>();
|
||||
public int this [Sequenceur index] {
|
||||
string nom;
|
||||
int duree = -1;
|
||||
Dictionary<Sequenceur,string> data = new Dictionary<Sequenceur, string>();
|
||||
|
||||
public string Nom {
|
||||
get {
|
||||
int value;
|
||||
if(!data.TryGetValue(index, out value)) return -1;
|
||||
return nom;
|
||||
}
|
||||
set {
|
||||
nom = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Duree {
|
||||
get {
|
||||
return duree;
|
||||
}
|
||||
set {
|
||||
duree = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string this [Sequenceur index] {
|
||||
get {
|
||||
string value;
|
||||
if(!data.TryGetValue(index, out value)) return string.Empty;
|
||||
return value;
|
||||
}
|
||||
set {
|
||||
|
|
@ -22,6 +43,8 @@ namespace DMX2
|
|||
|
||||
List<Ligne> lignes = new List<Ligne>();
|
||||
|
||||
|
||||
|
||||
public List<Ligne> Lignes {
|
||||
get {
|
||||
return lignes;
|
||||
|
|
@ -34,4 +57,3 @@ namespace DMX2
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue