diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-06-03 15:11:28 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-06-03 15:11:28 +0200 |
| commit | bae9b85da7089fed1ca5dd7882f4f83b74fa6a34 (patch) | |
| tree | d775f4586b0f8eb91dad7bd599b56b3b420318b7 | |
| parent | 545552a246bde80e99e7be1ed65e9273cda8410c (diff) | |
system clipboard support, GroupBox clear color debug
| -rw-r--r-- | Crow.sln | 4 | ||||
| -rw-r--r-- | Crow/Crow.csproj | 2 | ||||
| -rw-r--r-- | Crow/src/Colors.cs | 1 | ||||
| -rw-r--r-- | Crow/src/Fill/SolidColor.cs | 23 | ||||
| -rw-r--r-- | Crow/src/Interface.cs | 6 | ||||
| -rw-r--r-- | Samples/common/ui/Interfaces/Divers/all.crow | 2 |
6 files changed, 13 insertions, 25 deletions
@@ -8,11 +8,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{728545 README.md = README.md EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Crow", "Crow\Crow.csproj", "{C2980F9B-4798-4C05-99E2-E174810F7C7B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow", "Crow\Crow.csproj", "{C2980F9B-4798-4C05-99E2-E174810F7C7B}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}" ProjectSection(SolutionItems) = preProject - Samples\Directory.Build.props = Samples\Directory.Build.props + Samples\Directory.Build.props = Samples\Directory.Build.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloWorld", "Samples\HelloWorld\HelloWorld.csproj", "{F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}" diff --git a/Crow/Crow.csproj b/Crow/Crow.csproj index 49373244..2cfa12fd 100644 --- a/Crow/Crow.csproj +++ b/Crow/Crow.csproj @@ -38,7 +38,7 @@ <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-beta" /> + <PackageReference Include="glfw-sharp" Version="0.2.7-beta" /> <PackageReference Include="FastEnum" Version="1.5.3" /> </ItemGroup> <PropertyGroup Condition=" '$(CrowStbSharp)' == 'true'"> diff --git a/Crow/src/Colors.cs b/Crow/src/Colors.cs index 8dd772d7..d6435bd1 100644 --- a/Crow/src/Colors.cs +++ b/Crow/src/Colors.cs @@ -234,6 +234,7 @@ namespace Crow }*/ public static implicit operator Color (Colors c) => new Color ((UInt32)c); + public static implicit operator Colors (Color c) => (Colors)c.value; public static bool operator ==(Color a, Color b) => a.Equals (b); public static bool operator != (Color a, Color b) => !a.Equals (b); diff --git a/Crow/src/Fill/SolidColor.cs b/Crow/src/Fill/SolidColor.cs index 0b16b09e..3fb1d452 100644 --- a/Crow/src/Fill/SolidColor.cs +++ b/Crow/src/Fill/SolidColor.cs @@ -69,25 +69,8 @@ namespace Crow { return color.GetHashCode(); } - public override bool Equals (object obj) - => obj is Color c ? color.Equals (c) : obj is SolidColor sc && color.Equals (sc.color); - -// public static bool operator ==(SolidColor c, string n) -// { -// return c.color.Name == n ? true : false; -// } -// public static bool operator !=(SolidColor c, string n) -// { -// return c.color.Name == n ? false : true; -// } -// public static bool operator ==(string n, SolidColor c) -// { -// return c.color.Name == n ? true : false; -// } -// public static bool operator !=(string n, SolidColor c) -// { -// return c.color.Name == n ? false : true; -// } + public override bool Equals (object obj) + => obj is Color c ? color.Equals (c) : obj is Colors cl ? color.Equals(cl) : obj is SolidColor sc && color.Equals (sc.color); public static SolidColor operator *(SolidColor c, Double f) { return new SolidColor(new Color(c.color.R,c.color.G,c.color.B,c.color.A * f)); @@ -100,7 +83,7 @@ namespace Crow { return new SolidColor(new Color(c1.color.R - c2.color.R,c1.color.G - c2.color.G,c1.color.B - c2.color.B,c1.color.A - c2.color.A)); } - #endregion + #endregion public override string ToString() { diff --git a/Crow/src/Interface.cs b/Crow/src/Interface.cs index e11d597b..76858729 100644 --- a/Crow/src/Interface.cs +++ b/Crow/src/Interface.cs @@ -393,7 +393,11 @@ namespace Crow public Queue<LayoutingQueueItem> DiscardQueue; /// <summary>Main drawing queue, holding layouted controls</summary> public Queue<Widget> ClippingQueue = new Queue<Widget>(); - public string Clipboard;//TODO:use object instead for complex copy paste + //TODO:use object instead for complex copy paste + public string Clipboard { + get => Glfw3.GetClipboardString (hWin); + set => Glfw3.SetClipboardString (hWin, value); + } /// <summary>each IML and fragments (such as inline Templates) are compiled as a Dynamic Method stored here /// on the first instance creation of a IML item. /// </summary> diff --git a/Samples/common/ui/Interfaces/Divers/all.crow b/Samples/common/ui/Interfaces/Divers/all.crow index bb390def..e59d30d5 100644 --- a/Samples/common/ui/Interfaces/Divers/all.crow +++ b/Samples/common/ui/Interfaces/Divers/all.crow @@ -14,7 +14,7 @@ <ScrollBar Style="HScrollBar"/> </VerticalStack> <VerticalStack Width="200" Height="Fit" Spacing="0"> - <Slider Name="margin" Background="DarkSlateGrey" Foreground="Black" /> + <Slider Name="margin" Background="DarkSlateGrey" Foreground="Black" Value="0" /> <Label Background="DarkSlateGrey" Foreground="Black" Margin="{../margin.Value}" /> <TextBox Background="DarkSlateGrey" Foreground="Black" Margin="{../margin.Value}"/> <Button Background="DarkSlateGrey" Foreground="Black" Margin="{../margin.Value}" /> |