Width="50";
TextAlignment="Right";
}
+
ColorSlider {
Focusable="true";
- Height="36";
+ Height="18";
Margin="0";
Maximum="255";
Decimals="0";
-<Label Font="{./Font}" Text="{./Caption}" CornerRadius="{./CornerRadius}" Width="Stretched" Focusable="{./Focusable}"
+<Label Font="{./Font}" Text="{./Caption}" CornerRadius="{./CornerRadius}" Width="Stretched" Focusable="false"
Margin="3"
Background="{./Background}"
Foreground="{./Foreground}"
<?xml version="1.0"?>
<Group Background="{./Background}" >
- <ColorGauge Component="{./Component}" CurrentColor="{./CurrentColor}" Orientation="{./Orientation}" Margin="10" Height="Stretched" CornerRadius="10"/>
- <Border Name="Cursor" Foreground="White" CornerRadius="15" BorderWidth="2">
- <Group Fit="true">
- <Label Left="2" Top="2" Text="{./Value}" Foreground="Black" Font="mono bold, 10"/>
- <Label Text="{./Value}" Foreground="WhiteSmoke" Font="mono bold, 10"/>
- </Group>
- </Border>
+ <ColorGauge Component="{./Component}" CurrentColor="{./CurrentColor}" Orientation="{./Orientation}" Margin="5" Height="Stretched" CornerRadius="10"/>
+ <Shape Name="Cursor" Foreground="White" Size="10,20" Path="M 5.5,11.5 L 9.5,15.5 L 9.5,19.5 L 1.5,19.5 L 1.5,15.5 F G" Scaled="false" KeepProportions="true" StrokeWidth="0" Margin="0" />
</Group>
\ No newline at end of file
<?xml version="1.0"?>
-<Label RootDataLevel="true" Style="TableHeaderLabel" Text="{Caption}" Width="{Width}"/>
\ No newline at end of file
+<Label RootDataLevel="true" Style="TableHeaderLabel" Text="{Caption}" Width="{Width}" Margin="2" Background="DarkGrey"/>
\ No newline at end of file
<Container Background="{./Background}">
<Group CacheEnabled="true">
<VerticalStack Spacing="0">
- <Widget Height="6"/>
+ <Widget Height="10"/>
<Border Style="ControlBorder" CornerRadius="{./CornerRadius}" Margin="10" >
<Container Name="Content" Margin="0" MinimumSize="70,10"/>
</Border>
-// Copyright (c) 2013-2022 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+// Copyright (c) 2013-2025 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-using Crow.Text;
using System;
using System.IO;
using System.Linq;
-using System.Linq.Expressions;
using System.Reflection;
using Drawing2D;
-using System.Reflection.PortableExecutable;
-using Glfw;
namespace Crow
{
//get value from member of object
internal static object getDataTypeAndFetch (object data, string fetchMethod){
+ #if DEBUG
+ if (data == null) {
+ Debug.WriteLine($"getDataTypeAndFetch({fetchMethod}) error: data is null");
+ return null;
+ }
+ #endif
Type dataType = data.GetType();
//Console.WriteLine ($"get data type and fetch {data}.{fetchMethod}");
MethodInfo miGetDatas = dataType.GetMethod (fetchMethod, new Type[] {});
il.Emit (OpCodes.Callvirt, sourceEvent.AddMethod);//call add event
System.Reflection.Emit.Label finish = il.DefineLabel ();
+#if DEBUG_BINDING
il.Emit (OpCodes.Br, finish);
il.MarkLabel (cancel);
- //#if DEBUG_BINDING
//TODO: try to print datasource type in the error message
il.EmitWriteLine ($"[{dm.Name}] Handler method '{bindingDef.TargetMember}' for '{sourceEvent.Name}' NOT FOUND in new dataSource");
- //#endif
il.MarkLabel (finish);
- #if DEBUG_BINDING
il.EmitWriteLine ($"[{dm.Name}] Handler method '{bindingDef.TargetMember}' for '{sourceEvent.Name}' FOUND in new dataSource");
- #endif
-
+#else
+ il.MarkLabel (cancel);
+#endif
il.Emit (OpCodes.Ret);
//store dschange delegate in instatiator instance for access while instancing graphic object
-// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+// Copyright (c) 2013-2025 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-using static Crow.Logger;
namespace Crow
{
<TargetFramework>netstandard2.1</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
- <AssemblyVersion>1.2.3</AssemblyVersion>
+ <AssemblyVersion>1.2.4</AssemblyVersion>
<PackageVersion>$(AssemblyVersion)-beta</PackageVersion>
<Title>Drawing 2D Library</Title>
+++ /dev/null
-<?xml version="1.0"?>
-<VerticalStack>
- <Widget Name="go" Width="100" Height="60" Background="DarkBlue"/>
- <Widget Width="100" Height="60" Background="{../colorPicker.CurrentColor}"/>
- <Label Text="{../colorPicker.CurrentColor}"/>
- <ColorPicker CurrentColor="{²../go.Background}" Name="colorPicker" Background="DimGrey" MinimumSize="0,0" Width="300" Template="/mnt/devel/CrowIDE/Crow/Samples/common/ui/templates/ColorPicker.template" />
-</VerticalStack>
\ No newline at end of file
<?xml version="1.0"?>
<VerticalStack>
- <ColorPicker CurrentColor="{²../go.Background}" Name="colorPicker" Background="DimGrey" Width="400" />
+ <ColorPicker CurrentColor="{²../go.Background}" Name="colorPicker" Background="Jet" Width="220" />
<Widget Name="go" Width="100" Height="60" Background="DarkBlue"/>
<Widget Width="100" Height="60" Background="{../colorPicker.CurrentColor}"/>
<Label Text="{../colorPicker.CurrentColor}"/>
<VerticalStack Margin="50" Spacing="20" Background="Black">
<ColorPicker>
<Template>
-<Border Background="{./Background}" Foreground="{./Foreground}" Width="Stretched"
- CornerRadius="{./CornerRadius}" BorderWidth="1">
- <VerticalStack Margin="2">
- <Widget Width="30" Height="16" Background="{./CurrentColor}"/>
- <HorizontalStack Height="Fit">
- <Label Style="labColor" Text="R:"/>
- <ColorSlider Name="cs" Component="Red" CurrentColor="{./CurrentColor}" Value="{²./Red}"/>
- <Label Style="labColorV" Text="{../cs.Value}" />
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Style="labColor" Text="G:"/>
- <ColorSlider Name="cs" Component="Green" CurrentColor="{./CurrentColor}" Value="{²./Green}"/>
- <Label Style="labColorV" Text="{../cs.Value}" />
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Style="labColor" Text="B:"/>
- <ColorSlider Name="cs" Component="Blue" CurrentColor="{./CurrentColor}" Value="{²./Blue}"/>
- <Label Style="labColorV" Text="{../cs.Value}" />
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Style="labColor" Text="A:"/>
- <ColorSlider Name="cs" Component="Alpha" CurrentColor="{./CurrentColor}" Value="{²./Alpha}"/>
- <Label Style="labColorV" Text="{../cs.Value}" />
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Style="labColor" Text="H:"/>
- <ColorSlider Name="cs" Component="Hue" CurrentColor="{./CurrentColor}" Value="{²./Hue}"/>
- <Label Style="labColorV" Text="{../cs.Value}" />
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Style="labColor" Text="S:"/>
- <ColorSlider Name="cs" Component="Saturation" CurrentColor="{./CurrentColor}" Value="{²./Saturation}"/>
- <Label Style="labColorV" Text="{../cs.Value}" />
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Style="labColor" Text="V:"/>
- <ColorSlider Name="cs" Component="Value" CurrentColor="{./CurrentColor}" Value="{²./Value}"/>
- <Label Style="labColorV" Text="{../cs.Value}" />
- </HorizontalStack>
- </VerticalStack>
-</Border>
+ <Border Background="{./Background}" Foreground="{./Foreground}" Width="Stretched"
+ CornerRadius="{./CornerRadius}" BorderWidth="1">
+ <VerticalStack Margin="2">
+ <Widget Width="30" Height="16" Background="{./CurrentColor}"/>
+ <HorizontalStack Height="Fit">
+ <Label Style="labColor" Text="R:"/>
+ <ColorSlider Name="cs" Component="Red" CurrentColor="{./CurrentColor}" Value="{²./Red}"/>
+ <Label Style="labColorV" Text="{../cs.Value}" />
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Style="labColor" Text="G:"/>
+ <ColorSlider Name="cs" Component="Green" CurrentColor="{./CurrentColor}" Value="{²./Green}"/>
+ <Label Style="labColorV" Text="{../cs.Value}" />
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Style="labColor" Text="B:"/>
+ <ColorSlider Name="cs" Component="Blue" CurrentColor="{./CurrentColor}" Value="{²./Blue}"/>
+ <Label Style="labColorV" Text="{../cs.Value}" />
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Style="labColor" Text="A:"/>
+ <ColorSlider Name="cs" Component="Alpha" CurrentColor="{./CurrentColor}" Value="{²./Alpha}"/>
+ <Label Style="labColorV" Text="{../cs.Value}" />
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Style="labColor" Text="H:"/>
+ <ColorSlider Name="cs" Component="Hue" CurrentColor="{./CurrentColor}" Value="{²./Hue}"/>
+ <Label Style="labColorV" Text="{../cs.Value}" />
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Style="labColor" Text="S:"/>
+ <ColorSlider Name="cs" Component="Saturation" CurrentColor="{./CurrentColor}" Value="{²./Saturation}"/>
+ <Label Style="labColorV" Text="{../cs.Value}" />
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Style="labColor" Text="V:"/>
+ <ColorSlider Name="cs" Component="Value" CurrentColor="{./CurrentColor}" Value="{²./Value}"/>
+ <Label Style="labColorV" Text="{../cs.Value}" />
+ </HorizontalStack>
+ </VerticalStack>
+ </Border>
</Template>
</ColorPicker>
</VerticalStack>
\ No newline at end of file
-<ColorSlider Width="400" Component="Red" Background="Grey" Height="34" CursorSize="24" >
-<Template>
- <Group Background="{./Background}" >
- <ColorGauge Component="{./Component}" CurrentColor="{./CurrentColor}" Orientation="{./Orientation}" Margin="10" Height="Stretched" CornerRadius="10"/>
- <Border Name="Cursor" Foreground="White" CornerRadius="15" BorderWidth="2">
- <Group Fit="true">
- <Label Left="2" Top="2" Text="{./Value}" Foreground="Black" Font="mono bold, 10"/>
- <Label Text="{./Value}" Foreground="WhiteSmoke" Font="mono bold, 10"/>
- </Group>
- </Border>
- </Group>
-</Template>
+<ColorSlider Width="400" Component="Red" Background="Grey" Height="20" CursorSize="20" >
+ <Template>
+ <Group Background="{./Background}" >
+ <ColorGauge Component="{./Component}" CurrentColor="{./CurrentColor}" Orientation="{./Orientation}" Margin="3" Height="Stretched" CornerRadius="10"/>
+ <Border Name="Cursor" Foreground="White" CornerRadius="0" BorderWidth="1">
+ <Group Fit="true">
+ <Label Left="2" Top="2" Text="{./Value}" Foreground="Black" Font="mono bold, 10"/>
+ <Label Text="{./Value}" Foreground="WhiteSmoke" Font="mono bold, 10"/>
+ </Group>
+ </Border>
+ </Group>
+ </Template>
</ColorSlider>
\ No newline at end of file
--- /dev/null
+<ColorSlider Width="400" Component="Red" Background="Transparent" Height="16" CursorSize="10" >
+ <Template>
+ <Group Background="{./Background}" >
+ <ColorGauge Component="{./Component}" CurrentColor="{./CurrentColor}" Orientation="{./Orientation}" Margin="5" Height="Stretched" CornerRadius="10"/>
+ <Shape Name="Cursor" Foreground="White" Size="10,20" Path="M 5.5,11.5 L 9.5,15.5 L 9.5,19.5 L 1.5,19.5 L 1.5,15.5 F G" Scaled="false" KeepProportions="true" StrokeWidth="0" Margin="0" />
+ </Group>
+ </Template>
+</ColorSlider>
--- /dev/null
+<ColorPicker>
+<Template>
+<Popper Margin="0" Caption="{./CurrentColor}" Background="{./Background}" >
+ <Template>
+ <HorizontalStack Margin="1" Spacing="3" Background="{./Background}">
+ <Border Width="18" Height="12" CornerRadius="3"
+ Background="{../../../CurrentColor}">
+ </Border>
+ <Label Width="Stretched" Text="{./Caption}" Foreground="{./Foreground}" />
+ </HorizontalStack>
+ </Template>/>
+ <TabView MinimumSize="{../MinimumPopupSize}" Width="200" Height="200" >
+ <ColorPicker Name="HSV" CurrentColor="{²../../../CurrentColor}" Background="Onyx" BubbleEvents="None"/>
+ <ColorPicker IsVisible="false" Name="Names" CurrentColor="{²../../../CurrentColor}" Height="Stretched" Background="Onyx">
+ <Template>
+ <ListBox Width="Stretched" Data="{./AvailableColors}" SelectedItemChanged="./onSelectedItemChanged">
+ <Template>
+ <Scroller Name="scroller1" Margin="5" ClipToClientRect="true" Background="Onyx">
+ <Wrapper Name="ItemsContainer" Height="Fit" VerticalAlignment="Top"/>
+ </Scroller>
+ </Template>
+ <ItemTemplate>
+ <Border Width="16" Height="16" Background="{}" Foreground="Transparent" Tooltip="{}"
+ MouseEnter="{Foreground=Black}"
+ MouseLeave="{Foreground=Transparent}"/>
+ </ItemTemplate>
+ </ListBox>
+ </Template>
+ </ColorPicker>
+ </TabView>
+</Popper>
+</Template>
+</ColorPicker>
\ No newline at end of file