]> O.S.I.I.S - jp/crow.git/commitdiff
styling and debugging
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 20 May 2020 22:46:43 +0000 (00:46 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 20 May 2020 22:46:43 +0000 (00:46 +0200)
36 files changed:
Crow.sln
Crow/Crow.csproj
Crow/Default.style
Crow/Templates/ArrowBut.template
Crow/Templates/CheckBox.template
Crow/Templates/ComboBox.template
Crow/Templates/Expandable.template
Crow/Templates/GroupBox.template
Crow/Templates/HScrollBar.template
Crow/Templates/RadioButton.template
Crow/Templates/ScrollBar.template
Crow/Templates/Spinner.template
Crow/src/Colors.cs
Crow/src/Interface.cs
Crow/src/PerformanceMeasure.cs
Crow/src/Widgets/Label.cs
Crow/src/Widgets/Widget.cs
Directory.Build.props
Samples/BasicTests/BasicTests.cs
Samples/BasicTests/BasicTests.csproj
Samples/Directory.Build.props [new file with mode: 0644]
Samples/HelloWorld/HelloWorld.csproj
Samples/HelloWorld/ILView.cs [deleted file]
Samples/HelloWorld/ui/helloworld.crow
Samples/ShowCase/ShowCase.csproj
Samples/ShowCase/main.cs
Samples/ShowCase/ui/showcase.crow
Samples/common/CrowVkWin.cs [deleted file]
Samples/common/CrowWin.cs [deleted file]
Samples/common/SampleBase.cs [new file with mode: 0644]
Samples/common/ui/Interfaces/Divers/0.crow
Samples/common/ui/Interfaces/Divers/testColors.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/TemplatedControl/testCombobox.crow
Samples/common/ui/Interfaces/TemplatedControl/testScrollbar.crow
Samples/common/ui/Interfaces/TemplatedControl/testSpinner.crow
Samples/common/ui/Interfaces/colorItem.crow

index 0974d737e505657571decbdade1cf51e93b86bae..d8a144c81f3d332b31e394ea7815603a76250e6f 100644 (file)
--- a/Crow.sln
+++ b/Crow.sln
@@ -1,27 +1,28 @@
-
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30104.148
+MinimumVisualStudioVersion = 10.0.40219.1
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{7285454A-930F-4536-AB84-C076B44C0C80}"
        ProjectSection(SolutionItems) = preProject
                Directory.Build.props = Directory.Build.props
                README.md = README.md
        EndProjectSection
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow", "Crow\Crow.csproj", "{C2980F9B-4798-4C05-99E2-E174810F7C7B}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Crow", "Crow\Crow.csproj", "{C2980F9B-4798-4C05-99E2-E174810F7C7B}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "Samples\HelloWorld\HelloWorld.csproj", "{F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloWorld", "Samples\HelloWorld\HelloWorld.csproj", "{F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShowCase", "Samples\ShowCase\ShowCase.csproj", "{56329D48-D382-4850-93DE-59C453894E8A}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShowCase", "Samples\ShowCase\ShowCase.csproj", "{56329D48-D382-4850-93DE-59C453894E8A}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlLib", "Samples\ControlLib\ControlLib.csproj", "{91F1CE07-EECE-4F1D-A3EE-7239B563654A}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlLib", "Samples\ControlLib\ControlLib.csproj", "{91F1CE07-EECE-4F1D-A3EE-7239B563654A}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "unitTests", "unitTests\unitTests.csproj", "{0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "unitTests", "unitTests\unitTests.csproj", "{0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicTests", "Samples\BasicTests\BasicTests.csproj", "{7AEB6DD5-916E-4415-84E1-78EC6E5881CE}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicTests", "Samples\BasicTests\BasicTests.csproj", "{7AEB6DD5-916E-4415-84E1-78EC6E5881CE}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PerfTests", "PerfTests\PerfTests.csproj", "{18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerfTests", "PerfTests\PerfTests.csproj", "{18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}"
 EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -34,18 +35,18 @@ Global
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.Build.0 = Release|Any CPU
                {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|Any CPU.Build.0 = Release|Any CPU
                {56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.Build.0 = Release|Any CPU
-               {56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {91F1CE07-EECE-4F1D-A3EE-7239B563654A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {91F1CE07-EECE-4F1D-A3EE-7239B563654A}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}.Release|Any CPU.Build.0 = Release|Any CPU
                {7AEB6DD5-916E-4415-84E1-78EC6E5881CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {7AEB6DD5-916E-4415-84E1-78EC6E5881CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -56,6 +57,18 @@ Global
                {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Release|Any CPU.Build.0 = Release|Any CPU
        EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+       GlobalSection(NestedProjects) = preSolution
+               {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
+               {56329D48-D382-4850-93DE-59C453894E8A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
+               {91F1CE07-EECE-4F1D-A3EE-7239B563654A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
+               {7AEB6DD5-916E-4415-84E1-78EC6E5881CE} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
+       EndGlobalSection
+       GlobalSection(ExtensibilityGlobals) = postSolution
+               SolutionGuid = {00D4E149-7131-49F4-BAAD-559AA961A78E}
+       EndGlobalSection
        GlobalSection(MonoDevelopProperties) = preSolution
                Policies = $0
                $0.StandardHeader = $1
@@ -94,10 +107,4 @@ Global
                description = @C.R.O.W. c# Rapid Open Widgets\n\nCrow is a pure c# widget toolkit with XML definition of interface, bindings, styling...\n
                version = 0.8.0
        EndGlobalSection
-       GlobalSection(NestedProjects) = preSolution
-               {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
-               {56329D48-D382-4850-93DE-59C453894E8A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
-               {91F1CE07-EECE-4F1D-A3EE-7239B563654A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
-               {7AEB6DD5-916E-4415-84E1-78EC6E5881CE} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
-       EndGlobalSection
 EndGlobal
index f9881edefc7753ad9f88a7133bf6893f599f0fec..2e1911d72e69d6311fc8e6cf11be945a4630037c 100644 (file)
@@ -4,6 +4,7 @@
                <TargetFrameworks>netstandard2.0</TargetFrameworks>
                
                <AssemblyVersion>$(CrowVersion)</AssemblyVersion>
+               <ReleaseVersion>$(CrowVersion)</ReleaseVersion>
                <PackageVersion>$(CrowPackageVersion)</PackageVersion>
                
                <Title>C# Rapid Open Widget Toolkit</Title>
                <License>MIT</License>
                <Authors>Jean-Philippe Bruyère</Authors>
                <RepositoryUrl>https://github.com/jpbruyere/Crow</RepositoryUrl>
-               <PackageTags>GUI Widget toolkit Interface C# .Net Mono</PackageTags>
+               <PackageTags>GUI Widget toolkit Interface C# Net</PackageTags>
                <PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
                <PackageProjectUrl>https://github.com/jpbruyere/Crow/wiki</PackageProjectUrl>
                <PackageLicense>https://opensource.org/licenses/MIT</PackageLicense>
                <PackageIcon>crow.png</PackageIcon>
-               <PackageCopyright>Copyright 2013-2019</PackageCopyright>
+               <PackageCopyright>Copyright 2013-2020</PackageCopyright>
                <PackageReleaseNotes>
-                       This release should solve most of ms dotnet exception, the win32 backend is
-                       still untested. Next beta will have a glfw backend.
+                       This release is a major step to finaly get a 1.0 version of crow.
+                       A single glfw backend to handle os layers, and NetCore target for samples
+                       to overcome CAS exceptions on windows.
                </PackageReleaseNotes>
                <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
                <GenerateDocumentationFile>true</GenerateDocumentationFile>
                <NoWarn>$(NoWarn);1591;1587;1570;1572;1573;1574</NoWarn>
-               <DefineConstants>DESIGN_MODE</DefineConstants>
-               <DefineConstants>DESIGN_MODE</DefineConstants>
+               <DefineConstants>_DESIGN_MODE</DefineConstants>         
                <EnableDefaultItems>false</EnableDefaultItems>
                <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
        </PropertyGroup>
        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
                <DebugType>full</DebugType>
-               <DefineConstants>DEBUG;TRACE;MEASURE_TIME;_DEBUG_DISPOSE;_DEBUG_BINDING;DESIGN_MODE;_DEBUG_CLIP_RECTANGLE;_DEBUG_FOCUS;DEBUG_DRAGNDROP;_DEBUG_LOG</DefineConstants>
+               <DefineConstants>DEBUG;TRACE;MEASURE_TIME;_DEBUG_DISPOSE;_DEBUG_BINDING;_DEBUG_CLIP_RECTANGLE;_DEBUG_FOCUS;DEBUG_DRAGNDROP;_DEBUG_LOG</DefineConstants>
                <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
        </PropertyGroup>
        <ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
                <PackageReference Include="System.Reflection.Emit.ILGeneration" Version="4.6.0" />
                <PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.6.0" />
-               <PackageReference Include="glfw-sharp" Version="0.2.6" />
+               <PackageReference Include="glfw-sharp" Version="0.2.6-beta" />
                <PackageReference Include="FastEnum" Version="1.5.3" />
        </ItemGroup>
        <PropertyGroup Condition=" '$(CrowStbSharp)' == 'true'">
                        <LogicalName>Crow.Cursors.%(Filename)</LogicalName>
                </EmbeddedResource>
        </ItemGroup>
-<!--   <ItemGroup>
-         <ProjectReference Include="..\..\..\glfw-sharp\glfw-sharp.csproj" />
-       </ItemGroup>-->
-       <!--<ItemGroup>
-         <Compile Remove="src\Widgets\ColorPicker2.cs" />
-         <Compile Remove="src\Widgets\ColorSlider.cs" />
-       </ItemGroup>
-       <ItemGroup>
-         <None Include="src\Widgets\ColorPicker2.cs" />
-         <None Include="src\Widgets\ColorSlider.cs" />
-       </ItemGroup>-->
        <ItemGroup>
          <Compile Remove="src\Widgets\ColorPicker2.cs" />
        </ItemGroup>
-       <ItemGroup>
-         <None Include="src\Widgets\ColorPicker2.cs" />
-       </ItemGroup>
 </Project>
index c031339e6b9deca20a8ffd38e91c491d1d4d8f0a..6264dafeafa1831dd448853f7c90ee799a344049 100644 (file)
@@ -12,15 +12,26 @@ Expandable { Caption = "Expandable"; }
 Popper { Caption = "Popper";}
 GroupBox { Caption = "Group Box"; }
 
+Control {
+       Margin="0";
+       Spacing="3";
+}
 ControlBorder {
        BorderWidth     = "1";
        Foreground  = "DimGrey";
        Background      = "Transparent";
+       CornerRadius = "0";     
 }
 ControlCaption {
-       Foreground  = "Grey";
+       Foreground  = "LightGrey";
        MouseEnter      = "{Foreground=White}";
-       MouseLeave      = "{Foreground=Grey}";
+       MouseLeave      = "{Foreground=LightGrey}";
+}
+ControlEditableText {
+       Foreground      = "LightGrey";
+       Background      = "Transparent";
+       MinimumSize     = "80,10";
+       Margin          = "1";
 }
 Icon {
        Margin = "1";
@@ -88,9 +99,7 @@ Splitter {
        Margin = "1";
        Background = "Grey";
 }
-Spinner {      
-       Foreground = "Grey";
-}
+
 TabView {
        CacheEnabled = "false";
        AllowDrop = "true";
@@ -163,10 +172,6 @@ ProgressBar {
 Scroller {
        CacheEnabled = "false";
 }
-Control {
-       Margin="0";
-       Spacing="3";
-}
 SaturationValueSelector {
        Foreground="Red";
 }
@@ -198,14 +203,14 @@ ArrowBut {
        MouseRepeat="true";     
        Focusable="true";
        
-       Foreground="Jet";
+       Foreground="Grey";
        Background="Transparent";
        
-       MouseUp="{Background=Transparent}";
-       MouseDown="{Background=Grey}";
+       //MouseUp="{Background=Transparent}";
+       //MouseDown="{Background=Grey}";
        
        MouseEnter="{Foreground=CornflowerBlue}";
-       MouseLeave="{Foreground=Jet}";
+       MouseLeave="{Foreground=Grey}";
        
        Margin="2";
        KeepProportions="true";
@@ -215,7 +220,7 @@ ScrollBar {
     Maximum = "0";
     Value = "0";
     Foreground="Transparent";
-    Background="DimGrey";
+    Background="Onyx";
     Width = "12";    
     CornerRadius = "0";
 }
index 2d3bb29294f492d2e7bd129d87f36a01b914dce3..913245e602d7345ef9bcf3dd43ea0e9b5e68a256 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0"?>
 <Border Name="Content"
-       Background="vgradient|0:White|0.1:LightGrey|0.9:LightGrey|1:Black" Foreground="DarkGrey" 
+       Background="vgradient|0:White|0.1:LightGrey|0.9:LightGrey|1:Black" Foreground="Grey" 
        MouseEnter="{Foreground=White}"
-       MouseLeave="{Foreground=DarkGrey}"
+       MouseLeave="{Foreground=Grey}"
        MouseDown="{Background=vgradient|0:Black|0.1:LightGrey|0.9:LightGrey|1:White}"
        MouseUp="{Background=vgradient|0:White|0.1:LightGrey|0.9:LightGrey|1:Black}"
        >
index f24b50a786450fad1dc33b2aafc00f03e9c93f77..795c293f64e46dfd5fa980fc4ee260f00e6aa2fe 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0"?>
 <HorizontalStack Style="Control" Background="{./Background}">
-       <Image Style="Icon" Path="#Crow.Icons.checkbox.svg"
-               SvgSub="{./IsChecked}"/>
-       <Label Font="{./Font}" Text="{./Caption}" Foreground="{./Foreground}"/>
+       <Image Style="Icon" Path="#Crow.Icons.checkbox.svg" SvgSub="{./IsChecked}"/>
+       <Label Style="ControlCaption" Font="{./Font}" Text="{./Caption}" Foreground="{./Foreground}"/>
 </HorizontalStack>
\ No newline at end of file
index 5b43b99c0e0490c7ec998e99824dcbc1f59a0487..8e13b6839b297f54c29f7d588d132b5e95a7a94b 100644 (file)
@@ -3,22 +3,19 @@
        <Template>
                <CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}" Foreground="{./Foreground}" Background="{./Background}">
                        <Template>
-                               <Border CornerRadius="0" Foreground="LightGrey">
+                               <Border Style="ControlBorder" >
                                        <HorizontalStack Margin="0" Spacing="1">
-                                               <TextBox MinimumSize="80,10" Margin="1" Foreground="Black" Background="White"
-                                                       Text="{./Caption}"/>
-                                               <Button Width="14" Height="14" Focusable="false"
-                                                       Template="#Crow.ArrowBut.template">
-                                                       <Image Margin="0"  Path="#Crow.Icons.updown.svg" SvgSub="down"/>
-                                               </Button>
+                                               <TextBox Style="ControlEditableText" Text="{./Caption}"/>
+                                               <Shape Style="ArrowBut" MouseDown="./onScrollForth" Width="10" Height="Stretched"
+                                                       Size="10,10" Path="M 0.5,0.5 L 9.5,0.5 L 4.5,9.5 Z F"/>
                                        </HorizontalStack>
                                </Border>
                        </Template>
                </CheckBox>
        </Template>
-       <Border Background="DimGrey" BorderWidth="1" Margin="1" Height="Fit" Width="1"
+       <Border Background="Onyx" Foreground="DimGrey" BorderWidth="1" Margin="1" Height="Fit" Width="1"
                MinimumSize="{../../MinimumPopupSize}" >
-               <Scroller Name="scroller1" Margin="2
+               <Scroller Name="scroller1" Margin="1
                        MaximumSize="0,200"
                        HorizontalAlignment="Left">
                        <VerticalStack
index e0ba29b8efa0c040ea70b836fdecfdaeaec9b743..36137e26198ecb1e1bee797abecf59786098bf26 100644 (file)
@@ -3,12 +3,8 @@
        <VerticalStack>
                <HorizontalStack Spacing="1" Height="Fit" Focusable="true" MouseDoubleClick="./onClickForExpand">
                        <Container Margin="1" Width="9" Height="9" MouseDown="./onClickForExpand"
-                                                                                                               MouseEnter="{Background=LightGrey}"
-                                                                                                               MouseLeave="{Background=Transparent}">
-                               <Image
-                                       Path="#Crow.Icons.expandable.svg"
-                                       Visible="{./IsExpandable}"
-                                       SvgSub="{./IsExpanded}"/>
+                                       MouseEnter="{Background=CornflowerBlue}" MouseLeave="{Background=Transparent}">
+                               <Image Path="#Crow.Icons.expandable.svg" Visible="{./IsExpandable}"     SvgSub="{./IsExpanded}"/>
                        </Container>
                        <Label Style="ControlCaption" Text="{./Caption}"/>
                </HorizontalStack>
index f10b1c4cb5d088d9afc2b9a0f9f72e3cb048382d..cab9156471a54ec5646b474f2031a233c8c3c36a 100644 (file)
@@ -7,7 +7,6 @@
                                <Container Name="Content" Margin="0" MinimumSize="70,10"/>
                        </Border>
                </VerticalStack>
-               <Label Text="{./Caption}" VerticalAlignment="Top" Left="8"
-                       Background="Clear" Margin="1"/>
+               <Label Text="{./Caption}" VerticalAlignment="Top" Left="8" Background="Clear" Margin="1"/>
        </Group>
 </Container>
\ No newline at end of file
index 18c32fdbf103ea16934c3f6e3445aa3f6b1535c4..393ea9a00546494ba41bc150d0b71a367545eb6a 100644 (file)
@@ -11,7 +11,7 @@
                        Height="{./HeightPolicy}" Width="{./WidthPolicy}"
                        LargeIncrement="{./LargeIncrement}"
                        SmallIncrement="{./SmallIncrement}"
-                       CursorColor="Onyx"
+                       CursorColor="Grey"
       Background="Transparent" Foreground="{./Foreground}"/>
                <Shape Style="ArrowBut" MouseDown="./onScrollForth"
        Width="10" Size="10,10" Path="M 0.5,0.5 L 9.5,4.5 L 0.5,9.5 Z F"/>
index 8e97a788ab9241fff5700dcf9b64a37cac23780e..36a17495893b357445897defb051ca6b9db6c907 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0"?>
 <HorizontalStack Style="Control" Background="{./Background}">
-       <Image Style="Icon" Path="#Crow.Icons.radiobutton.svg"
-               SvgSub="{./IsChecked}"/>
-       <Label Text="{./Caption}"/>
+       <Image Style="Icon" Path="#Crow.Icons.radiobutton.svg" SvgSub="{./IsChecked}"/>
+       <Label Style="ControlCaption" Font="{./Font}" Text="{./Caption}" Foreground="{./Foreground}"/>
 </HorizontalStack>
\ No newline at end of file
index c1835f13b467b27fec84b7995a56e232bde3fb8b..59387a44dcb97e3f75eb7c3493fc13a5ad860aca 100644 (file)
@@ -2,7 +2,7 @@
 <Border BorderWidth="1" Foreground="{./Foreground}" Background="{./Background}">
        <GenericStack Orientation="{./Orientation}" Spacing="0">
                <Shape Style="ArrowBut" MouseDown="./onScrollBack"
-       Height="10" Size="10,10" Path="M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z F"/>
+               Height="10" Size="10,10" Path="M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z F"/>
                <Slider Name="Slider"                   
                        Orientation="{./Orientation}"
                        Value="{²./Value}"
@@ -11,9 +11,9 @@
                        Height="{./HeightPolicy}" Width="{./WidthPolicy}"
                        LargeIncrement="{./LargeIncrement}"
                        SmallIncrement="{./SmallIncrement}"
-                       CursorColor="Onyx"
+                       CursorColor="Grey"
                        Background="Transparent" Foreground="{./Foreground}"/>
                <Shape Style="ArrowBut" MouseDown="./onScrollForth"
-      Height="10" Size="10,10" Path="M 0.5,0.5 L 9.5,0.5 L 4.5,9.5 Z F"/>
+                       Height="10" Size="10,10" Path="M 0.5,0.5 L 9.5,0.5 L 4.5,9.5 Z F"/>
        </GenericStack>
 </Border>
\ No newline at end of file
index f81a128a743997fff07421916f0f5331469a665b..825f75b62d08d1a8c0e3bd65f548cca0081ebcd0 100644 (file)
@@ -1,12 +1,11 @@
 <?xml version="1.0"?>
-<HorizontalStack MinimumSize="40,13" Name="hstack" Margin="0" Spacing="0" Background="{./Background}">
-       <Border BorderWidth="1" Width="75%"  Background="White" 
-               Foreground="{./Foreground}" Margin="0">
-               <TextBox Foreground="{./Foreground}" Font="{./Font}" Width="Stretched"
-                       Text="{²./Value}" TextAlignment="Right" Margin="0"/>
-       </Border>
-       <VerticalStack MinimumSize="13,13" Width="16" Height="Stretched" Spacing="1" Margin="1">
-               <Shape Style="ArrowBut" Height="50%" MouseDown="./onUp" Size="10,10" Path="M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z G"/>                 
-               <Shape Style="ArrowBut" Height="50%" MouseDown="./onDown" Size="10,10" Path="M 0.5,0.5 L 9.5,0.5 L 4.5,9.5 Z G"/>
-       </VerticalStack>
-</HorizontalStack>
+<Border Style="ControlBorder" >
+       <HorizontalStack Margin="0" Spacing="1">
+               <TextBox Style="ControlEditableText" Foreground="{./Foreground}" Font="{./Font}" Width="Stretched"
+                       Text="{²./Value}" TextAlignment="Right" />
+               <VerticalStack Width="16" Height="Stretched" Spacing="0" Margin="2">
+                       <Shape KeepProportions="false" Margin="1" Style="ArrowBut" Height="50%" MouseDown="./onUp" Size="10,10" Path="M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z F"/>
+                       <Shape KeepProportions="false" Margin="1" Style="ArrowBut"      Height="50%" MouseDown="./onDown" Size="10,10" Path="M 0.5,0.5 L 9.5,0.5 L 4.5,9.5 Z F"/>
+               </VerticalStack>
+       </HorizontalStack>
+</Border>
\ No newline at end of file
index b75bcd0a54189113e6302a8167246f84b0974c26..8dd772d782b959671a5bbba5dc640aaf9fb7a06f 100644 (file)
@@ -35,7 +35,7 @@ namespace Crow
                DarkBlue             = 0x00008BFF,
                DarkCyan             = 0x008B8BFF,
                DarkGoldenRod        = 0xB8860BFF,
-               DarkGrey             = 0xA9A9A9FF,
+               DarkGrey             = 0x202020FF,
                DarkGreen            = 0x006400FF,
                DarkKhaki            = 0xBDB76BFF,
                DarkMagenta          = 0x8B008BFF,
index 7e783b09eaf73a584703fc19561871d9a4b5e215..f97eb8e17ba6d24f8739a9793fa19ec118760bc8 100644 (file)
@@ -1156,8 +1156,7 @@ namespace Crow
                                cursor = value;
 
                                currentCursor?.Dispose ();
-                               currentCursor = createCursor (cursor);
-                               System.Diagnostics.Debug.WriteLine ($"cursor=>{cursor}");
+                               currentCursor = createCursor (cursor);                          
                                currentCursor.Set (hWin);
                                //MouseCursorChanged.Raise (this,new MouseCursorChangedEventArgs(cursor));
                        }
index 3c978e8b473e379353b63c7aee19e80300eca9f1..4f489eab050916e3ee72aebebe4d6442f933b439 100644 (file)
@@ -71,15 +71,15 @@ namespace Crow
                }
 
                void computeStats(){                    
-                       current = timer.ElapsedTicks;
+                       current = timer.ElapsedMilliseconds;
                        if (current < cancelLimit)
                                return;
                        cptMeasures++;
-                       total += timer.ElapsedTicks;
-                       if (timer.ElapsedTicks < minimum)
-                               minimum = timer.ElapsedTicks;
-                       if (timer.ElapsedTicks > maximum)
-                               maximum = timer.ElapsedTicks;                   
+                       total += timer.ElapsedMilliseconds;
+                       if (timer.ElapsedMilliseconds < minimum)
+                               minimum = timer.ElapsedMilliseconds;
+                       if (timer.ElapsedMilliseconds > maximum)
+                               maximum = timer.ElapsedMilliseconds;                    
                }
                void ResetStats(){
                        Debug.WriteLine("reset measure cpt:{0}",cptMeasures);
index 4c22e3a156778c326980a4788e3ff682209175a9..eef5cbd928c2ad938164ea47fb3523bc3baeed28 100644 (file)
@@ -242,7 +242,7 @@ namespace Crow {
                [XmlIgnore]protected Char CurrentChar
                {
                        get {
-                               return lines [CurrentLine] [CurrentColumn];
+                               return lines [CurrentLine][CurrentColumn];
                        }
                }
                /// <summary>
index bfd6114dfbe1e9c7f1b927d468ba22db77bf0a72..d2cf5bcb391290537d675a0d322b542793905537 100644 (file)
@@ -800,7 +800,7 @@ namespace Crow
                /// <summary>
                /// Font being used in many controls, it is defined in the base GraphicObject class.
                /// </summary>
-               [DesignCategory ("Appearance")][DefaultValue("sans, 10")]
+               [DesignCategory ("Appearance")][DefaultValue("sans, 12")]
                public virtual Font Font {
                        get { return font; }
                        set {
@@ -1093,7 +1093,7 @@ namespace Crow
                        //all other instance of this type would not longer use reflexion to init properly
                        //but will fetch the  dynamic initialisation method compiled for this precise type
                        //TODO:measure speed gain.
-#region Delfault values Loading dynamic compilation
+                       #region Delfault values Loading dynamic compilation
                        DynamicMethod dm = null;
                        ILGenerator il = null;
 
index efe9a24dfa6b8ebbea4f0a74f708a7e36924916b..98e14228cae40f999f4c26c068083474257d643a 100644 (file)
@@ -7,7 +7,7 @@
                <Authors>Jean-Philippe Bruyère</Authors>           
                <LangVersion>7.2</LangVersion>
                
-               <CrowVersion>0.9.5</CrowVersion>
+               <CrowVersion>0.9.0</CrowVersion>
                <CrowPackageVersion>$(CrowVersion)-beta</CrowPackageVersion>
                <CrowStbSharp>true</CrowStbSharp>
        </PropertyGroup>
index 2fdc50ba100271fd034b9aecee78dbd8a94b16cf..b0d99ccca65637aead72b6521d22b85be84a7958 100644 (file)
@@ -8,7 +8,7 @@ using Glfw;
 
 namespace tests
 {
-       public class BasicTests : Interface
+       public class BasicTests : SampleBase
        {
                [STAThread]
                static void Main ()
@@ -34,7 +34,7 @@ namespace tests
                        //testFiles = new string [] { @"Interfaces/TemplatedGroup/3.crow" };
                        //testFiles = new string [] { @"Interfaces/Divers/testShape.crow" };
                        //testFiles = new string [] { @"Interfaces/TemplatedControl/testEnumSelector.crow" };
-                       testFiles = new string [] { @"Interfaces/Stack/StretchedInFit.crow" };
+                       testFiles = new string [] { @"Interfaces/TemplatedControl/testSpinner.crow" };
                        //testFiles = new string [] { @"Interfaces/Divers/colorPicker2.crow" };
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
@@ -55,11 +55,6 @@ namespace tests
                int idx = 0;
                string [] testFiles;
 
-               public Version CrowVersion {
-                       get {
-                               return System.Reflection.Assembly.GetAssembly (typeof (Widget)).GetName ().Version;
-                       }
-               }
 
                public override bool OnKeyDown (Key key)
                {
@@ -111,151 +106,7 @@ namespace tests
                        }
                        return false;
                }
-               #region Test values for Binding
-               public List<Crow.Command> Commands;
-               public int intValue = 500;
-               DirectoryInfo curDir = new DirectoryInfo (Path.GetDirectoryName (Assembly.GetEntryAssembly ().Location));
-               //DirectoryInfo curDir = new DirectoryInfo (@"/mnt/data/Images");
-               public FileSystemInfo [] CurDirectory {
-                       get { return curDir.GetFileSystemInfos (); }
-               }
-               public int IntValue {
-                       get {
-                               return intValue;
-                       }
-                       set {
-                               intValue = value;
-                               NotifyValueChanged ("IntValue", intValue);
-                       }
-               }
-               VerticalAlignment currentVAlign;
-               public VerticalAlignment CurrentVAlign {
-                       get => currentVAlign;
-                       set {
-                               if (currentVAlign == value)
-                                       return;
-                               currentVAlign = value;
-                               NotifyValueChanged ("CurrentVAlign", currentVAlign);
-                       }
-               }
-               void onSpinnerValueChange (object sender, ValueChangeEventArgs e)
-               {
-                       if (e.MemberName != "Value")
-                               return;
-                       intValue = Convert.ToInt32 (e.NewValue);
-               }
-               void change_alignment (object sender, EventArgs e)
-               {
-                       RadioButton rb = sender as RadioButton;
-                       if (rb == null)
-                               return;
-                       NotifyValueChanged ("alignment", Enum.Parse (typeof (Alignment), rb.Caption));
-               }
-               public IEnumerable<String> List2 = new List<string> (new string []
-                       {
-                               "string1",
-                               "string2",
-                               "string3",
-                               "string4",
-                               "string5",
-                               "string6",
-                               "string7",
-                               "string8",
-                               "string8",
-                               "string8",
-                               "string8",
-                               "string8",
-                               "string8",
-                               "string9"
-                       }
-               );
-               public IEnumerable<String> TestList2 {
-                       set {
-                               List2 = value;
-                               NotifyValueChanged ("TestList2", testList);
-                       }
-                       get { return List2; }
-               }
-               public class TestClass
-               {
-                       public string Prop1 { get; set; }
-                       public string Prop2 { get; set; }
-
-                       public override string ToString ()
-                               => $"{Prop1}, {Prop2}";
-
-               }
-               public IEnumerable<TestClass> List3 = new List<TestClass> (new TestClass []
-                       {
-                               new TestClass { Prop1 = "string1", Prop2="prop2-1" },
-                               new TestClass { Prop1 = "string2", Prop2="prop2-2" },
-                               new TestClass { Prop1 = "string3", Prop2="prop2-3" },
-                       }
-               );
-               public IEnumerable<string> TestList3Props1 => List3.Select (sc => sc.Prop1).ToList();
-               public IEnumerable<TestClass> TestList3 {
-                       set {
-                               List3 = value;
-                               NotifyValueChanged ("TestList3", testList);
-                       }
-                       get { return List3; }
-               }
-               string prop1;
-               public string TestList3SelProp1 {
-                       get => prop1;
-                       set {
-                               if (prop1 == value)
-                                       return;
-                               prop1 = value;
-
-                               NotifyValueChanged ("TestList3SelProp1", prop1);
-                       }
-               }
-
-               string selString;
-               public string TestList2SelectedString {
-                       get => selString;
-                       set {
-                               if (selString == value)
-                                       return;
-                               selString = value;
-                               NotifyValueChanged ("TestList2SelectedString", selString);
-                       }
-               }
-
-               List<Color> testList = null; //Color.ColorDic.Values//.OrderBy(c=>c.Hue)
-                                                                                                       //.ThenBy(c=>c.Value).ThenBy(c=>c.Saturation)
-                       //.ToList ();
-               public List<Color> TestList {
-                       set {
-                               testList = value;
-                               NotifyValueChanged ("TestList", testList);
-                       }
-                       get { return testList; }
-               }
-               string curSources = "";
-               public string CurSources {
-                       get { return curSources; }
-                       set {
-                               if (value == curSources)
-                                       return;
-                               curSources = value;
-                               NotifyValueChanged ("CurSources", curSources);
-                       }
-               }
-               bool boolVal = true;
-               public bool BoolVal {
-                       get { return boolVal; }
-                       set {
-                               if (boolVal == value)
-                                       return;
-                               boolVal = value;
-                               NotifyValueChanged ("BoolVal", boolVal);
-                       }
-               }
-
-               #endregion
-
+               
                void OnClear (object sender, MouseButtonEventArgs e) => TestList = null;
 
                void OnLoadList (object sender, MouseButtonEventArgs e) => TestList =
index 71a7a82942f3f45b46a2af9ba8a913c5273282a2..b92bf1021f303fbfcc57c5bc47e8ea557b230739 100644 (file)
@@ -1,45 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project Sdk="Microsoft.NET.Sdk">
-       <PropertyGroup>
-               <TargetFrameworks>net472</TargetFrameworks>
-               <OutputType>Exe</OutputType>
-               <EnableDefaultNoneItems>false</EnableDefaultNoneItems>
-               <ReleaseVersion>0.8.0</ReleaseVersion>
-       </PropertyGroup>
-       <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-               <DebugType>full</DebugType>
-               <DefineConstants>TRACE;DEBUG</DefineConstants>
-               <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
-       </PropertyGroup>
-       <ItemGroup>
-               <ProjectReference Include="..\..\Crow\Crow.csproj" />
-       </ItemGroup>
        <ItemGroup>
          <EmbeddedResource Remove="..\common\ui\templates\test.style" />
        </ItemGroup>
-       <ItemGroup>
-               <Datas Include="..\data\**\*.*">
-                       <Link>data\%(RecursiveDir)%(Filename)%(Extension)</Link>
-               </Datas>
+       <ItemGroup>             
                <EmbeddedResource Include="ui\*.*">
                        <LogicalName>ShowCase.%(Filename)%(Extension)</LogicalName>
                </EmbeddedResource>
-               <None Include="..\common\ui\Interfaces\**\*.*">
-                       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-                       <Link>Interfaces\%(RecursiveDir)%(Filename)%(Extension)</Link>
-               </None>
-               <EmbeddedResource Include="..\common\ui\templates\**\*.*">
-                       <LogicalName>ui.%(Filename)%(Extension)</LogicalName>
-                       <Link>Templates\%(Filename)%(Extension)</Link>
-               </EmbeddedResource>
-               <EmbeddedResource Include="..\common\samples.style" />
-               <EmbeddedResource Include="..\common\ui\images\**\*.*">
-                       <LogicalName>images.%(Filename)%(Extension)</LogicalName>
-                       <Link>Images\%(Filename)%(Extension)</Link>
-               </EmbeddedResource>
-               <EmbeddedResource Include="..\common\ui\Icons\*.*">
-                       <LogicalName>Icons.%(Filename)%(Extension)</LogicalName>
-                       <Link>Icons\%(Filename)%(Extension)</Link>
-               </EmbeddedResource>
        </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/Samples/Directory.Build.props b/Samples/Directory.Build.props
new file mode 100644 (file)
index 0000000..d3e9d66
--- /dev/null
@@ -0,0 +1,44 @@
+<Project>
+       <PropertyGroup>
+               <TargetFrameworks>netcoreapp3.1</TargetFrameworks>
+               <OutputType>Exe</OutputType>
+               
+               <RootDirectory>$(MSBuildThisFileDirectory)</RootDirectory>        
+               <OutputPath>$(SolutionDir)build\$(Configuration)\</OutputPath>
+               <IntermediateOutputPath>$(SolutionDir)build\obj\$(Configuration)\</IntermediateOutputPath>
+               
+               <!--<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>-->
+               
+               <License>MIT</License>
+               <Authors>Jean-Philippe Bruyère</Authors>
+
+               <EnableDefaultNoneItems>false</EnableDefaultNoneItems>
+               <SamplesDir>$(SolutionDir)Samples\</SamplesDir>
+       </PropertyGroup>
+       <PropertyGroup>
+       </PropertyGroup>
+       
+       <ItemGroup>
+               <ProjectReference Include="$(SolutionDir)Crow\Crow.csproj" />
+       </ItemGroup>
+       <ItemGroup>
+               <None Include="$(SamplesDir)common\ui\Interfaces\**\*.*">
+                       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+                       <Link>Interfaces\%(RecursiveDir)%(Filename)%(Extension)</Link>
+               </None>
+               <EmbeddedResource Include="$(SamplesDir)common\ui\templates\**\*.*">
+                       <LogicalName>ui.%(Filename)%(Extension)</LogicalName>
+                       <Link>Templates\%(Filename)%(Extension)</Link>
+               </EmbeddedResource>
+               <EmbeddedResource Include="$(SamplesDir)common\samples.style" />
+               <EmbeddedResource Include="$(SamplesDir)common\ui\images\**\*.*">
+                       <LogicalName>images.%(Filename)%(Extension)</LogicalName>
+                       <Link>Images\%(Filename)%(Extension)</Link>
+               </EmbeddedResource>
+               <EmbeddedResource Include="$(SamplesDir)common\ui\Icons\*.*">
+                       <LogicalName>Icons.%(Filename)%(Extension)</LogicalName>
+                       <Link>Icons\%(Filename)%(Extension)</Link>
+               </EmbeddedResource>
+               <Compile Include="$(SamplesDir)common\SampleBase.cs"/>
+       </ItemGroup>
+</Project>
index 405765d16781187554238af349f2afe671343ddc..253e0eb1c5bb46b2cdfde7cd05cbe21fa6f08835 100644 (file)
@@ -1,53 +1,7 @@
-<Project Sdk="Microsoft.NET.Sdk">  
-  <PropertyGroup>
-    <TargetFrameworks>net472</TargetFrameworks>
-    <OutputType>Exe</OutputType>        
-    <EnableDefaultNoneItems>false</EnableDefaultNoneItems>     
-    <ReleaseVersion>0.8.0</ReleaseVersion>
-  </PropertyGroup>
-            
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugType>full</DebugType>
-    <DefineConstants>TRACE;DEBUG</DefineConstants>
-  </PropertyGroup>
-  <ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
-    <Reference Include="System" />
-  </ItemGroup>    
-
-  <ItemGroup>  
-    <ProjectReference Include="..\..\Crow\Crow.csproj" />
-  </ItemGroup>    
-    
+<Project Sdk="Microsoft.NET.Sdk">    
   <ItemGroup>
     <EmbeddedResource Include="ui\**\*.*">
       <LogicalName>HelloWorld.%(Filename)%(Extension)</LogicalName>
     </EmbeddedResource>                
   </ItemGroup>
-  <ItemGroup>    
-<!--           <PackageReference Include="Microsoft.CodeAnalysis.Features" Version="3.4.0" />-->
-    <PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="3.4.0" />
-    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.4.0" />
-    <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.4.0" />
-               <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="3.4.0" />
-  </ItemGroup>
-       
-  <!--<ItemGroup>    
-               <PackageReference Include="SQLitePCLRaw.core" Version="2.0.2" />
-               <PackageReference Include="System.Memory" Version="4.5.3" />
-  </ItemGroup> -->
-       
-       <ItemGroup>
-         <PackageReference Include="Microsoft.Build" Version="16.4.0">
-                       <IncludeAssets>compile</IncludeAssets>
-               </PackageReference>
-         <PackageReference Include="Microsoft.Build.Framework" Version="16.4.0">
-                       <IncludeAssets>compile</IncludeAssets>
-               </PackageReference>
-         <PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.4.0">
-                       <IncludeAssets>compile</IncludeAssets>
-               </PackageReference>
-         <PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.4.0">
-                       <IncludeAssets>compile</IncludeAssets>
-               </PackageReference>
-       </ItemGroup>
 </Project>
diff --git a/Samples/HelloWorld/ILView.cs b/Samples/HelloWorld/ILView.cs
deleted file mode 100644 (file)
index cb97480..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (c) 2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-
-using System;
-using Crow;
-
-namespace test {
-       public class TestClass {
-               int a = 0;
-       }
-}
-
-namespace HelloWorld
-{
-       public class ILView : Widget
-       {
-               readonly int a;
-               #region CTOR
-               public ILView ()
-               {
-                       a = 10;
-               }
-               #endregion
-               void test ()
-               {
-#if DEBUG
-Console.WriteLine ("debug" + a.ToString());
-
-#endif
-               }
-
-       }
-}
index 5c0fbbaf548be072593a11692174b907761cbb9c..73ccdffd33abebb965f42692c4b7937256faeed9 100644 (file)
@@ -1,35 +1,2 @@
 <?xml version="1.0"?>
-<VerticalStack Background="DimGrey">
-       <ColorPicker Name="cp" Width="Stretched"/>
-       <HorizontalStack Fit="True" Margin="10" Background="Jet">
-               <Widget Width="100" Height="60" Background="{../../cp.CurrentColor}"/>
-               <Widget Width="100" Height="60" Background="{../../cp.CurrentColor2}"/>
-       </HorizontalStack>
-       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
-               <Label Width="100" Text="Red"/>
-               <Label Width="100" Text="{R}"/>
-       </HorizontalStack>
-       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
-               <Label Width="100" Text="Blue"/>
-               <Label Width="100" Text="{B}"/>
-       </HorizontalStack>
-       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
-               <Label Width="100" Text="Green"/>
-               <Label Width="100" Text="{G}"/>
-       </HorizontalStack>
-       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
-               <Label Width="100" Text="Hue"/>
-               <Label Width="100" Text="{Hue}"/>
-       </HorizontalStack>
-       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
-               <Label Width="100" Text="Saturation"/>
-               <Label Width="100" Text="{Saturation}"/>
-       </HorizontalStack>
-       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
-               <Label Width="100" Text="Value"/>
-               <Label Width="100" Text="{Value}"/>
-       </HorizontalStack>
-</VerticalStack>
-       
-
-
+<Label Text="Hello world"/>
\ No newline at end of file
index 85e3f06127d513fcbaadd0bca542a401bf43bdb8..fe311b5672aa6ab4080a6511d42055cb6c2e436d 100644 (file)
@@ -1,32 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project Sdk="Microsoft.NET.Sdk">
-       <PropertyGroup>
-               <TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
-               <OutputType>Exe</OutputType>
-               <EnableDefaultNoneItems>false</EnableDefaultNoneItems>
-               <ReleaseVersion>0.8.0</ReleaseVersion>
-               <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
-       </PropertyGroup>
-       <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-               <DebugType>full</DebugType>
-               <DefineConstants>TRACE;DEBUG</DefineConstants>
-               <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
-       </PropertyGroup>
-       <ItemGroup>
-               <ProjectReference Include="..\..\Crow\Crow.csproj" />
-       </ItemGroup>
+       
        <ItemGroup>
                <EmbeddedResource Include="ui\*.*">
                        <LogicalName>ShowCase.%(Filename)%(Extension)</LogicalName>
                </EmbeddedResource>
-               <None Include="..\common\ui\Interfaces\**\*.*">
-                       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-                       <Link>Interfaces/%(RecursiveDir)%(Filename)%(Extension)</Link>
-               </None>
-               <None Include="$(SolutionDir)\Images\**\*.*">
-                       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-                       <Link>Images\%(RecursiveDir)%(Filename)%(Extension)</Link>
-               </None>
        </ItemGroup>
        <ItemGroup>
                <None Remove="..\common\ui\Interfaces\basicTests\7.crow" />
index 7650fb970363e9f4a6add9576f231c1785170d70..b65f3dfe4b83feaf43d5c51a7194e4094ca03f71 100644 (file)
@@ -115,102 +115,5 @@ namespace tests
                }
 
 
-               #region Test values for Binding
-               public int intValue = 500;
-               DirectoryInfo curDir = new DirectoryInfo (Path.GetDirectoryName (Assembly.GetEntryAssembly ().Location));
-               //DirectoryInfo curDir = new DirectoryInfo (@"/mnt/data/Images");
-               public FileSystemInfo [] CurDirectory {
-                       get { return curDir.GetFileSystemInfos (); }
-               }
-               public int IntValue {
-                       get {
-                               return intValue;
-                       }
-                       set {
-                               intValue = value;
-                               NotifyValueChanged ("IntValue", intValue);
-                       }
-               }
-               void onSpinnerValueChange (object sender, ValueChangeEventArgs e)
-               {
-                       if (e.MemberName != "Value")
-                               return;
-                       intValue = Convert.ToInt32 (e.NewValue);
-               }
-               void change_alignment (object sender, EventArgs e)
-               {
-                       RadioButton rb = sender as RadioButton;
-                       if (rb == null)
-                               return;
-                       NotifyValueChanged ("alignment", Enum.Parse (typeof (Alignment), rb.Caption));
-               }
-               public IList<String> List2 = new List<string> (new string []
-                       {
-                               "string1",
-                               "string2",
-                               "string3",
-                               //                              "string4",
-                               //                              "string5",
-                               //                              "string6",
-                               //                              "string7",
-                               //                              "string8",
-                               //                              "string8",
-                               //                              "string8",
-                               //                              "string8",
-                               //                              "string8",
-                               //                              "string8",
-                               //                              "string9"
-                       }
-               );
-               public IList<String> TestList2 {
-                       set {
-                               List2 = value;
-                               NotifyValueChanged ("TestList2", testList);
-                       }
-                       get { return List2; }
-               }
-               IList<Color> testList = null;// Enum.GetValues (typeof (Colors)).Cast<Color> ().ToList (); // Color.ColorDic.Values.OrderBy(c=>c.Hue).ThenBy(c=>c.Value).ToList ();
-               public IList<Color> TestList {
-                       set {
-                               testList = value;
-                               NotifyValueChanged ("TestList", testList);
-                       }
-                       get { return testList; }
-               }
-               string curSources = "";
-               public string CurSources {
-                       get { return curSources; }
-                       set {
-                               if (value == curSources)
-                                       return;
-                               curSources = value;
-                               NotifyValueChanged ("CurSources", curSources);
-                       }
-               }
-               bool boolVal = true;
-               public bool BoolVal {
-                       get { return boolVal; }
-                       set {
-                               if (boolVal == value)
-                                       return;
-                               boolVal = value;
-                               NotifyValueChanged ("BoolVal", boolVal);
-                       }
-               }
-
-               #endregion
-
-               void OnClear (object sender, MouseButtonEventArgs e) => TestList = null;
-
-               void OnLoadList (object sender, MouseButtonEventArgs e) => TestList = Enum.GetValues (typeof (Colors)).Cast<Color> ().ToList ();
-
-       }
-
-       public static class Extensions
-       {
-               public static Fill GetIcon (this Alignment align)
-               {
-                       return (Crow.Fill)Fill.Parse ("#images.valign.svg");
-               }
        }
 }
\ No newline at end of file
index f14e965caffd83869e6586158d64f490212f5860..319021bf81db9d5115a959e923eb3436fd2eb83c 100644 (file)
@@ -1,9 +1,9 @@
 <?xml version="1.0"?>
-<HorizontalStack Background="Jet" Margin="5">
+<HorizontalStack Background="DarkGrey" Margin="2">
        <DirectoryView Name="dv" CurrentDirectory="Interfaces" Width="25%" SelectedItemChanged="Dv_SelectedItemChanged"/>
        <Splitter Width="6"/>
        <VerticalStack>
-               <Container Name="CrowContainer" Height="60%" Background="DimGrey"/>
+               <Container Name="CrowContainer" Height="60%" Background="Black"/>
                <Splitter/>
                <HorizontalStack>
                        <Scroller Name="scroller1" Background="White"
diff --git a/Samples/common/CrowVkWin.cs b/Samples/common/CrowVkWin.cs
deleted file mode 100644 (file)
index dd83a37..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-using System;
-using System.Threading;
-using Crow;
-using CVKL;
-using VK;
-
-namespace Crow
-{
-       public class CrowVkWin : VkWindow, IValueChange {
-        #region IValueChange implementation
-        public event EventHandler<Crow.ValueChangeEventArgs> ValueChanged;
-        public virtual void NotifyValueChanged(string MemberName, object _value)
-        {
-            if (ValueChanged != null)
-                ValueChanged.Invoke(this, new Crow.ValueChangeEventArgs(MemberName, _value));
-        }
-        #endregion
-
-        protected Crow.Interface crow;
-        protected CVKL.Image uiImage;
-        protected vkvg.Device vkvgDev;
-        bool isRunning;
-
-        protected CrowVkWin() : base()
-        {
-            Thread crowThread = new Thread(crow_thread_func);
-            crowThread.IsBackground = true;
-            crowThread.Start();
-
-            while (crow == null)
-                Thread.Sleep(2);
-
-            initUISurface();
-        }
-
-        protected override void render () {
-                       int idx = swapChain.GetNextImage ();
-
-                       if (idx < 0) {
-                               OnResize ();
-                               return;
-                       }
-
-                       lock (crow.RenderMutex) {
-                               presentQueue.Submit (cmds[idx], swapChain.presentComplete, drawComplete[idx]);
-                               presentQueue.Present (swapChain, drawComplete[idx]);
-                               presentQueue.WaitIdle ();
-                       }
-                       Thread.Sleep (1);
-               }
-
-               void crow_thread_func () {
-                       vkvgDev = new vkvg.Device (instance.Handle, phy.Handle, dev.VkDev.Handle, presentQueue.qFamIndex,
-                               vkvg.SampleCount.Sample_8, presentQueue.index);
-
-                       crow = new Crow.Interface (vkvgDev, 800, 600);
-
-                       isRunning = true;
-                       while (isRunning) {
-                               crow.Update ();
-                               Thread.Sleep (3);
-                       }
-
-                       crow.Dispose ();
-                       vkvgDev.Dispose ();
-                       crow = null;
-               }
-
-               void initUISurface () {
-                       lock (crow.UpdateMutex) {
-                               uiImage?.Dispose ();
-                               uiImage = new CVKL.Image (dev, new VkImage ((ulong)crow.surf.VkImage.ToInt64 ()), VkFormat.B8g8r8a8Unorm,
-                                       VkImageUsageFlags.Sampled, swapChain.Width, swapChain.Height);
-                               uiImage.SetName ("uiImage");
-                               uiImage.CreateView (VkImageViewType.ImageView2D, VkImageAspectFlags.Color);
-                               uiImage.CreateSampler (VkFilter.Nearest, VkFilter.Nearest, VkSamplerMipmapMode.Nearest, VkSamplerAddressMode.ClampToBorder);
-                               uiImage.Descriptor.imageLayout = VkImageLayout.ShaderReadOnlyOptimal;
-                       }
-               }
-
-               protected virtual void recordDraw (CommandBuffer cmd, int imageIndex) { }
-
-               void buildCommandBuffers () {
-                       for (int i = 0; i < swapChain.ImageCount; ++i) {
-                               cmds[i]?.Free ();
-                               cmds[i] = cmdPool.AllocateAndStart ();
-
-                               CommandBuffer cmd = cmds [i];
-
-                               recordDraw (cmd, i);
-
-                               swapChain.images [i].SetLayout (cmd, VkImageAspectFlags.Color,
-                                       VkImageLayout.Undefined, VkImageLayout.TransferDstOptimal,
-                                       VkPipelineStageFlags.BottomOfPipe, VkPipelineStageFlags.Transfer);
-                               uiImage.SetLayout (cmd, VkImageAspectFlags.Color,
-                                       VkImageLayout.ColorAttachmentOptimal, VkImageLayout.TransferSrcOptimal,
-                                       VkPipelineStageFlags.ColorAttachmentOutput, VkPipelineStageFlags.Transfer);
-                                       
-                               VkImageSubresourceLayers imgSubResLayer = new VkImageSubresourceLayers {
-                                       aspectMask = VkImageAspectFlags.Color,
-                                       mipLevel = 0,
-                                       baseArrayLayer = 0,
-                                       layerCount = 1
-                               };
-                               VkImageCopy cregion = new VkImageCopy {
-                                       srcSubresource = imgSubResLayer,
-                                       srcOffset = default (VkOffset3D),
-                                       dstSubresource = imgSubResLayer,
-                                       dstOffset = default (VkOffset3D),
-                                       extent = new VkExtent3D { width = swapChain.Width, height = swapChain.Height }
-                               };
-                               Vk.vkCmdCopyImage (cmds [i].Handle, uiImage.Handle, VkImageLayout.TransferSrcOptimal,
-                                       swapChain.images [i].Handle, VkImageLayout.TransferDstOptimal, 1, ref cregion);
-
-                               swapChain.images [i].SetLayout (cmd, VkImageAspectFlags.Color,
-                                       VkImageLayout.TransferDstOptimal, VkImageLayout.PresentSrcKHR,
-                                       VkPipelineStageFlags.Transfer, VkPipelineStageFlags.BottomOfPipe);
-                               uiImage.SetLayout (cmd, VkImageAspectFlags.Color,
-                                       VkImageLayout.TransferSrcOptimal, VkImageLayout.ColorAttachmentOptimal,
-                                       VkPipelineStageFlags.Transfer, VkPipelineStageFlags.ColorAttachmentOutput);
-
-                               cmds [i].End ();
-                       }
-               }
-
-               /// <summary>
-               /// rebuild command buffers if needed
-               /// </summary>
-               public override void Update () {
-                       if (rebuildBuffers) {
-                               buildCommandBuffers ();
-                               rebuildBuffers = false;
-                       }
-               }
-
-               protected override void OnResize () {
-                       dev.WaitIdle ();
-
-                       crow.ProcessResize (new Crow.Rectangle (0, 0, (int)swapChain.Width, (int)swapChain.Height));
-
-                       initUISurface ();
-
-                       buildCommandBuffers ();
-                       dev.WaitIdle ();
-               }
-
-               #region Mouse and keyboard
-               //protected override void onScroll (double xOffset, double yOffset)
-               //{
-               //      if (KeyModifiers.HasFlag (Glfw.Modifier.Shift))
-               //              crow.ProcessMouseWheelChanged ((float)xOffset);
-               //      else
-               //              crow.ProcessMouseWheelChanged ((float)yOffset);
-               //}
-               protected override void onMouseMove (double xPos, double yPos)
-               {
-                       if (crow.ProcessMouseMove ((int)xPos, (int)yPos))
-                               return;
-               }
-               protected override void onMouseButtonDown (Glfw.MouseButton button)
-               {
-                       if (crow.ProcessMouseButtonDown ((Crow.MouseButton)button))
-                               return;
-                       base.onMouseButtonDown (button);
-               }
-               protected override void onMouseButtonUp (Glfw.MouseButton button)
-               {
-                       if (crow.ProcessMouseButtonUp ((Crow.MouseButton)button))
-                               return;
-                       base.onMouseButtonUp (button);
-               }
-               protected override void onKeyDown (Glfw.Key key, int scanCode, Glfw.Modifier modifiers)
-               {
-                       if (crow.ProcessKeyDown ((Crow.Key)key))
-                               return;
-               }
-               protected override void onKeyUp (Glfw.Key key, int scanCode, Glfw.Modifier modifiers)
-               {
-                       if (crow.ProcessKeyUp ((Crow.Key)key))
-                               return;
-               }
-               //protected override void onChar (Glfw.CodePoint cp)
-               //{
-               //      if (crow.ProcessKeyPress (cp.ToChar ()))
-               //              return;
-               //}
-               #endregion
-
-               #region dispose
-               protected override void Dispose (bool disposing) {
-                       if (disposing) {
-                               if (!isDisposed) {
-                                       dev.WaitIdle ();
-
-                                       isRunning = false;
-                                       uiImage?.Dispose ();
-                                       while (crow != null)
-                                               Thread.Sleep (1);
-                               }
-                       }
-
-                       base.Dispose (disposing);
-               }
-               #endregion
-       }
-}
\ No newline at end of file
diff --git a/Samples/common/CrowWin.cs b/Samples/common/CrowWin.cs
deleted file mode 100644 (file)
index a25ef6e..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-using System;
-using System.Threading;
-using Crow;
-using CVKL;
-using VK;
-
-namespace Crow
-{
-       public class CrowVkWin : VkWindow, IValueChange {
-        #region IValueChange implementation
-        public event EventHandler<Crow.ValueChangeEventArgs> ValueChanged;
-        public virtual void NotifyValueChanged(string MemberName, object _value)
-        {
-            if (ValueChanged != null)
-                ValueChanged.Invoke(this, new Crow.ValueChangeEventArgs(MemberName, _value));
-        }
-        #endregion
-
-        protected Crow.Interface crow;
-        protected CVKL.Image uiImage;
-        protected vkvg.Device vkvgDev;
-        bool isRunning;
-
-        protected CrowVkWin() : base()
-        {
-
-            Thread crowThread = new Thread(crow_thread_func);
-            crowThread.IsBackground = true;
-            crowThread.Start();
-
-            while (crow == null)
-                Thread.Sleep(2);
-
-            initUISurface();
-        }
-
-               protected virtual void onLoad () { }
-               public override void Run ()
-               {
-                       onLoad ();
-                       base.Run ();
-               }
-               protected override void render () {
-                       int idx = swapChain.GetNextImage ();
-
-                       if (idx < 0) {
-                               OnResize ();
-                               return;
-                       }
-
-                       lock (crow.RenderMutex) {
-                               presentQueue.Submit (cmds[idx], swapChain.presentComplete, drawComplete[idx]);
-                               presentQueue.Present (swapChain, drawComplete[idx]);
-                               presentQueue.WaitIdle ();
-                       }
-                       Thread.Sleep (1);
-               }
-
-               void crow_thread_func () {
-                       vkvgDev = new vkvg.Device (instance.Handle, phy.Handle, dev.VkDev.Handle, presentQueue.qFamIndex,
-                               vkvg.SampleCount.Sample_8, presentQueue.index);
-
-                       crow = new Crow.Interface (vkvgDev, 800, 600);
-                       crow.MouseCursorChanged +=Crow_MouseCursorChanged;; 
-
-                       isRunning = true;
-                       while (isRunning) {
-                               crow.Update ();
-                               Thread.Sleep (1);
-                       }
-
-                       crow.Dispose ();
-                       vkvgDev.Dispose ();
-                       crow = null;
-               }
-
-               void Crow_MouseCursorChanged (object sender, MouseCursorChangedEventArgs e)
-               {
-                       switch (e.NewCursor) {
-                       case MouseCursor.Arrow:
-                               SetCursor (Glfw.CursorShape.Arrow);
-                               break;
-                       case MouseCursor.IBeam:
-                               SetCursor (Glfw.CursorShape.IBeam);
-                               break;
-                       case MouseCursor.Crosshair:
-                               SetCursor (Glfw.CursorShape.Crosshair);
-                               break;
-                       case MouseCursor.Hand:
-                               SetCursor (Glfw.CursorShape.Hand);
-                               break;
-                       case MouseCursor.HResize:
-                               SetCursor (Glfw.CursorShape.HResize);
-                               break;
-                       case MouseCursor.VResize:
-                               SetCursor (Glfw.CursorShape.VResize);
-                               break;
-                       default:
-                               SetCursor (Glfw.CursorShape.Crosshair);
-                               break;
-                       }
-               }
-
-               void initUISurface () {
-                       lock (crow.UpdateMutex) {
-                               uiImage?.Dispose ();
-                               uiImage = new CVKL.Image (dev, new VkImage ((ulong)crow.surf.VkImage.ToInt64 ()), VkFormat.B8g8r8a8Unorm,
-                                       VkImageUsageFlags.Sampled, swapChain.Width, swapChain.Height);
-                               uiImage.SetName ("uiImage");
-                               uiImage.CreateView (VkImageViewType.ImageView2D, VkImageAspectFlags.Color);
-                               uiImage.CreateSampler (VkFilter.Nearest, VkFilter.Nearest, VkSamplerMipmapMode.Nearest, VkSamplerAddressMode.ClampToBorder);
-                               uiImage.Descriptor.imageLayout = VkImageLayout.ShaderReadOnlyOptimal;
-                       }
-               }
-
-               protected virtual void recordDraw (CommandBuffer cmd, int imageIndex) { }
-
-               void buildCommandBuffers () {
-                       for (int i = 0; i < swapChain.ImageCount; ++i) {
-                               cmds[i]?.Free ();
-                               cmds[i] = cmdPool.AllocateAndStart ();
-
-                               CommandBuffer cmd = cmds [i];
-
-                               recordDraw (cmd, i);
-
-                               swapChain.images [i].SetLayout (cmd, VkImageAspectFlags.Color,
-                                       VkImageLayout.Undefined, VkImageLayout.TransferDstOptimal,
-                                       VkPipelineStageFlags.BottomOfPipe, VkPipelineStageFlags.Transfer);
-                               uiImage.SetLayout (cmd, VkImageAspectFlags.Color,
-                                       VkImageLayout.Undefined, VkImageLayout.TransferSrcOptimal,
-                                       VkPipelineStageFlags.Transfer, VkPipelineStageFlags.Transfer);
-                                       
-                               VkImageSubresourceLayers imgSubResLayer = new VkImageSubresourceLayers {
-                                       aspectMask = VkImageAspectFlags.Color,
-                                       mipLevel = 0,
-                                       baseArrayLayer = 0,
-                                       layerCount = 1
-                               };
-                               VkImageCopy cregion = new VkImageCopy {
-                                       srcSubresource = imgSubResLayer,
-                                       srcOffset = default (VkOffset3D),
-                                       dstSubresource = imgSubResLayer,
-                                       dstOffset = default (VkOffset3D),
-                                       extent = new VkExtent3D { width = swapChain.Width, height = swapChain.Height }
-                               };
-                               Vk.vkCmdCopyImage (cmds [i].Handle, uiImage.Handle, VkImageLayout.TransferSrcOptimal,
-                                       swapChain.images [i].Handle, VkImageLayout.TransferDstOptimal, 1, ref cregion);
-
-                               swapChain.images [i].SetLayout (cmd, VkImageAspectFlags.Color,
-                                       VkImageLayout.TransferDstOptimal, VkImageLayout.PresentSrcKHR,
-                                       VkPipelineStageFlags.Transfer, VkPipelineStageFlags.BottomOfPipe);
-                               uiImage.SetLayout (cmd, VkImageAspectFlags.Color,
-                                       VkImageLayout.TransferSrcOptimal, VkImageLayout.ColorAttachmentOptimal,
-                                       VkPipelineStageFlags.Transfer, VkPipelineStageFlags.ColorAttachmentOutput);
-
-                               cmds [i].End ();
-                       }
-               }
-
-               /// <summary>
-               /// rebuild command buffers if needed
-               /// </summary>
-               public override void Update () {
-                       if (rebuildBuffers) {
-                               buildCommandBuffers ();
-                               rebuildBuffers = false;
-                       }
-               }
-
-               protected override void OnResize () {
-                       dev.WaitIdle ();
-
-                       crow.ProcessResize (new Crow.Rectangle (0, 0, (int)swapChain.Width, (int)swapChain.Height));
-
-                       initUISurface ();
-
-                       buildCommandBuffers ();
-                       dev.WaitIdle ();
-               }
-
-               #region Mouse and keyboard
-               protected override void onScroll (double xOffset, double yOffset)
-               {
-                       if (KeyModifiers.HasFlag (Glfw.Modifier.Shift))
-                               crow.ProcessMouseWheelChanged ((float)xOffset);
-                       else
-                               crow.ProcessMouseWheelChanged ((float)yOffset);
-               }
-               protected override void onMouseMove (double xPos, double yPos)
-               {
-                       if (crow.ProcessMouseMove ((int)xPos, (int)yPos))
-                               return;
-               }
-               protected override void onMouseButtonDown (Glfw.MouseButton button)
-               {
-                       if (crow.ProcessMouseButtonDown ((Crow.MouseButton)button))
-                               return;
-                       base.onMouseButtonDown (button);
-               }
-               protected override void onMouseButtonUp (Glfw.MouseButton button)
-               {
-                       if (crow.ProcessMouseButtonUp ((Crow.MouseButton)button))
-                               return;
-                       base.onMouseButtonUp (button);
-               }
-               protected override void onKeyDown (Glfw.Key key, int scanCode, Glfw.Modifier modifiers)
-               {
-                       if (crow.ProcessKeyDown ((Crow.Key)key))
-                               return;
-               }
-               protected override void onKeyUp (Glfw.Key key, int scanCode, Glfw.Modifier modifiers)
-               {
-                       if (crow.ProcessKeyUp ((Crow.Key)key))
-                               return;
-               }
-               protected override void onChar (Glfw.CodePoint cp)
-               {
-                       if (crow.ProcessKeyPress (cp.ToChar ()))
-                               return;
-               }
-               #endregion
-
-               #region dispose
-               protected override void Dispose (bool disposing) {
-                       if (disposing) {
-                               if (!isDisposed) {
-                                       dev.WaitIdle ();
-
-                                       isRunning = false;
-                                       uiImage?.Dispose ();
-                                       while (crow != null)
-                                               Thread.Sleep (1);
-                               }
-                       }
-
-                       base.Dispose (disposing);
-               }
-               #endregion
-       }
-}
\ No newline at end of file
diff --git a/Samples/common/SampleBase.cs b/Samples/common/SampleBase.cs
new file mode 100644 (file)
index 0000000..8ee0c15
--- /dev/null
@@ -0,0 +1,163 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Threading;
+using Crow;
+
+namespace Crow
+{
+       public class SampleBase : Interface {
+               public Version CrowVersion => Assembly.GetAssembly (typeof (Widget)).GetName ().Version;
+
+               #region Test values for Binding
+               public List<Crow.Command> Commands;
+               public int intValue = 500;
+               VerticalAlignment currentVAlign;
+
+               DirectoryInfo curDir = new DirectoryInfo (Path.GetDirectoryName (Assembly.GetEntryAssembly ().Location));
+               public FileSystemInfo[] CurDirectory => curDir.GetFileSystemInfos (); 
+               public int IntValue {
+                       get => intValue;
+                       set {
+                               if (IntValue == value)
+                                       return;
+                               intValue = value;
+                               NotifyValueChanged ("IntValue", intValue);
+                       }
+               }
+               public VerticalAlignment CurrentVAlign {
+                       get => currentVAlign;
+                       set {
+                               if (currentVAlign == value)
+                                       return;
+                               currentVAlign = value;
+                               NotifyValueChanged ("CurrentVAlign", currentVAlign);
+                       }
+               }
+               void onSpinnerValueChange (object sender, ValueChangeEventArgs e) {
+                       if (e.MemberName != "Value")
+                               return;
+                       intValue = Convert.ToInt32 (e.NewValue);
+               }
+               void change_alignment (object sender, EventArgs e) {
+                       RadioButton rb = sender as RadioButton;
+                       if (rb == null)
+                               return;
+                       NotifyValueChanged ("alignment", Enum.Parse (typeof (Alignment), rb.Caption));
+               }
+               public IEnumerable<String> List2 = new List<string> (new string[]
+                       {
+                               "string1",
+                               "string2",
+                               "string3",
+                               "string4",
+                               "string5",
+                               "string6",
+                               "string7",
+                               "string8",
+                               "string8",
+                               "string8",
+                               "string8",
+                               "string8",
+                               "string8",
+                               "string9"
+                       }
+               );
+               public IEnumerable<String> TestList2 {
+                       set {
+                               List2 = value;
+                               NotifyValueChanged ("TestList2", testList);
+                       }
+                       get { return List2; }
+               }
+               public class TestClass
+               {
+                       public string Prop1 { get; set; }
+                       public string Prop2 { get; set; }
+
+                       public override string ToString ()
+                               => $"{Prop1}, {Prop2}";
+
+               }
+               public IEnumerable<TestClass> List3 = new List<TestClass> (new TestClass[]
+                       {
+                               new TestClass { Prop1 = "string1", Prop2="prop2-1" },
+                               new TestClass { Prop1 = "string2", Prop2="prop2-2" },
+                               new TestClass { Prop1 = "string3", Prop2="prop2-3" },
+                       }
+               );
+               public IEnumerable<string> TestList3Props1 => List3.Select (sc => sc.Prop1).ToList ();
+               public IEnumerable<TestClass> TestList3 {
+                       set {
+                               List3 = value;
+                               NotifyValueChanged ("TestList3", testList);
+                       }
+                       get { return List3; }
+               }
+               string prop1;
+               public string TestList3SelProp1 {
+                       get => prop1;
+                       set {
+                               if (prop1 == value)
+                                       return;
+                               prop1 = value;
+
+                               NotifyValueChanged ("TestList3SelProp1", prop1);
+                       }
+               }
+
+               string selString;
+               public string TestList2SelectedString {
+                       get => selString;
+                       set {
+                               if (selString == value)
+                                       return;
+                               selString = value;
+                               NotifyValueChanged ("TestList2SelectedString", selString);
+                       }
+               }
+
+
+               IList<Colors> testList = (IList<Colors>)FastEnumUtility.FastEnum.GetValues<Colors> ().ToList ();//.ColorDic.Values//.OrderBy(c=>c.Hue)
+                                                                                                                                                                                                               //.ThenBy(c=>c.Value).ThenBy(c=>c.Saturation)
+                                                                                                                                                                                                               //.ToList ();
+               public IList<Colors> TestList {
+                       set {
+                               testList = value;
+                               NotifyValueChanged ("TestList", testList);
+                       }
+                       get { return testList; }
+               }
+               void OnClear (object sender, MouseButtonEventArgs e) => TestList = null;
+               void OnLoadList (object sender, MouseButtonEventArgs e) => TestList = (IList<Colors>)FastEnumUtility.FastEnum.GetValues<Colors> ().ToList ();
+
+
+               string curSources = "";
+               public string CurSources {
+                       get { return curSources; }
+                       set {
+                               if (value == curSources)
+                                       return;
+                               curSources = value;
+                               NotifyValueChanged ("CurSources", curSources);
+                       }
+               }
+               bool boolVal = true;
+               public bool BoolVal {
+                       get { return boolVal; }
+                       set {
+                               if (boolVal == value)
+                                       return;
+                               boolVal = value;
+                               NotifyValueChanged ("BoolVal", boolVal);
+                       }
+               }
+
+               #endregion
+
+
+
+       }
+}
\ No newline at end of file
index c98d6410da423cc889b1a8c61ca95326e01cb770..6b6c8cada7f707fe2a15ee7bec1127cdb0c41ac8 100644 (file)
@@ -3,35 +3,23 @@
        <HorizontalStack>
                <VerticalStack Width="30%" Margin="5">
                        <GroupBox Caption="Performance" Height="Fit">
-                               <VerticalStack DataSource="{drawingMeasure}" Width="90%" Height="Fit" Spacing="2">
-                                       <HorizontalStack Height="Fit" Tooltip="Frame per second">
-                                               <Label Style="FpsLabel" Text="Fps:" />
-                                               <Label Style="FpsDisp" Text="{minimum}" />
+                               <VerticalStack DataSource="{updateMeasure}" Width="90%" Height="Fit" Spacing="2">
+                                       <HorizontalStack Style="HStackMeasure">
+                                               <Label Text="Cur:" Style="FpsLabel"/>
+                                               <Label Text="{current}" Style="FpsDisp"/>
                                        </HorizontalStack>
-                                       <HorizontalStack Height="Fit" Tooltip="Minimum Frame per second">
-                                               <Label Style="FpsLabel" Text="Min:" />
-                                               <Label Style="FpsDisp" Text="{fpsMin}" />
+                                       <HorizontalStack Style="HStackMeasure">
+                                               <Label Text="Min:" Style="FpsLabel"/>
+                                               <Label Text="{minimum}" Style="FpsDisp"/>
                                        </HorizontalStack>
-                                       <HorizontalStack Height="Fit" Tooltip="Maximum Frame per second">
-                                               <Label Style="FpsLabel" Text="Max:" />
-                                               <Label Style="FpsDisp" Text="{fpsMax}" />
-                                       </HorizontalStack>
-                                       <HorizontalStack Height="Fit" Tooltip="Update loop duration">
-                                               <Label Style="FpsLabel" Text="Update:" />
-                                               <Label Style="FpsDisp" Text="{update}" />
-                                       </HorizontalStack>
-                                       <HorizontalStack Height="Fit" Tooltip="Layouting process duration">
-                                               <Label Style="FpsLabel" Text="Layouting:" />
-                                               <Label Style="FpsDisp" Text="{layouting}" />
-                                       </HorizontalStack>
-                                       <HorizontalStack Height="Fit" Tooltip="Clipping duration">
-                                               <Label Style="FpsLabel" Text="Clipping:" />
-                                               <Label Style="FpsDisp" Text="{clipping}" />
-                                       </HorizontalStack>
-                                       <HorizontalStack Height="Fit">
-                                               <Label Style="FpsLabel" Text="Drawing:" />
-                                               <Label Style="FpsDisp" Text="{drawing}" />
+                                       <HorizontalStack Style="HStackMeasure">
+                                               <Label Text="Mean:" Style="FpsLabel"/>
+                                               <Label Text="{mean}" Style="FpsDisp"/>
                                        </HorizontalStack>
+                                       <HorizontalStack Style="HStackMeasure">
+                                               <Label Text="Max:" Style="FpsLabel"/>
+                                               <Label Text="{maximum}" Style="FpsDisp"/>
+                                       </HorizontalStack>                                                                              
                                </VerticalStack>
                        </GroupBox>
                        <Label Width="Stretched" Margin="3" Background="DimGrey" />
diff --git a/Samples/common/ui/Interfaces/Divers/testColors.crow b/Samples/common/ui/Interfaces/Divers/testColors.crow
new file mode 100644 (file)
index 0000000..5c0fbba
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<VerticalStack Background="DimGrey">
+       <ColorPicker Name="cp" Width="Stretched"/>
+       <HorizontalStack Fit="True" Margin="10" Background="Jet">
+               <Widget Width="100" Height="60" Background="{../../cp.CurrentColor}"/>
+               <Widget Width="100" Height="60" Background="{../../cp.CurrentColor2}"/>
+       </HorizontalStack>
+       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
+               <Label Width="100" Text="Red"/>
+               <Label Width="100" Text="{R}"/>
+       </HorizontalStack>
+       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
+               <Label Width="100" Text="Blue"/>
+               <Label Width="100" Text="{B}"/>
+       </HorizontalStack>
+       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
+               <Label Width="100" Text="Green"/>
+               <Label Width="100" Text="{G}"/>
+       </HorizontalStack>
+       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
+               <Label Width="100" Text="Hue"/>
+               <Label Width="100" Text="{Hue}"/>
+       </HorizontalStack>
+       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
+               <Label Width="100" Text="Saturation"/>
+               <Label Width="100" Text="{Saturation}"/>
+       </HorizontalStack>
+       <HorizontalStack DataSource="{../cp.CurrentColor}" Fit="True" Margin="10" Background="Jet">
+               <Label Width="100" Text="Value"/>
+               <Label Width="100" Text="{Value}"/>
+       </HorizontalStack>
+</VerticalStack>
+       
+
+
index 4bfb41fbdf0f9398eac9292b3a0f185b7f1bf13f..949016256d1a9bf2e710c4fd66acdd10a86ac0ed 100644 (file)
@@ -1,4 +1,8 @@
 <?xml version="1.0"?>
-<Container Background="DimGrey" Width="300">
+<VerticalStack Background="DarkGrey" Width="80%" Spacing="20">
        <ComboBox  Data="{TestList}" ItemTemplate="Interfaces/colorItem.crow"/>
-</Container>
\ No newline at end of file
+       <ComboBox  Data="{TestList}" ItemTemplate="Interfaces/colorItem.crow" Width="150"/>
+       <ComboBox  Data="{TestList}" ItemTemplate="Interfaces/colorItem.crow" Width="Fit"/>
+       <ComboBox Data="{TestList3Props1}"/>
+       <ComboBox Data="{TestList3Props1}" Width="Fit"/>        
+</VerticalStack>
\ No newline at end of file
index 5de771f99dc8da5f00c112de8b0fddb0afd5fc9d..0b1a775ef4ad2987e6ad27f3ffa4de276fac6b66 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<Group Name="TopContainer" Focusable="True" Background="Onyx" Margin="50">
+<Group Name="TopContainer" Focusable="True" Background="DarkGrey" Margin="50">
        <ScrollBar  Maximum="100" Height="90%"/>
        <ScrollBar Style="HScrollBar" Maximum="100" VerticalAlignment="Bottom"/>
 </Group>
\ No newline at end of file
index bff7eab949da327f56f98788006f1fbf2a5bba7f..89cd472eec85e2267e640754f9944cda9c4441b6 100644 (file)
@@ -1,7 +1,9 @@
 <?xml version="1.0"?>
 <VerticalStack Name="TopContainer" Width="400" Height="Fit"
        Margin="20" Background="DarkGrey">
-
+       <Spinner/>
+       <Spinner Width="Fit"/>
+       <Spinner Width="120"/>
        <HorizontalStack Fit="true" Margin="5" Background="SkyBlue">
                <Spinner Name="sp1" Value="5" ValueChanged="onSpinnerValueChange"/>
                <Spinner Value="5" Width="60"/>
index 30bfe3d3f04344bc61cc2010fb27421da0741913..06169f2b46dd1a6ce22619fea757603906d1b0e1 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
-<Border Foreground="Transparent" Focusable="true" HorizontalAlignment="Left" Height="Fit" Width="200">
-       <HorizontalStack Margin="0"
-                               MouseEnter="{Background=hgradient|0:DarkRed|1:Transparent}"
+<Border Foreground="Transparent" Focusable="true" HorizontalAlignment="Left" Height="Fit">
+       <HorizontalStack Margin="1" Spacing="3"
+                               MouseEnter="{Background=LightBlue}"
                                MouseLeave="{Background=Transparent}">
-               <Widget Height="12" Width="20" Background="{}" Margin="0" CornerRadius="3"/>
-               <Label Text="{}" Margin="0" Width="Stretched"/>
+               <Widget Height="12" Width="20" Background="{}" Margin="0" CornerRadius="5"/>
+               <Label  Text="{}" Margin="0" Width="Stretched"/>
        </HorizontalStack>
 </Border>