diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-08-20 20:23:23 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-08-20 20:23:23 +0200 |
| commit | 5ded9101522573336813c88d49e2ed27d70429fb (patch) | |
| tree | c1882937d54dab93be02a084b05dfb23cae517a1 /Samples/dragNdrop | |
| parent | 36f62cf1ca61cb10c6958787376ae76efb71a1ea (diff) | |
keep only HelloWorld, ShowCase and PerfTests samplesv0.9.5-beta
Diffstat (limited to 'Samples/dragNdrop')
| -rw-r--r-- | Samples/dragNdrop/dragNdrop.cs | 68 | ||||
| -rw-r--r-- | Samples/dragNdrop/dragNdrop.csproj | 8 | ||||
| -rw-r--r-- | Samples/dragNdrop/ui/GTreeExp.itemp | 32 | ||||
| -rw-r--r-- | Samples/dragNdrop/ui/test.crow | 55 |
4 files changed, 0 insertions, 163 deletions
diff --git a/Samples/dragNdrop/dragNdrop.cs b/Samples/dragNdrop/dragNdrop.cs deleted file mode 100644 index 29c22f28..00000000 --- a/Samples/dragNdrop/dragNdrop.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using Crow; -using Samples; -using Crow.Drawing; - -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; - } - - private void refreshGraphicTree (object sender, MouseButtonEventArgs e) { - NotifyValueChanged ("GraphicTree", (object)null); - NotifyValueChanged ("GraphicTree", GraphicTree); - } - - Group startGroup = null; - - - private void W_StartDrag (object sender, DragDropEventArgs e) { - Rectangle r = e.DragSource.LastPaintedSlot; - startGroup = e.DragSource.Parent as Group; - if (e.DragSource.bmp == null) { - Console.WriteLine ($"DragSource surface is null: {e.DragSource}"); - return; - } - - Surface dragImg = CreateSurface (ref r); - using (Context gr = new Context(dragImg)) { - gr.SetSource (e.DragSource.bmp, 0, 0); - gr.Paint (); - } - CreateDragImage (dragImg, r); - /*lock (UpdateMutex) - startGroup.RemoveChild (e.DragSource);*/ - } - private void W_EndDrag (object sender, DragDropEventArgs e) { - lock (UpdateMutex) - startGroup.AddChild (e.DragSource); - ClearDragImage (); - } - - private void W_DragEnter (object sender, DragDropEventArgs e) { - lock (UpdateMutex) - (e.DropTarget as Group).AddChild (e.DragSource); - } - private void W_DragLeave (object sender, DragDropEventArgs e) { - lock (UpdateMutex) - (e.DragSource.Parent as Group).RemoveChild (e.DragSource); - } - private void W_Drop (object sender, DragDropEventArgs e) { - //(e.DropTarget as Group).AddChild (e.DragSource); - ClearDragImage (); - } - - - } -} diff --git a/Samples/dragNdrop/dragNdrop.csproj b/Samples/dragNdrop/dragNdrop.csproj deleted file mode 100644 index 9961c6b9..00000000 --- a/Samples/dragNdrop/dragNdrop.csproj +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project Sdk="Microsoft.NET.Sdk"> - <ItemGroup> - <EmbeddedResource Include="ui\*.*"> - <LogicalName>ui.%(Filename)%(Extension)</LogicalName> - </EmbeddedResource> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/Samples/dragNdrop/ui/GTreeExp.itemp b/Samples/dragNdrop/ui/GTreeExp.itemp deleted file mode 100644 index f2a7c2ba..00000000 --- a/Samples/dragNdrop/ui/GTreeExp.itemp +++ /dev/null @@ -1,32 +0,0 @@ -<?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/dragNdrop/ui/test.crow b/Samples/dragNdrop/ui/test.crow deleted file mode 100644 index 026cb482..00000000 --- a/Samples/dragNdrop/ui/test.crow +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0"?> -<VerticalStack Background="Jet" Focusable="true"> - <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> - <HorizontalStack Margin="20" Name="zone1" Height="100" Width="Stretched" Background="Grey" AllowDrop="true" DragEnter="W_DragEnter" DragLeave="W_DragLeave"> - <Widget CacheEnabled="True" Name="w1" Background="Blue" Focusable="true" Width="50" Height="Stretched" AllowDrag="true" StartDrag="W_StartDrag" EndDrag="W_EndDrag" Drop="W_Drop"/> - <Widget CacheEnabled="True" Name="w2" Background="Red" Focusable="true" Width="50" Height="Stretched" AllowDrag="true" StartDrag="W_StartDrag" EndDrag="W_EndDrag" Drop="W_Drop"/>/> - <Widget CacheEnabled="True" Name="w3" Background="Green" Focusable="true" Width="50" Height="Stretched" AllowDrag="true" StartDrag="W_StartDrag" EndDrag="W_EndDrag" Drop="W_Drop"/>/> - <Widget CacheEnabled="True" Name="w4" Background="Yellow" Focusable="true" Width="50" Height="Stretched" AllowDrag="true" StartDrag="W_StartDrag" EndDrag="W_EndDrag" Drop="W_Drop"/>/> - <Widget CacheEnabled="True" Name="w5" Background="DimGrey" Focusable="true" Width="50" Height="Stretched" AllowDrag="true" StartDrag="W_StartDrag" EndDrag="W_EndDrag" Drop="W_Drop"/>/> - </HorizontalStack> - <Widget Height="20" Focusable="true"/> - <HorizontalStack Margin="20" Name="zone2" Height="150" Width="Stretched" Background="Grey" AllowDrop="true" DragEnter="W_DragEnter" DragLeave="W_DragLeave"> - </HorizontalStack> - <Widget Height="20"/> - <HorizontalStack Margin="20" Name="zone3" Height="80" Width="Stretched" Background="Grey" AllowDrop="true" DragEnter="W_DragEnter" DragLeave="W_DragLeave"> - </HorizontalStack> - <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>
\ No newline at end of file |