diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-12-07 12:37:23 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-12-07 12:37:23 +0100 |
| commit | f4762349a9956bd7ae4fc11f1e165eafb0d2c444 (patch) | |
| tree | f7148e8510b18e4a929e80466696b7b79fba7c1f /Samples/dockableWindows | |
| parent | a77e1d7b06d860e040097b72cb9244a45e634e62 (diff) | |
stickyMouse, dragNdrop + mdiWins debug and teststemp
Diffstat (limited to 'Samples/dockableWindows')
| -rw-r--r-- | Samples/dockableWindows/dockableWindows.cs | 33 | ||||
| -rw-r--r-- | Samples/dockableWindows/dockableWindows.csproj | 13 | ||||
| -rw-r--r-- | Samples/dockableWindows/ui/GTreeExp.itemp | 32 | ||||
| -rw-r--r-- | Samples/dockableWindows/ui/test.crow | 44 |
4 files changed, 122 insertions, 0 deletions
diff --git a/Samples/dockableWindows/dockableWindows.cs b/Samples/dockableWindows/dockableWindows.cs new file mode 100644 index 00000000..65223acc --- /dev/null +++ b/Samples/dockableWindows/dockableWindows.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Crow; +using Glfw; + +namespace tests +{ + public class BasicTests : SampleBase + { + static void Main () + { + using (BasicTests app = new BasicTests ()) { + app.Run (); + } + } + + 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 }); + } + private void refreshGraphicTree (object sender, MouseButtonEventArgs e) { + NotifyValueChanged ("GraphicTree", (object)null); + NotifyValueChanged ("GraphicTree", GraphicTree); + } + + } +} diff --git a/Samples/dockableWindows/dockableWindows.csproj b/Samples/dockableWindows/dockableWindows.csproj new file mode 100644 index 00000000..3c9729fe --- /dev/null +++ b/Samples/dockableWindows/dockableWindows.csproj @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project Sdk="Microsoft.NET.Sdk"> + <ItemGroup> + <EmbeddedResource Include="ui\*.*"> + <LogicalName>ui.%(Filename)%(Extension)</LogicalName> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Update="ui\GTreeExp.itemp"> + <LogicalName>ui.%(Filename)%(Extension)</LogicalName> + </EmbeddedResource> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Samples/dockableWindows/ui/GTreeExp.itemp b/Samples/dockableWindows/ui/GTreeExp.itemp new file mode 100644 index 00000000..f2a7c2ba --- /dev/null +++ b/Samples/dockableWindows/ui/GTreeExp.itemp @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<Expandable IsExpanded="{²IsExpanded}" MouseDoubleClick="/onClickForExpand"> + <Template> + <VerticalStack> + <Border CornerRadius="2" Margin="0" Height="Fit" + Foreground="Transparent" + MouseEnter="{Foreground=DimGrey}" + MouseLeave="{Foreground=Transparent}"> + <HorizontalStack Spacing="1"> + <Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand" + Path="{./Image}" + Visible="{./IsExpandable}" + SvgSub="{./IsExpanded}" + MouseEnter="{Background=LightGrey}" + MouseLeave="{Background=Transparent}"/> + <Border Width="16" Height="16" Foreground="Black" Background="DimGrey"> + <Image Margin="2" Path="{GetIcon}" /> + </Border> + <Widget Width="5" Height="5" Background="Blue" Visible="{IsHover}"/> + <Widget Width="5" Height="5" Background="Green" Visible="{Visible}"/> + <Label Text="{Name}" Width="Fit"/> + <Label Text="{LogicalParent}" Width="Stretched" Foreground="Yellow"/> + </HorizontalStack> + </Border> + <Container Name="Content" Visible="false"/> + </VerticalStack> + </Template> + <HorizontalStack Height="Fit"> + <Widget Width="8" Height="10"/> + <VerticalStack Height="Fit" Name="ItemsContainer"/> + </HorizontalStack> +</Expandable> diff --git a/Samples/dockableWindows/ui/test.crow b/Samples/dockableWindows/ui/test.crow new file mode 100644 index 00000000..3c16376b --- /dev/null +++ b/Samples/dockableWindows/ui/test.crow @@ -0,0 +1,44 @@ +<?xml version="1.0"?> +<VerticalStack> + <VerticalStack Name="Watches" Background="Black" Height="Fit" Width="Stretched"> + <HorizontalStack Height="Fit"> + <Label Style="smallLabel" Text="hover:" Width="50"/> + <Label Style="smallLabel" Text="{HoverWidget}"/> + </HorizontalStack> + <HorizontalStack Height="Fit"> + <Label Style="smallLabel" Text="focus:" Width="50"/> + <Label Style="smallLabel" Text="{FocusedWidget}"/> + </HorizontalStack> + <HorizontalStack Height="Fit"> + <Label Style="smallLabel" Text="active:" Width="50"/> + <Label Style="smallLabel" Text="{ActiveWidget}"/> + </HorizontalStack> + </VerticalStack> + <DockStack Height="70%"/> + <Splitter/> + <Button Caption="Refresh tree" MouseClick="refreshGraphicTree"/> + <TreeView IsRoot="true" Name="treeView" Data="{GraphicTree}"> + <ItemTemplate> + <Border Width="Stretched" Focusable="true" Foreground="Transparent"> + <HorizontalStack Spacing="5"> + <Widget Width="5" Height="5"/> + <Border Width="16" Height="16" Foreground="Black" Background="DimGrey"> + <Image Margin="2" Path="{GetIcon}" /> + </Border> + <Widget Width="2" Height="5" Background="Blue" Visible="{IsHover}"/> + <Widget Width="5" Height="5" Background="Green" Visible="{Visible}"/> + <Label Text="{Name}" Width="Fit"/> + <Label Text="{LogicalParent}" Width="Stretched" Foreground="Yellow"/> + </HorizontalStack> + </Border> + </ItemTemplate> + <ItemTemplate DataType="Crow.Group" Data="GetChildren" + Path="#ui.GTreeExp.itemp"/> + <ItemTemplate DataType="Crow.Container" Data="GetChildren" + Path="#ui.GTreeExp.itemp"/> + <ItemTemplate DataType="Crow.TemplatedContainer" Data="GetChildren" + Path="#ui.GTreeExp.itemp"/> + <ItemTemplate DataType="Crow.TemplatedGroup" Data="GetChildren" + Path="#ui.GTreeExp.itemp"/> + </TreeView> +</VerticalStack> |