aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/dockableWindows/dockableWindows.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Samples/dockableWindows/dockableWindows.cs')
-rw-r--r--Samples/dockableWindows/dockableWindows.cs27
1 files changed, 18 insertions, 9 deletions
diff --git a/Samples/dockableWindows/dockableWindows.cs b/Samples/dockableWindows/dockableWindows.cs
index 27a9612a..8bf42a0b 100644
--- a/Samples/dockableWindows/dockableWindows.cs
+++ b/Samples/dockableWindows/dockableWindows.cs
@@ -17,31 +17,40 @@ namespace tests
Colors.Blue,
Colors.Red,
Colors.Green,
- Colors.Yellow,
- Colors.Grey,
- Colors.Onyx,
+ Colors.DarkOrchid,
+ Colors.DarkOrange,
+ Colors.DarkOliveGreen,
Colors.Cyan,
Colors.Chartreuse,
};
+ DockStack mainStack;
protected override void OnInitialized () {
Load ("#ui.test.crow").DataSource = this;
- AddWidget (new DockWindow (this) { Background = Colors.Blue, Left = 10, Top = 110, Resizable = true });
- AddWidget (new DockWindow (this) { Background = Colors.Red, Left = 30, Top = 130, Resizable = true });
- AddWidget (new DockWindow (this) { Background = Colors.Green, Left = 50, Top = 150, Resizable = true });
- AddWidget (new DockWindow (this) { Background = Colors.Yellow, Left = 70, Top = 170, Resizable = true });
- AddWidget (new DockWindow (this) { Background = Colors.Grey, Left = 90, Top = 190, Resizable = true });
+ mainStack = FindByName ("mainDock") as DockStack;
+ AddWidget (new DockWindow (this) { Background = Colors.Blue, Left = 10, Top = 110, Resizable = true, Caption = "win1" });
+ AddWidget (new DockWindow (this) { Background = Colors.Red, Left = 30, Top = 130, Resizable = true, Caption = "win2" });
+ AddWidget (new DockWindow (this) { Background = Colors.Green, Left = 50, Top = 150, Resizable = true, Caption = "win3" });
+ AddWidget (new DockWindow (this) { Background = Colors.BurlyWood, Left = 70, Top = 170, Resizable = true, Caption = "win4" });
+ AddWidget (new DockWindow (this) { Background = Colors.DarkOrchid, Left = 90, Top = 190, Resizable = true, Caption = "win5" });
}
private void refreshGraphicTree (object sender, MouseButtonEventArgs e) {
NotifyValueChanged ("GraphicTree", (object)null);
NotifyValueChanged ("GraphicTree", GraphicTree);
}
int colorIdx = 0;
+ int nameIdx = 6;
public override bool OnKeyDown (Key key) {
if (colorIdx >= colors.Length)
colorIdx = 0;
switch (key) {
case Key.F6:
- AddWidget (new DockWindow (this) { Background = colors[colorIdx++], Left = 90, Top = 190, Resizable = true });
+ AddWidget (new DockWindow (this) { Background = colors[colorIdx++], Left = 90, Top = 190, Resizable = true, Caption = $"win{nameIdx++}" });
+ return true;
+ case Key.F2:
+ Configuration.Global.Set<string> ("WindowConfigTest", mainStack.ExportConfig());
+ return true;
+ case Key.F3:
+ mainStack.ImportConfig (Configuration.Global.Get<string> ("WindowConfigTest"));
return true;
default:
return base.OnKeyDown (key);