]> O.S.I.I.S - jp/crowedit.git/commitdiff
PropertyView categories, TextFormating for tokens and nodes, horiz+vert margin adapt dev
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 16 Aug 2025 20:17:53 +0000 (22:17 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 16 Aug 2025 20:17:53 +0000 (22:17 +0200)
23 files changed:
CrowEdit.sln
CrowEditBase/CrowEditBase.csproj
CrowEditBase/src/Compiler/SourceDocument.cs
CrowEditBase/src/CrowEditBase.cs
CrowEditBase/src/Editor.cs
CrowEditBase/src/Extensions.cs
CrowEditBase/src/SourceEditor.cs
CrowEditBase/src/TextFormatting.cs
plugins/CECrowPlugin/src/CategoryContainer.cs [new file with mode: 0644]
plugins/CECrowPlugin/src/CrowService.cs
plugins/CECrowPlugin/src/DebugInterface.cs
plugins/CECrowPlugin/src/ForeignWidgetContainer.cs
plugins/CECrowPlugin/src/Parsing/IML/ImlDocument.cs
plugins/CECrowPlugin/src/Parsing/Styling/StyleDocument.cs
plugins/CECrowPlugin/src/PropertyContainer.cs
plugins/CECrowPlugin/ui/CategoryExp.itemp [new file with mode: 0644]
plugins/CECrowPlugin/ui/Properties.itemp [new file with mode: 0644]
plugins/CECrowPlugin/ui/winProperties.crow
plugins/CEEbnfPlugin/src/Parsing/EbnfDocument.cs
plugins/CERoslynPlugin/src/MSBuildProject.cs
plugins/CERoslynPlugin/src/Parsing/CSDocument.cs
plugins/CEXmlPlugin/src/Parsing/SVGPreviewWidget.cs
plugins/CEXmlPlugin/src/Parsing/XmlDocument.cs

index db0e9fbc3bcf720cd4edf618a26805bf5adbba7a..510291a4b25e7d28a4cae4557ed4df1df30bde22 100644 (file)
@@ -23,7 +23,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CERoslynPlugin", "plugins\C
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CEXmlPlugin", "plugins\CEXmlPlugin\CEXmlPlugin.csproj", "{196D847E-D051-429B-892F-C405F036B8C2}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow", "..\crow\Crow\Crow.csproj", "{5D8999F6-80D8-44CA-93F2-E18C9E44640C}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow", "Crow\Crow\Crow.csproj", "{5D8999F6-80D8-44CA-93F2-E18C9E44640C}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CENugetPlugin", "plugins\CENugetPlugin\CENugetPlugin.csproj", "{B0E09E4D-1907-46D4-B136-C7378A558201}"
 EndProject
@@ -34,49 +34,133 @@ EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Any CPU = Debug|Any CPU
+               Debug|x64 = Debug|x64
+               Debug|x86 = Debug|x86
                Release|Any CPU = Release|Any CPU
+               Release|x64 = Release|x64
+               Release|x86 = Release|x86
        EndGlobalSection
        GlobalSection(ProjectConfigurationPlatforms) = postSolution
                {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Debug|x64.Build.0 = Debug|Any CPU
+               {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Debug|x86.Build.0 = Debug|Any CPU
                {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Release|Any CPU.Build.0 = Release|Any CPU
+               {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Release|x64.ActiveCfg = Release|Any CPU
+               {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Release|x64.Build.0 = Release|Any CPU
+               {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Release|x86.ActiveCfg = Release|Any CPU
+               {AAA67D93-458E-4DD7-9CDA-4EC7F73D47FF}.Release|x86.Build.0 = Release|Any CPU
                {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Debug|x64.Build.0 = Debug|Any CPU
+               {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Debug|x86.Build.0 = Debug|Any CPU
                {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Release|Any CPU.Build.0 = Release|Any CPU
+               {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Release|x64.ActiveCfg = Release|Any CPU
+               {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Release|x64.Build.0 = Release|Any CPU
+               {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Release|x86.ActiveCfg = Release|Any CPU
+               {B8B5D071-097D-40A6-B1AE-3EC996D2E843}.Release|x86.Build.0 = Release|Any CPU
                {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Debug|x64.Build.0 = Debug|Any CPU
+               {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Debug|x86.Build.0 = Debug|Any CPU
                {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Release|Any CPU.Build.0 = Release|Any CPU
+               {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Release|x64.ActiveCfg = Release|Any CPU
+               {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Release|x64.Build.0 = Release|Any CPU
+               {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Release|x86.ActiveCfg = Release|Any CPU
+               {1095C2F1-802F-4DE1-8035-EE0AAC4A5E35}.Release|x86.Build.0 = Release|Any CPU
                {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Debug|x64.Build.0 = Debug|Any CPU
+               {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Debug|x86.Build.0 = Debug|Any CPU
                {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Release|Any CPU.Build.0 = Release|Any CPU
+               {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Release|x64.ActiveCfg = Release|Any CPU
+               {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Release|x64.Build.0 = Release|Any CPU
+               {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Release|x86.ActiveCfg = Release|Any CPU
+               {14E49365-6E22-4A27-B0E5-C6BBB347A85C}.Release|x86.Build.0 = Release|Any CPU
                {93105D4F-3015-4C37-A377-9E4BD63DB582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {93105D4F-3015-4C37-A377-9E4BD63DB582}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {93105D4F-3015-4C37-A377-9E4BD63DB582}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {93105D4F-3015-4C37-A377-9E4BD63DB582}.Debug|x64.Build.0 = Debug|Any CPU
+               {93105D4F-3015-4C37-A377-9E4BD63DB582}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {93105D4F-3015-4C37-A377-9E4BD63DB582}.Debug|x86.Build.0 = Debug|Any CPU
                {93105D4F-3015-4C37-A377-9E4BD63DB582}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {93105D4F-3015-4C37-A377-9E4BD63DB582}.Release|Any CPU.Build.0 = Release|Any CPU
+               {93105D4F-3015-4C37-A377-9E4BD63DB582}.Release|x64.ActiveCfg = Release|Any CPU
+               {93105D4F-3015-4C37-A377-9E4BD63DB582}.Release|x64.Build.0 = Release|Any CPU
+               {93105D4F-3015-4C37-A377-9E4BD63DB582}.Release|x86.ActiveCfg = Release|Any CPU
+               {93105D4F-3015-4C37-A377-9E4BD63DB582}.Release|x86.Build.0 = Release|Any CPU
                {196D847E-D051-429B-892F-C405F036B8C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {196D847E-D051-429B-892F-C405F036B8C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {196D847E-D051-429B-892F-C405F036B8C2}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {196D847E-D051-429B-892F-C405F036B8C2}.Debug|x64.Build.0 = Debug|Any CPU
+               {196D847E-D051-429B-892F-C405F036B8C2}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {196D847E-D051-429B-892F-C405F036B8C2}.Debug|x86.Build.0 = Debug|Any CPU
                {196D847E-D051-429B-892F-C405F036B8C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {196D847E-D051-429B-892F-C405F036B8C2}.Release|Any CPU.Build.0 = Release|Any CPU
+               {196D847E-D051-429B-892F-C405F036B8C2}.Release|x64.ActiveCfg = Release|Any CPU
+               {196D847E-D051-429B-892F-C405F036B8C2}.Release|x64.Build.0 = Release|Any CPU
+               {196D847E-D051-429B-892F-C405F036B8C2}.Release|x86.ActiveCfg = Release|Any CPU
+               {196D847E-D051-429B-892F-C405F036B8C2}.Release|x86.Build.0 = Release|Any CPU
                {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Debug|x64.Build.0 = Debug|Any CPU
+               {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Debug|x86.Build.0 = Debug|Any CPU
                {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Release|Any CPU.Build.0 = Release|Any CPU
+               {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Release|x64.ActiveCfg = Release|Any CPU
+               {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Release|x64.Build.0 = Release|Any CPU
+               {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Release|x86.ActiveCfg = Release|Any CPU
+               {5D8999F6-80D8-44CA-93F2-E18C9E44640C}.Release|x86.Build.0 = Release|Any CPU
                {B0E09E4D-1907-46D4-B136-C7378A558201}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {B0E09E4D-1907-46D4-B136-C7378A558201}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {B0E09E4D-1907-46D4-B136-C7378A558201}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {B0E09E4D-1907-46D4-B136-C7378A558201}.Debug|x64.Build.0 = Debug|Any CPU
+               {B0E09E4D-1907-46D4-B136-C7378A558201}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {B0E09E4D-1907-46D4-B136-C7378A558201}.Debug|x86.Build.0 = Debug|Any CPU
                {B0E09E4D-1907-46D4-B136-C7378A558201}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {B0E09E4D-1907-46D4-B136-C7378A558201}.Release|Any CPU.Build.0 = Release|Any CPU
+               {B0E09E4D-1907-46D4-B136-C7378A558201}.Release|x64.ActiveCfg = Release|Any CPU
+               {B0E09E4D-1907-46D4-B136-C7378A558201}.Release|x64.Build.0 = Release|Any CPU
+               {B0E09E4D-1907-46D4-B136-C7378A558201}.Release|x86.ActiveCfg = Release|Any CPU
+               {B0E09E4D-1907-46D4-B136-C7378A558201}.Release|x86.Build.0 = Release|Any CPU
                {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Debug|x64.Build.0 = Debug|Any CPU
+               {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Debug|x86.Build.0 = Debug|Any CPU
                {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Release|Any CPU.Build.0 = Release|Any CPU
+               {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Release|x64.ActiveCfg = Release|Any CPU
+               {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Release|x64.Build.0 = Release|Any CPU
+               {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Release|x86.ActiveCfg = Release|Any CPU
+               {22C1906B-BE08-4B31-AE02-2EE012CDA039}.Release|x86.Build.0 = Release|Any CPU
                {CEE513F8-AE14-4588-8C9A-852455747A0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {CEE513F8-AE14-4588-8C9A-852455747A0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {CEE513F8-AE14-4588-8C9A-852455747A0B}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {CEE513F8-AE14-4588-8C9A-852455747A0B}.Debug|x64.Build.0 = Debug|Any CPU
+               {CEE513F8-AE14-4588-8C9A-852455747A0B}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {CEE513F8-AE14-4588-8C9A-852455747A0B}.Debug|x86.Build.0 = Debug|Any CPU
                {CEE513F8-AE14-4588-8C9A-852455747A0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {CEE513F8-AE14-4588-8C9A-852455747A0B}.Release|Any CPU.Build.0 = Release|Any CPU
+               {CEE513F8-AE14-4588-8C9A-852455747A0B}.Release|x64.ActiveCfg = Release|Any CPU
+               {CEE513F8-AE14-4588-8C9A-852455747A0B}.Release|x64.Build.0 = Release|Any CPU
+               {CEE513F8-AE14-4588-8C9A-852455747A0B}.Release|x86.ActiveCfg = Release|Any CPU
+               {CEE513F8-AE14-4588-8C9A-852455747A0B}.Release|x86.Build.0 = Release|Any CPU
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 4f93924c0a968f5b342958bd954868252da126a5..d9b3893587d3e5a79d6f54307e63d858a022d5f7 100644 (file)
@@ -18,7 +18,7 @@
                </EmbeddedResource>
        </ItemGroup>
        <ItemGroup>
-               <ProjectReference Include="/mnt/sdata/devel/crow/Crow/Crow.csproj"/>
+               <ProjectReference Include="..\Crow\Crow\Crow.csproj"/>
                <!--<PackageReference Include="Crow" Version="1.3.2-beta" />-->
                <PackageReference Include="Crow.CairoBackend" Version="1.2.4-beta" />
        </ItemGroup>
index a0f35ae4b7334587b5d67976cc5126e16d438b4f..42a985a038ccf5e66fc7e25820ef5367f04e5ca5 100644 (file)
@@ -128,7 +128,7 @@ namespace CrowEditBase
                }
                #endregion
                protected abstract SyntaxAnalyser CreateSyntaxAnalyser ();
-               public virtual Color GetColorForToken (Token token, SyntaxNode node = null)
+               public virtual TextFormatting GetColorForToken (Token token, SyntaxNode node = null)
                {
                        TokenType tokType = token.Type;
                        if (tokType.HasFlag (TokenType.Punctuation))
index b9b52b5a62ba6a246f5ead3b287666b1a8c9efa2..8194f4aacbee98ed7d3d7d37b656f54f0f5717b7 100644 (file)
@@ -280,7 +280,7 @@ namespace CrowEditBase
                        }
                }
                public string CurFileName {
-                       get => string.IsNullOrEmpty (CurrentFilePath) ? _defaultFileName : Path.GetFileName (CurrentFilePath);
+                       get => string.IsNullOrEmpty (CurrentFilePath) ? "" : Path.GetFileName (CurrentFilePath);
                }
                public string CurFileDir {
                        get => string.IsNullOrEmpty (CurrentFilePath) ? CurrentDir : Path.GetDirectoryName (CurrentFilePath);
index b8c468925c628fd59a75508a6a64c7f42c8caa49..11332c8e7b50f9accf33cda661f7d2bc2daf7d2c 100644 (file)
@@ -693,7 +693,7 @@ namespace CrowEditBase
                                                measureTextBounds (gr);
                                        }
                                }
-                               return Margin * 2 + (lt == LayoutingType.Height ? cachedTextSize.Height : cachedTextSize.Width);
+                               return lt == LayoutingType.Height ? cachedTextSize.Height + 2 * Margin.Height : cachedTextSize.Width + 2 * Margin.Width;
                        } finally {
                                DbgLogger.EndEvent(DbgEvtType.GOMeasure);
                        }
index 1064500d3f80b039869a8dabdd67c86e904d3847..8bb3cda9681895f561d4fd88ab31bce401cfa872 100644 (file)
@@ -9,5 +9,7 @@ namespace CrowEdit
       public static Picture GetIcon (this MemberInfo mi)
         => mi is EventInfo ? new SvgPicture("#icons.event.svg") : new SvgPicture("#icons.property.svg");
       public static Picture GetIcon (this SyntaxException se) => new SvgPicture("#icons.IconAlerte.svg");
+
+      
     }
 }
index a12b1c4b19fc4dedaa65d70af6353ffcf085b53c..f1419f44e211acc519400b5ea4f2f41d83c777bc 100644 (file)
@@ -252,7 +252,7 @@ namespace CrowEditBase
                                                measureTextBounds (gr);
                                        }
                                }
-                               return Margin * 2 + (lt == LayoutingType.Height ? cachedTextSize.Height : cachedTextSize.Width + leftMargin);
+                               return lt == LayoutingType.Height ? cachedTextSize.Height + 2 * Margin.Height : cachedTextSize.Width + leftMargin + 2 * Margin.Width;
                        } finally {
                                DbgLogger.EndEvent(DbgEvtType.GOMeasure);
                        }
@@ -754,7 +754,7 @@ namespace CrowEditBase
                                                        gr.ShowText (buff);*/
                                                } else
                                                        buff = sourceBytes.Slice (tok.Start, tok.Length);
-                                               gr.SetSource (sourceDocument.GetColorForToken (tok));
+                                               gr.SetSource (sourceDocument.GetColorForToken (tok).Foreground);
 
                                                int size = buff.Length * 4 + 1;
                                                if (bytes.Length < size)
@@ -774,7 +774,7 @@ namespace CrowEditBase
                                                                Rectangle r = new RectangleD(pixX, pixY, extents.Width, lineHeight);
                                                                r.Inflate(1);
                                                                gr.Rectangle(r);
-                                                               gr.SetSource(sourceDocument.GetColorForToken (tok).AdjustAlpha(0.5));
+                                                               gr.SetSource(sourceDocument.GetColorForToken (tok).Foreground.AdjustAlpha(0.5));
                                                                gr.Stroke();
                                                        }
 
index 1e7322b52e303432e3d1798e2f3ed08fe031f3f9..9ded484fb5b4bec2888c5de9dd92b1e1207b11a8 100644 (file)
@@ -60,7 +60,7 @@ namespace CrowEditBase
                        }
                }
 
-               public TextFormatting(Color fg, Color bg, bool _bold = false, bool _italic = false){
+               public TextFormatting(Color fg, Color bg = default, bool _bold = false, bool _italic = false){
                        Foreground = fg;
                        Background = bg;
                        Bold = _bold;
@@ -70,6 +70,9 @@ namespace CrowEditBase
                public override string ToString ()
                        => $"{Foreground};{Background};{Bold};{Italic}";
 
+               public static implicit operator TextFormatting(Color color) => new TextFormatting(color);
+               public static implicit operator TextFormatting(Colors color) => new TextFormatting(color);
+
                public static TextFormatting Parse (string str) {
                        string[] tmp = str.Split (';');
                        return new TextFormatting (Color.Parse (tmp[0]), Color.Parse (tmp[1]), bool.Parse (tmp[2]), bool.Parse (tmp[3]));
diff --git a/plugins/CECrowPlugin/src/CategoryContainer.cs b/plugins/CECrowPlugin/src/CategoryContainer.cs
new file mode 100644 (file)
index 0000000..cc6f668
--- /dev/null
@@ -0,0 +1,39 @@
+// 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 System.Diagnostics;
+using CrowEditBase;
+using System.Collections.Generic;
+
+namespace CECrowPlugin
+{
+       [DebuggerDisplay ("{Name}")]
+       public class CategoryContainer : CrowEditComponent
+       {
+               bool _isExpanded = true;
+
+               public readonly IEnumerable<PropertyContainer> Properties;
+               public readonly string Name;
+
+               public bool IsExpanded
+               {
+                       get { return _isExpanded; }
+                       set
+                       {
+                               if (value == _isExpanded)
+                                       return;
+
+                               _isExpanded = value;
+
+                               NotifyValueChanged ("IsExpanded", _isExpanded);
+                       }
+               }
+
+               public CategoryContainer (string categoryName, IEnumerable<PropertyContainer> properties){
+                       Name = categoryName;
+                       Properties = properties;
+               }
+       }
+}
+
index 52a3a272ffcc72f4a51eca5a0ba6f2ce3255a3b8..81d02b27ad6616075a232d65298982040051f4d7 100644 (file)
@@ -164,7 +164,7 @@ namespace CECrowPlugin
                Type dbgIfaceType;
                IList<ForeignWidgetContainer> graphicTree;
                ForeignWidgetContainer currentWidget, hoverWidget;
-
+               internal Dictionary<string,IEnumerable<CategoryContainer>> crowTypesMembersCache = new Dictionary<string,IEnumerable<CategoryContainer>> (10);
                
                public IList<ForeignWidgetContainer> GraphicTree {
                        get => graphicTree;
@@ -525,7 +525,7 @@ namespace CECrowPlugin
                                return false;
                        }
                        
-                       crowLoadCtx = new AssemblyLoadContext("CrowDebuggerLoadContext");
+                       crowLoadCtx = new AssemblyLoadContext("CrowDesignLoadContext");
                        crowAssembly = crowLoadCtx.LoadFromAssemblyPath (CrowDbgAssemblyLocation);
 
                        Type debuggerType = crowAssembly.GetType("Crow.DbgLogger");
index c85f0e99f8a3e1e014bf5b42572c4d6685bc7d54..e91ecea811c021987b1429431001f598aba4f90a 100644 (file)
@@ -232,7 +232,7 @@ namespace CECrowPlugin
                        while (true) {
                                bool mouseInChildren = false;
                                foreach(Widget child in GetWidgetChilren(editHoverWidget)) {
-                                       if (child.MouseIsIn(MousePosition)) {
+                                       if (child != null && child.MouseIsIn(MousePosition)) {
                                                editHoverWidget = child;
                                                mouseInChildren = true;
                                                break;
@@ -359,7 +359,7 @@ namespace CECrowPlugin
                        if (knownCrowWidgetTypes.ContainsKey (typeName))
                                return knownCrowWidgetTypes [typeName];
                        AssemblyLoadContext dbgLoadCtx =
-                               AssemblyLoadContext.All.FirstOrDefault (ctx=>ctx.Name == "CrowDebuggerLoadContext");
+                               AssemblyLoadContext.All.FirstOrDefault (ctx=>ctx.Name == "CrowDesignLoadContext");
                        foreach (Assembly a in dbgLoadCtx.Assemblies) {
                                try {
                                        foreach (Type expT in a.GetExportedTypes ()) {
@@ -383,7 +383,7 @@ namespace CECrowPlugin
 
                        MethodInfo mi = null;
                        AssemblyLoadContext dbgLoadCtx =
-                               AssemblyLoadContext.All.FirstOrDefault (ctx=>ctx.Name == "CrowDebuggerLoadContext");
+                               AssemblyLoadContext.All.FirstOrDefault (ctx=>ctx.Name == "CrowDesignLoadContext");
                        foreach (Assembly a in dbgLoadCtx.Assemblies) {
                                try {
                                        if (CompilerServices.TryGetExtensionMethods (a, t, methodName, out mi)) {
@@ -404,7 +404,7 @@ namespace CECrowPlugin
                }
                public Type GetTypeFromName (string typeName) {
                        AssemblyLoadContext dbgLoadCtx =
-                               AssemblyLoadContext.All.FirstOrDefault (ctx=>ctx.Name == "CrowDebuggerLoadContext");
+                               AssemblyLoadContext.All.FirstOrDefault (ctx=>ctx.Name == "CrowDesignLoadContext");
                        foreach (Assembly a in dbgLoadCtx.Assemblies) {
                                try {
                                        foreach (Type expT in a.GetExportedTypes ()) {
index a5d474eff7af1dd5c44fc19551e1e2e8420990f0..937f98a4fefaaf46e29207a9ac9e751ffdbc5cb1 100644 (file)
@@ -33,6 +33,7 @@ namespace CECrowPlugin
                ForeignWidgetContainer parent;
                string designId, designImlPath;
                int designLine, designColumn;
+               CrowService srv;
                public ForeignWidgetContainer(Type widgetType, object instance, ForeignWidgetContainer parent = null) {
                        type = widgetType;
                        this.instance = instance;
@@ -47,6 +48,7 @@ namespace CECrowPlugin
                        designImlPath = (string)fiWidget_design_imlPath?.GetValue(instance);
 
                        //onsole.WriteLine($"new ForeignWidgetContainer: {this} {parent} {designImlPath}");
+                       srv = App.GetService<CrowService>();
                }
 
 
@@ -54,7 +56,15 @@ namespace CECrowPlugin
                                Where (m=>((m is PropertyInfo pi && pi.CanWrite) || (m is EventInfo)) &&
                                                m.GetCustomAttribute<XmlIgnoreAttribute>() == null);
 
-               public IEnumerable<PropertyContainer> Properties => Members.Where(m=>m.MemberType == MemberTypes.Property).Select(p=> new PropertyContainer(this, p as PropertyInfo));
+               public IEnumerable<CategoryContainer> Properties {
+                       get {
+                               if (!srv.crowTypesMembersCache.ContainsKey(type.FullName)) {
+                                       srv.crowTypesMembersCache.Add (type.FullName, Members.Where(m=>m.MemberType == MemberTypes.Property)
+                                               .Select(p=> new PropertyContainer(this, p as PropertyInfo)).GroupBy(pc=>pc.DesignCategory).Select(g=>new CategoryContainer(g.Key, g.AsEnumerable())));
+                               }
+                               return srv.crowTypesMembersCache[type.FullName];
+                       }
+               }
 
                public string Icon => $"#icons.{type.FullName}.svg";
                public string Name => delGetName();
index 23b32c702d4e1ca6e270afea1bba26366452f1ac..91ecec1fe7e9305d2ea4acae2d20756dce715c02 100644 (file)
@@ -233,7 +233,7 @@ namespace CECrowPlugin
                        return null;
                }
 
-               public override Color GetColorForToken(Token token, SyntaxNode node = null)
+               public override TextFormatting GetColorForToken(Token token, SyntaxNode node = null)
                {
                        TokenType tokType = token.Type;
                        switch ((ImlTokenType)tokType) {
index bf83d6724fe8322e349a8543fdda2a1ec7dec837..bba25baf0f1a05d09ca5b77e7e441138d204741f 100644 (file)
@@ -32,7 +32,7 @@ namespace CECrowPlugin.Style
                        return null;
                }
                public override string GetTokenTypeString (TokenType tokenType) => ((StyleTokenType)tokenType).ToString();
-               public override Color GetColorForToken(Token token, SyntaxNode node = null)
+               public override TextFormatting GetColorForToken(Token token, SyntaxNode node = null)
                {
                        TokenType tokType = token.Type;
                        StyleTokenType xmlTokType = (StyleTokenType)tokType;
index 62459505d5f684c335fbf7f4942e0805ebd83f5a..1d9fa21e846272e89e3b551013cd33294e430060 100644 (file)
@@ -56,8 +56,7 @@ namespace CECrowPlugin
                                        return pi.GetValue(host.Instance);
                        } 
                        set {
-                               
-                                       
+                               Console.WriteLine(value);
                        }
                }
                /// <summary>
@@ -90,7 +89,7 @@ namespace CECrowPlugin
                public bool IsSetByStyling => IsSetByIML ? false : HasStyling;
 
 
-               public Color LabForeground => IsSetByIML ? Colors.Blue : HasStyling ? Colors.Black : Colors.Silver;
+               public Fill LabForeground => IsSetByIML ? Colors.Blue : HasStyling ? Colors.Black : Colors.Silver;
 
                /// <summary>
                /// reset to default value
diff --git a/plugins/CECrowPlugin/ui/CategoryExp.itemp b/plugins/CECrowPlugin/ui/CategoryExp.itemp
new file mode 100644 (file)
index 0000000..21d7f2e
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<Expandable Caption="{Name}" IsExpanded="{IsExpanded}" Background="Grey" Foreground="Black" BubbleEvents="All">
+       <Template>
+               <VerticalStack>
+                       <HorizontalStack Spacing="1" Height="Fit" MouseDoubleClick="./onClickForExpand" Background="Grey">
+                               <Container Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
+                                                                                                                       MouseEnter="{Background=LightGrey}"
+                                                                                                                       MouseLeave="{Background=Transparent}">
+                                       <Image
+                                               Path="#Crow.Icons.expandable.svg"
+                                               Visible="{./IsExpandable}"
+                                               SvgSub="{./IsExpanded}"/>
+                               </Container>
+                               <Label Foreground="White" Text="{./Caption}"/>
+                       </HorizontalStack>
+                       <Container Name="Content" Visible="false"/>
+               </VerticalStack>
+       </Template>
+       <VerticalStack Spacing="1" Height="Fit" Name="ItemsContainer"
+               Margin="0" VerticalAlignment="Top"/>
+</Expandable>  
\ No newline at end of file
diff --git a/plugins/CECrowPlugin/ui/Properties.itemp b/plugins/CECrowPlugin/ui/Properties.itemp
new file mode 100644 (file)
index 0000000..49fcf67
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<ItemTemplate>
+       <ListItem Height="Fit" Width="Stretched" ContextCommands="{Commands}" DataSourceType="PropertyContainer"
+                                               Selected="{Background=${ControlHighlight}}"
+                                               Unselected="{Background=Transparent}">
+               <HorizontalStack>
+                       <Label Width="50%" Text="{Name}" Foreground="LightGrey"/>
+                       <TextBox Margin="1" Text="{²Value}" Height="Fit" Foreground = "{LabForeground}" Font="mono, 12" BubbleEvents="MouseWheel"/>
+               </HorizontalStack>
+       </ListItem>
+</ItemTemplate>
+<ItemTemplate DataType="System.Boolean" >
+       <ListItem Height="Fit" Width="Stretched" ContextCommands="{Commands}" DataSourceType="PropertyContainer"
+                                               Selected="{Background=${ControlHighlight}}"
+                                               Unselected="{Background=Transparent}">
+               <HorizontalStack>
+                       <Label Width="50%" Text="{Name}" Foreground="LightGrey"/>
+                       <CheckBox Background="White" Foreground="{LabForeground}" Height="Stretched" Caption="" IsChecked="{²Value}"
+                               BubbleEvents="MouseWheel">
+                               <Template>
+                                       <Image Style="Icon" Width="${ToggleIconSize}" Height="${ToggleIconSize}" Path="#Crow.Icons.checkbox.svg" SvgSub="{./IsChecked}"/>
+                               </Template>
+                       </CheckBox>
+               </HorizontalStack>
+       </ListItem>
+</ItemTemplate>
+<ItemTemplate Path="#CECrowPlugin.ui.CategoryExp.itemp" DataType="CECrowPlugin.CategoryContainer"
+                Data="Properties" DataTest="Type"/>
+<!--<ItemTemplate>
+       <HorizontalStack Style="MemberViewHStack" ContextCommands="{Commands}" DataSourceType="PropertyContainer">
+               <Label Style="MemberViewLabel" Text="{Name}" Foreground = "{LabForeground}"/>
+               <TextBox Margin="1" Text="{²Value}" Height="Fit" Foreground = "{LabForeground}"/>
+       </HorizontalStack>
+</ItemTemplate>
+
+<ItemTemplate Path="#ui.Enum.itemp" DataType="System.Enum" />
+<ItemTemplate Path="#ui.Enum.itemp" DataType="Style" />
+<ItemTemplate Path="#ui.Fill.itemp" DataType="Crow.Fill"/>-->
+       
\ No newline at end of file
index 1e5ecaecebaf46770e543a4d3d8215fbcae8dd4f..6074663da0e9e4fda1a9830cc334f9e1a562b83c 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <DockWindow Caption="Properties"  Width="20%" Height="50%">
     <VerticalStack RootDataLevel="true" DataSource="{CurrentWidget}">
-        <ListBox Data="{Properties}">
+        <ListBox Data="{Properties}" DataTest="Type" ItemTemplate="#CECrowPlugin.ui.Properties.itemp">
             <Template>
                 <VerticalStack Background="{./Background}">
                     <HorizontalStack Height="Fit" Spacing="10" Margin="10" Background="DimGrey">
                     </HorizontalStack>
                 </VerticalStack>
             </Template>        
-            <ItemTemplate>
-                <ListItem Height="Fit" Width="Stretched" ContextCommands="{Commands}"
-                                    Selected="{Background=${ControlHighlight}}"
-                                    Unselected="{Background=Transparent}">
-                    <HorizontalStack>
-                        <Label Width="50%" Text="{Name}" Foreground="LightGrey"/>
-                        <TextBox Margin="1" Text="{²Value}" Height="Fit" Foreground="{LabForeground}" Font="mono, 12"/>
-                    </HorizontalStack>
-                </ListItem>
-            </ItemTemplate>
         </ListBox>
     </VerticalStack>
 </DockWindow>
index a80ea5b1d0c10fa3ba987b5b80198fc18c40de60..6bd602ecc1027561f793ee8cebb567ad86f6f1c0 100644 (file)
@@ -23,7 +23,7 @@ namespace CrowEdit.Ebnf
                        return null;
                }
 
-               public override Color GetColorForToken(Token token, SyntaxNode node = null)
+               public override TextFormatting GetColorForToken(Token token, SyntaxNode node = null)
                {
                        TokenType tokType = token.Type;
                        EbnfTokenType xmlTokType = (EbnfTokenType)tokType;
index 2e0c66a89198ebf8b69ed1a806b8e59180c3eea3..e4c9aa061072be7c9f956aa701160ac04bef1d0b 100644 (file)
@@ -332,7 +332,7 @@ namespace CERoslynPlugin
                public string IntermediateOutputPath => project.GetProperty ("IntermediateOutputPath").EvaluatedValue;
                public string OutputType => project.GetProperty ("OutputType").EvaluatedValue;
                public string OutputAssembly =>
-                       Path.Combine (project.GetProperty ("TargetDir").EvaluatedValue, project.GetProperty ("TargetName").EvaluatedValue);
+                       Path.Combine (project.GetPropertyValue ("OutputPath"), project.GetPropertyValue ("AssemblyName"));
                public string AssemblyExtension => RuntimeInformation.IsOSPlatform (OSPlatform.Windows) ? ".exe" : "";
                public OutputKind OutputKind {
                        get {
index a12ceb3ca3f44536dd96c35dcbd543e1b2c759f0..de8207c76138f1d75569aa71d43cb5e1b195de1c 100644 (file)
@@ -48,7 +48,7 @@ namespace CERoslynPlugin
                #endregion
 
                public override string GetTokenTypeString (TokenType tokenType) => ((SyntaxKind)tokenType).ToString();
-               public override Color GetColorForToken(Token token, SyntaxNode node = null)
+               public override TextFormatting GetColorForToken(Token token, SyntaxNode node = null)
                {
                        if (node is CSToken cstok) {
                                Console.WriteLine($"=> {cstok.Parent}");
index 97b14f67e05f12fc5ae5b9bb51c6aad37ce834f2..d00efc5e34d61c9ede648d947a9bea7dc6336043 100644 (file)
@@ -102,13 +102,13 @@ namespace CrowEdit.Xml
                public override int measureRawSize (LayoutingType lt)
                {
                        if (xmlDocument == null)
-                               return 2 * Margin;
+                               return lt == LayoutingType.Width ? 2 * Margin.Width : 2 * Margin.Height;
                        if (pic == null) 
                                load();
                        if (lt == LayoutingType.Width)
-                               return (int)(zoomFactor * pic.Dimensions.Width + 2 * Margin);
+                               return (int)(zoomFactor * pic.Dimensions.Width + 2 * Margin.Width);
                        else
-                               return (int)(zoomFactor * pic.Dimensions.Height + 2 * Margin);
+                               return (int)(zoomFactor * pic.Dimensions.Height + 2 * Margin.Height);
                }
                protected override void onDraw (IContext gr)
                {
index 1ef21b74b83bba219eb57f6f5ce07ef439b3c026..dc19188de578a4554295030b1642c6a6fc0bccef 100644 (file)
@@ -105,7 +105,7 @@ namespace CrowEdit.Xml
                        return null;
                }
 
-               public override Color GetColorForToken(Token token, SyntaxNode node = null)
+               public override TextFormatting GetColorForToken(Token token, SyntaxNode node = null)
                {
                        TokenType tokType = token.Type;
                        XmlTokenType xmlTokType = (XmlTokenType)tokType;