diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-03-17 02:20:56 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-03-17 02:20:56 +0100 |
| commit | cc19139a50fcea74c6a9e0f330e84039b335ab73 (patch) | |
| tree | 1432ad0a0d2b492a413c674e5f8d9aa063c65d8f /Samples/dockableWindows | |
| parent | 41c27de43fee49b33ad1194c3f99ef929e66e800 (diff) | |
improve dragNdrop, debug docking
Diffstat (limited to 'Samples/dockableWindows')
| -rw-r--r-- | Samples/dockableWindows/dockableWindows.cs | 27 | ||||
| -rw-r--r-- | Samples/dockableWindows/ui/test.crow | 7 |
2 files changed, 29 insertions, 5 deletions
diff --git a/Samples/dockableWindows/dockableWindows.cs b/Samples/dockableWindows/dockableWindows.cs index 4b5a0e11..27a9612a 100644 --- a/Samples/dockableWindows/dockableWindows.cs +++ b/Samples/dockableWindows/dockableWindows.cs @@ -1,4 +1,5 @@ using Crow; +using Glfw; namespace tests { @@ -11,6 +12,17 @@ namespace tests } } + Color[] colors = + { + Colors.Blue, + Colors.Red, + Colors.Green, + Colors.Yellow, + Colors.Grey, + Colors.Onyx, + Colors.Cyan, + Colors.Chartreuse, + }; protected override void OnInitialized () { Load ("#ui.test.crow").DataSource = this; AddWidget (new DockWindow (this) { Background = Colors.Blue, Left = 10, Top = 110, Resizable = true }); @@ -23,6 +35,17 @@ namespace tests NotifyValueChanged ("GraphicTree", (object)null); NotifyValueChanged ("GraphicTree", GraphicTree); } - - } + int colorIdx = 0; + 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 }); + return true; + default: + return base.OnKeyDown (key); + } + } + } } diff --git a/Samples/dockableWindows/ui/test.crow b/Samples/dockableWindows/ui/test.crow index 3c16376b..f576fbbd 100644 --- a/Samples/dockableWindows/ui/test.crow +++ b/Samples/dockableWindows/ui/test.crow @@ -14,8 +14,9 @@ <Label Style="smallLabel" Text="{ActiveWidget}"/> </HorizontalStack> </VerticalStack> - <DockStack Height="70%"/> - <Splitter/> + <Label Text="Press 'F6' to add new windows"/> + <DockStack Name="mainDock" Height="Stretched"/> + <!--<Splitter/> <Button Caption="Refresh tree" MouseClick="refreshGraphicTree"/> <TreeView IsRoot="true" Name="treeView" Data="{GraphicTree}"> <ItemTemplate> @@ -40,5 +41,5 @@ Path="#ui.GTreeExp.itemp"/> <ItemTemplate DataType="Crow.TemplatedGroup" Data="GetChildren" Path="#ui.GTreeExp.itemp"/> - </TreeView> + </TreeView> --> </VerticalStack> |