diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-04-11 15:25:22 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-04-11 15:25:22 +0200 |
| commit | 8d1522d4cb7ff6db0a9f0c7a61dd75faa887fdd7 (patch) | |
| tree | 148186f17a068129ead511363616c02727d73ab6 /Samples/dockableWindows/dockableWindows.cs | |
| parent | af75526e0ba507bad1b32963437491a4f752330e (diff) | |
debug docking windows
Diffstat (limited to 'Samples/dockableWindows/dockableWindows.cs')
| -rw-r--r-- | Samples/dockableWindows/dockableWindows.cs | 27 |
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); |