]> O.S.I.I.S - jp/crow.git/commitdiff
wip
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 1 Nov 2021 14:49:37 +0000 (15:49 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 1 Nov 2021 14:49:37 +0000 (15:49 +0100)
Crow/src/GraphicBackends/Mono.Cairo/Context.cs
Crow/src/GraphicBackends/Mono.Cairo/GLSurface.cs
Crow/src/Widgets/TemplatedContainer.cs
Crow/src/Widgets/TemplatedControl.cs
README.md
Samples/common/ui/Interfaces/Experimental/multiColorPick2.crow
Samples/common/ui/Interfaces/Experimental/multiColorPick3.crow [new file with mode: 0644]

index 84c5fd403e204c1d740c6a239c06f3b4d8601c72..f8c1c0e7ea43eb8d1b499fcef7f14551d7e8ca7f 100644 (file)
@@ -38,7 +38,7 @@ using System;
 using System.Runtime.InteropServices;
 using System.Text;
 
-namespace Crow.Drawing {       
+namespace Crow.Drawing {
 
        [Obsolete ("Renamed Cairo.Context per suggestion from cairo binding guidelines.")]
        public class Graphics : Context {
index 33042658a78212b5c325d8d2211465cd48833f88..451120248b41dfced7e379ed47ff550270fa5e0e 100644 (file)
@@ -34,7 +34,6 @@ namespace Crow.Drawing {
 
        public class GLSurface : Surface
        {
-               
                public GLSurface (IntPtr ptr, bool own) : base (ptr, own)
                {}
 
index c956603229c6c5134a0154d330f56aa1c59f6b1e..7ed025e73dc9504a5257d231567da6b4bb190fa3 100644 (file)
@@ -7,7 +7,7 @@ namespace Crow
 {
        /// <summary>
        /// base class for new containers that will use templates.
-       /// 
+       ///
        /// TemplatedControl's **must** provide a widget of the [`Container`](Container) class named **_'Content'_** inside their template tree
        /// </summary>
        public class TemplatedContainer : TemplatedControl
index dc22896a7f13d9540701c4b30c653e6ea338bdbe..99ff7d23b5b40915d79fd252c2fa0d373c89abaa 100644 (file)
@@ -11,7 +11,7 @@ using Crow.Drawing;
 namespace Crow
 {
        /// <summary>
-       /// Base class for all templated widget
+       /// Base class for all templated widget.
        /// </summary>
        public abstract class TemplatedControl : PrivateContainer
        {
@@ -42,13 +42,14 @@ namespace Crow
                /// Template path or IML fragment.
                /// </summary>
                /// <remark>
-               /// The 'null' default value with the 'NOT_SET' field init value  force a loading
-               /// of the default template by passing the first equality check.
+               /// If both Template property and inline template are present, the second has priority.
                /// </remark>
                [DefaultValue(null)]
                public string Template {
                        get => _template;
                        set {
+                               //The 'null' default value with the 'NOT_SET' field init value  force a loading
+                               // of the default template by passing the first equality check.
                                if (_template == value)
                                        return;
                                _template = value;
@@ -112,17 +113,16 @@ namespace Crow
                #endregion
 
                /// <summary>
-               /// Loads the template. Each TemplatedControl MUST provide a default template
-               /// or have an inlined template in iml.
+               /// Loads the template. Each TemplatedControl should provide a default template
+               /// otherwise it must have an inlined template in iml.
                /// It must be an embedded ressource with ID = fullTypeName.template
-               /// Entry assembly is search first, then the one where the type is defined
                /// </summary>
                /// <Remark>
-               /// Setting the default template path in style will provide an interned string for itor search.
                /// </Remark>
                /// <param name="template">Optional template instance</param>
                protected virtual void loadTemplate(Widget template = null)
                {
+                       // Setting the default template path in style will provide an interned string for itor search.
                        if (this.child != null)//template change, bindings has to be reset
                                this.ClearTemplateBinding();
 
index a868732dad366b890e52302437658c4317632729..3c64fca2d7c0fe0d10675c8ce5f01e79c56d8607 100644 (file)
--- a/README.md
+++ b/README.md
 </p>
 </h1>
 
-**Open source widget toolkit** and rendering engine for building portable graphical interfaces in `C#`, featuring a `declarative language` for ui called [IML](https://github.com/jpbruyere/Crow/wiki/using-iml) with [Styling](https://github.com/jpbruyere/Crow/wiki/Styling), [Templates](https://github.com/jpbruyere/Crow/wiki/Templates) and a [binding system](https://github.com/jpbruyere/Crow/wiki/first-binding) to connect your `c#` code to your `ui` components easily.
+**C.R.O.W.** is an open source widget toolkit and rendering engine for building portable graphical interfaces in `C#`.
 
 <p align="center">
-  <a href="https://github.com/jpbruyere/Crow/blob/master/Images/crowEdit.png">
+  <a href="https://github.com/jpbruyere/CrowEdit">
        <kbd><img src="https://github.com/jpbruyere/Crow/blob/master/Images/crowEdit.png" height="200"></kbd>
   </a>
-  <a href="https://github.com/jpbruyere/Crow/blob/master/Images/chess.png">
+  <a href="https://github.com/jpbruyere/vkChess.net">
        <kbd><img src="https://github.com/jpbruyere/Crow/blob/master/Images/chess.png" height="200"></kbd>
   </a>
 </p>
 
 Check the [Tutorials](https://github.com/jpbruyere/Crow/wiki/Tutorials) for a quick introduction.
 
-The `ShowCase` sample will allow you to quickly test IML with live result.
+The `ShowCase` sample will allow you to quickly test **IML** with live result.
 
 <p align="center">
   <a href="https://github.com/jpbruyere/Crow/blob/master/Images/showCase2.png">
@@ -45,7 +45,9 @@ The `ShowCase` sample will allow you to quickly test IML with live result.
   </a>
 </p>
 
-Visit the [wiki](https://github.com/jpbruyere/Crow/wiki) and the samples for documentation. Due to the early state of this project and the frequent changes, some part of the docs may be outdated. C.R.O.W. is in **beta** development state, api could change, but most of it is quiet stabilized.
+Visit the [wiki](https://github.com/jpbruyere/Crow/wiki) and the [samples](https://github.com/jpbruyere/Crow/wiki/Tutorials) for documentation.
+
+_Due to the early state of this project and the frequent changes, some part of the docs may be outdated. It is in **beta** development state, api could change, but most of it is quiet stabilized._
 
 Please report bugs and issues on [GitHub](https://github.com/jpbruyere/Crow/issues)
 
index 21490b71952ea6c08f1edcda0032847d79d78914..6657832417b661898397ccda2e7b633f352d3d9e 100644 (file)
@@ -11,7 +11,7 @@
                                        </HorizontalStack>
                                </Template>/>
                                <TabView  MinimumSize="{../MinimumPopupSize}" Width="200" Height="200"  >
-                                       <ColorPicker Name="HSV" CurrentColor="{²../../../CurrentColor}" Background="Onyx" />
+                                       <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">
diff --git a/Samples/common/ui/Interfaces/Experimental/multiColorPick3.crow b/Samples/common/ui/Interfaces/Experimental/multiColorPick3.crow
new file mode 100644 (file)
index 0000000..288e641
--- /dev/null
@@ -0,0 +1,19 @@
+<VerticalStack>
+       <Label Text="{../cp.CurrentColor}"/>
+       <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>
+</VerticalStack>
\ No newline at end of file