-
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
{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
{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
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
<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>
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";
Margin = "1";
Background = "Grey";
}
-Spinner {
- Foreground = "Grey";
-}
+
TabView {
CacheEnabled = "false";
AllowDrop = "true";
Scroller {
CacheEnabled = "false";
}
-Control {
- Margin="0";
- Spacing="3";
-}
SaturationValueSelector {
Foreground="Red";
}
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";
Maximum = "0";
Value = "0";
Foreground="Transparent";
- Background="DimGrey";
+ Background="Onyx";
Width = "12";
CornerRadius = "0";
}
<?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}"
>
<?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
<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
<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>
<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
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"/>
<?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
<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}"
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
<?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
DarkBlue = 0x00008BFF,
DarkCyan = 0x008B8BFF,
DarkGoldenRod = 0xB8860BFF,
- DarkGrey = 0xA9A9A9FF,
+ DarkGrey = 0x202020FF,
DarkGreen = 0x006400FF,
DarkKhaki = 0xBDB76BFF,
DarkMagenta = 0x8B008BFF,
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));
}
}
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);
[XmlIgnore]protected Char CurrentChar
{
get {
- return lines [CurrentLine] [CurrentColumn];
+ return lines [CurrentLine][CurrentColumn];
}
}
/// <summary>
/// <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 {
//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;
<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>
namespace tests
{
- public class BasicTests : Interface
+ public class BasicTests : SampleBase
{
[STAThread]
static void Main ()
//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 ();
int idx = 0;
string [] testFiles;
- public Version CrowVersion {
- get {
- return System.Reflection.Assembly.GetAssembly (typeof (Widget)).GetName ().Version;
- }
- }
public override bool OnKeyDown (Key key)
{
}
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 =
<?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
--- /dev/null
+<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>
-<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>
+++ /dev/null
-/* 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
- }
-
- }
-}
<?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
<?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" />
}
- #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
<?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"
+++ /dev/null
-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
+++ /dev/null
-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
--- /dev/null
+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
<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" />
--- /dev/null
+<?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>
+
+
+
<?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
<?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
<?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"/>
<?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>