* SeqLinUI.cs: Optimisation de l'affichage des tirettes.

* DMX-2.0.csproj:
* gui.stetic:
* DMX2.MainWindow.cs: 

* MainWindow.cs: Nécessaire pour permettre choix futur entre onglets
  et colonne de sequenceurs


Plus diverses choses
This commit is contained in:
tzim 2014-06-04 19:13:23 +00:00
parent e0600e9403
commit b5edcc497e
5 changed files with 69 additions and 57 deletions

View file

@ -78,7 +78,7 @@
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="style.gtkrc"> <EmbeddedResource Include="style.gtkrc">
<LogicalName>style.gtkrc</LogicalName> <LogicalName>style.gtkrc</LogicalName>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="html\page.html"> <EmbeddedResource Include="html\page.html">
<LogicalName>page.html</LogicalName> <LogicalName>page.html</LogicalName>

View file

@ -32,6 +32,8 @@ namespace DMX2
ListStore lsMatrice = null; ListStore lsMatrice = null;
FileInfo conduiteFile=null; FileInfo conduiteFile=null;
int lastSaveHash=0; int lastSaveHash=0;
Gtk.Container seqCtn=null;
public static MainWindow Win { public static MainWindow Win {
get { return win; } get { return win; }
@ -49,6 +51,21 @@ namespace DMX2
ctxHelper.AttachToWidget(btnGoBack); ctxHelper.AttachToWidget(btnGoBack);
ctxHelper.AttachToWidget(masterScale); ctxHelper.AttachToWidget(masterScale);
/*
Gtk.ScrolledWindow sw = new ScrolledWindow();
this.seqCtn = new VBox();
this.hpaned2.Add2(sw);
sw.AddWithViewport(seqCtn);
sw.HscrollbarPolicy = PolicyType.Never;
sw.VscrollbarPolicy= PolicyType.Always;
this.hpaned2.ShowAll ();
*/
seqCtn = new Gtk.Notebook();
hpaned2.Add2(seqCtn);
hpaned2.ShowAll();
} }
void EventPopup (object sender, ContextMenuEventArgs e) void EventPopup (object sender, ContextMenuEventArgs e)
@ -498,14 +515,19 @@ namespace DMX2
void AddSeqUI (Sequenceur s) void AddSeqUI (Sequenceur s)
{ {
onglets.AppendPage(s.GetUI(),new Gtk.Label(s.Name)); if (seqCtn is Gtk.Notebook) {
onglets.ShowAll(); ((Gtk.Notebook)seqCtn).AppendPage (s.GetUI (), new Gtk.Label (s.Name));
}
else if (seqCtn is Gtk.VBox) {
((Gtk.VBox)seqCtn).Add(s.GetUI());
}
seqCtn.ShowAll();
} }
protected void OnShowAllActionActivated (object sender, EventArgs e) protected void OnShowAllActionActivated (object sender, EventArgs e)
{ {
foreach (var notebookchild in onglets.Children) foreach (var widget in seqCtn.Children)
notebookchild.Destroy(); widget.Destroy();
foreach (Sequenceur s in Conduite.Courante.Sequenceurs) foreach (Sequenceur s in Conduite.Courante.Sequenceurs)
AddSeqUI(s); AddSeqUI(s);
@ -547,7 +569,7 @@ namespace DMX2
{ {
lblInfo.Text = Info.GetInfo(); lblInfo.Text = Info.GetInfo();
if(Conduite.Courante==null)return; if(Conduite.Courante==null)return;
foreach (var notebookchild in onglets.Children) { foreach (var notebookchild in seqCtn.Children) {
SequenceurUI sequi = notebookchild as SequenceurUI; SequenceurUI sequi = notebookchild as SequenceurUI;
if(sequi != null) sequi.Update(fullUpdateFlag); if(sequi != null) sequi.Update(fullUpdateFlag);
} }
@ -592,7 +614,8 @@ namespace DMX2
DetruitMatrice(); DetruitMatrice();
foreach (var widget in vboxCircuits.Children) foreach (var widget in vboxCircuits.Children)
vboxCircuits.Remove (widget); vboxCircuits.Remove (widget);
foreach (var notebookvbox in onglets.Children) if(seqCtn !=null)
foreach (var notebookvbox in seqCtn.Children)
notebookvbox.Destroy(); notebookvbox.Destroy();
} }
} }

View file

@ -341,6 +341,8 @@ namespace DMX2
lastKnownWidth = zoneWid.Allocation.Width; lastKnownWidth = zoneWid.Allocation.Width;
GtkScrolledWindow1.VscrollbarPolicy = (Parent is Gtk.VBox)? PolicyType.Never:PolicyType.Automatic;
if (lastKnownWidth < 50) { if (lastKnownWidth < 50) {
fullUpdFlag=false; fullUpdFlag=false;
return; return;
@ -369,7 +371,7 @@ namespace DMX2
fx.X = xpos; fx.X = xpos;
fx.Y = ypos; fx.Y = ypos;
label.Name = "sclTirette"; label.Name = "sclTirette";
label.Show(); //label.Show();
label.Justify = Justification.Left; label.Justify = Justification.Left;
tirettes[c] = tirette = NouvelleTirette(); tirettes[c] = tirette = NouvelleTirette();
@ -378,7 +380,7 @@ namespace DMX2
fx = ( zoneWid[tirette] as Fixed.FixedChild); fx = ( zoneWid[tirette] as Fixed.FixedChild);
fx.X = xpos; fx.X = xpos;
fx.Y = ypos + 20; fx.Y = ypos + 20;
tirette.Show(); //tirette.Show();
tirette.ValueChanged += TiretteActionee; tirette.ValueChanged += TiretteActionee;
tirette.Data.Add(circuitKey,c); tirette.Data.Add(circuitKey,c);
tirette.Data.Add(labKey,label); tirette.Data.Add(labKey,label);
@ -394,7 +396,7 @@ namespace DMX2
fx.X = xpos-30; fx.X = xpos-30;
fx.Y = ypos+150; fx.Y = ypos+150;
label.LabelProp = string.Format( "{0}-{1}", c.ID, c.ShortName); label.LabelProp = string.Format( "{0}-{1}", c.ID, c.ShortName);
label.Show(); //label.Show();
xpos+=30; xpos+=30;
if(lastKnownWidth < xpos +30) if(lastKnownWidth < xpos +30)
@ -404,6 +406,10 @@ namespace DMX2
} }
} }
UpdateValues();
zoneWid.ShowAll();
posLabel.Text = string.Format("n°{0}",sequenceur.IndexEffetCourrant +1); posLabel.Text = string.Format("n°{0}",sequenceur.IndexEffetCourrant +1);
fullUpdFlag=false; fullUpdFlag=false;

View file

@ -48,7 +48,6 @@ namespace DMX2
private global::Gtk.HPaned hpaned2; private global::Gtk.HPaned hpaned2;
private global::Gtk.ScrolledWindow GtkScrolledWindow2; private global::Gtk.ScrolledWindow GtkScrolledWindow2;
private global::Gtk.NodeView MatriceUI; private global::Gtk.NodeView MatriceUI;
private global::Gtk.Notebook onglets;
private global::Gtk.ScrolledWindow scrolledwindow2; private global::Gtk.ScrolledWindow scrolledwindow2;
private global::Gtk.VBox vboxCircuits; private global::Gtk.VBox vboxCircuits;
private global::Gtk.HSeparator hseparator1; private global::Gtk.HSeparator hseparator1;
@ -394,15 +393,9 @@ namespace DMX2
this.hpaned2.Add (this.GtkScrolledWindow2); this.hpaned2.Add (this.GtkScrolledWindow2);
global::Gtk.Paned.PanedChild w66 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.GtkScrolledWindow2])); global::Gtk.Paned.PanedChild w66 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.GtkScrolledWindow2]));
w66.Resize = false; w66.Resize = false;
// Container child hpaned2.Gtk.Paned+PanedChild
this.onglets = new global::Gtk.Notebook ();
this.onglets.CanFocus = true;
this.onglets.Name = "onglets";
this.onglets.CurrentPage = 0;
this.hpaned2.Add (this.onglets);
this.hpaned1.Add (this.hpaned2); this.hpaned1.Add (this.hpaned2);
global::Gtk.Paned.PanedChild w68 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.hpaned2])); global::Gtk.Paned.PanedChild w67 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.hpaned2]));
w68.Resize = false; w67.Resize = false;
// Container child hpaned1.Gtk.Paned+PanedChild // Container child hpaned1.Gtk.Paned+PanedChild
this.scrolledwindow2 = new global::Gtk.ScrolledWindow (); this.scrolledwindow2 = new global::Gtk.ScrolledWindow ();
this.scrolledwindow2.WidthRequest = 150; this.scrolledwindow2.WidthRequest = 150;
@ -410,32 +403,32 @@ namespace DMX2
this.scrolledwindow2.Name = "scrolledwindow2"; this.scrolledwindow2.Name = "scrolledwindow2";
this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1)); this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child scrolledwindow2.Gtk.Container+ContainerChild // Container child scrolledwindow2.Gtk.Container+ContainerChild
global::Gtk.Viewport w69 = new global::Gtk.Viewport (); global::Gtk.Viewport w68 = new global::Gtk.Viewport ();
w69.ShadowType = ((global::Gtk.ShadowType)(0)); w68.ShadowType = ((global::Gtk.ShadowType)(0));
// Container child GtkViewport1.Gtk.Container+ContainerChild // Container child GtkViewport1.Gtk.Container+ContainerChild
this.vboxCircuits = new global::Gtk.VBox (); this.vboxCircuits = new global::Gtk.VBox ();
this.vboxCircuits.Name = "vboxCircuits"; this.vboxCircuits.Name = "vboxCircuits";
this.vboxCircuits.Spacing = 2; this.vboxCircuits.Spacing = 2;
w69.Add (this.vboxCircuits); w68.Add (this.vboxCircuits);
this.scrolledwindow2.Add (w69); this.scrolledwindow2.Add (w68);
this.hpaned1.Add (this.scrolledwindow2); this.hpaned1.Add (this.scrolledwindow2);
global::Gtk.Paned.PanedChild w72 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.scrolledwindow2])); global::Gtk.Paned.PanedChild w71 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.scrolledwindow2]));
w72.Resize = false; w71.Resize = false;
w72.Shrink = false; w71.Shrink = false;
this.hbox1.Add (this.hpaned1); this.hbox1.Add (this.hpaned1);
global::Gtk.Box.BoxChild w73 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.hpaned1])); global::Gtk.Box.BoxChild w72 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.hpaned1]));
w73.Position = 2; w72.Position = 2;
this.vbox1.Add (this.hbox1); this.vbox1.Add (this.hbox1);
global::Gtk.Box.BoxChild w74 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1])); global::Gtk.Box.BoxChild w73 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));
w74.Position = 0; w73.Position = 0;
// Container child vbox1.Gtk.Box+BoxChild // Container child vbox1.Gtk.Box+BoxChild
this.hseparator1 = new global::Gtk.HSeparator (); this.hseparator1 = new global::Gtk.HSeparator ();
this.hseparator1.Name = "hseparator1"; this.hseparator1.Name = "hseparator1";
this.vbox1.Add (this.hseparator1); this.vbox1.Add (this.hseparator1);
global::Gtk.Box.BoxChild w75 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hseparator1])); global::Gtk.Box.BoxChild w74 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hseparator1]));
w75.Position = 1; w74.Position = 1;
w75.Expand = false; w74.Expand = false;
w75.Fill = false; w74.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild // Container child vbox1.Gtk.Box+BoxChild
this.hbox4 = new global::Gtk.HBox (); this.hbox4 = new global::Gtk.HBox ();
this.hbox4.Name = "hbox4"; this.hbox4.Name = "hbox4";
@ -446,10 +439,10 @@ namespace DMX2
this.toolbar7.Name = "toolbar7"; this.toolbar7.Name = "toolbar7";
this.toolbar7.ShowArrow = false; this.toolbar7.ShowArrow = false;
this.hbox4.Add (this.toolbar7); this.hbox4.Add (this.toolbar7);
global::Gtk.Box.BoxChild w76 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar7])); global::Gtk.Box.BoxChild w75 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar7]));
w76.Position = 0; w75.Position = 0;
w76.Expand = false; w75.Expand = false;
w76.Fill = false; w75.Fill = false;
// Container child hbox4.Gtk.Box+BoxChild // Container child hbox4.Gtk.Box+BoxChild
this.evInfo = new global::Gtk.EventBox (); this.evInfo = new global::Gtk.EventBox ();
this.evInfo.Name = "evInfo"; this.evInfo.Name = "evInfo";
@ -459,8 +452,8 @@ namespace DMX2
this.lblInfo.LabelProp = "info"; this.lblInfo.LabelProp = "info";
this.evInfo.Add (this.lblInfo); this.evInfo.Add (this.lblInfo);
this.hbox4.Add (this.evInfo); this.hbox4.Add (this.evInfo);
global::Gtk.Box.BoxChild w78 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.evInfo])); global::Gtk.Box.BoxChild w77 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.evInfo]));
w78.Position = 1; w77.Position = 1;
// Container child hbox4.Gtk.Box+BoxChild // Container child hbox4.Gtk.Box+BoxChild
this.UIManager.AddUiFromString ("<ui><toolbar name='toolbar8'><toolitem name='newAction' action='newAction'/><toolitem name='openAction' action='openAction'/><toolitem name='saveAction' action='saveAction'/><toolitem name='saveAsAction' action='saveAsAction'/><toolitem name='closeAction' action='closeAction'/><toolitem name='aboutAction' action='aboutAction'/><toolitem name='quitAction' action='quitAction'/></toolbar></ui>"); this.UIManager.AddUiFromString ("<ui><toolbar name='toolbar8'><toolitem name='newAction' action='newAction'/><toolitem name='openAction' action='openAction'/><toolitem name='saveAction' action='saveAction'/><toolitem name='saveAsAction' action='saveAsAction'/><toolitem name='closeAction' action='closeAction'/><toolitem name='aboutAction' action='aboutAction'/><toolitem name='quitAction' action='quitAction'/></toolbar></ui>");
this.toolbar8 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar8"))); this.toolbar8 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar8")));
@ -468,15 +461,15 @@ namespace DMX2
this.toolbar8.ShowArrow = false; this.toolbar8.ShowArrow = false;
this.toolbar8.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.toolbar8.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0));
this.hbox4.Add (this.toolbar8); this.hbox4.Add (this.toolbar8);
global::Gtk.Box.BoxChild w79 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar8])); global::Gtk.Box.BoxChild w78 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar8]));
w78.Position = 2;
w78.Expand = false;
w78.Fill = false;
this.vbox1.Add (this.hbox4);
global::Gtk.Box.BoxChild w79 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox4]));
w79.Position = 2; w79.Position = 2;
w79.Expand = false; w79.Expand = false;
w79.Fill = false; w79.Fill = false;
this.vbox1.Add (this.hbox4);
global::Gtk.Box.BoxChild w80 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox4]));
w80.Position = 2;
w80.Expand = false;
w80.Fill = false;
this.Add (this.vbox1); this.Add (this.vbox1);
if ((this.Child != null)) { if ((this.Child != null)) {
this.Child.ShowAll (); this.Child.ShowAll ();

View file

@ -479,17 +479,7 @@ page</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="Gtk.Notebook" id="onglets"> <placeholder />
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="CurrentPage">0</property>
<child>
<placeholder />
</child>
<child>
<placeholder />
</child>
</widget>
</child> </child>
</widget> </widget>
<packing> <packing>