]> O.S.I.I.S - jp/crowedit.git/commitdiff
net9 -> net6, wip
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 21 Jul 2025 07:18:17 +0000 (09:18 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 21 Jul 2025 11:30:53 +0000 (13:30 +0200)
1  2 
CrowEditBase/ui/DockWinTitleBarIconMenu.template
plugins/CECrowPlugin/src/DebugInterfaceWidget.cs
plugins/CECrowPlugin/src/Parsing/IML/ImlDocument.cs
plugins/CECrowPlugin/ui/IMLEditor.itmp
plugins/CECrowPlugin/ui/winCrowPreview.crow

index 29864d4b27a0330b4b238adac089541fe8f6ced4,29864d4b27a0330b4b238adac089541fe8f6ced4..b77e076a368062dfd01105ae587e5d95dffcb5f2
@@@ -1,2 -1,2 +1,2 @@@
  <?xml version="1.0"?>
--<HorizontalStack Name="ItemsContainer" Spacing = "0" Margin="0"/>
++<HorizontalStack Name="ItemsContainer" Spacing = "2" Margin="0"/>
index 7fbaf5b4e93856855149553b282a6072558090c1,559b6c3afec93820ec9fb532a555b7d64a308536..7fd9a0dc8630fa83837a73f5bd2b62a86c9bafb6
@@@ -164,7 -168,16 +168,16 @@@ namespace CECrowPlugi
  
                        imlSource = tmp.ToString ();
  
-                       crowIFaceService?.LoadIML (imlSource);
 -                      /*if (crowIFaceService.EncloseInTemplatedControl && !string.IsNullOrEmpty(crowIFaceService.TemplateContainerSource)) {
++                      if (document.EncloseInTemplatedControl && !string.IsNullOrEmpty(document.TemplateContainerSource)) {
+                               if (!string.IsNullOrEmpty(imlSource) && imlSource.StartsWith("<?xml")) {
+                                       int pos = src.IndexOf('>');
+                                       if (pos > 0)
+                                               src = imlSource.Substring(pos + 1);
+                               }
 -                              string tmpCloseTag = crowIFaceService.TemplateContainerSource.Split (' ', StringSplitOptions.RemoveEmptyEntries)[0].Replace ("<","").TrimEnd('/','>');
 -                              crowIFaceService?.LoadIML ($"{crowIFaceService.TemplateContainerSource.TrimEnd('/','>')}><Template>{src}</Template></{tmpCloseTag}>");
 -                      } else*/
++                              string tmpCloseTag = document.TemplateContainerSource.Split (' ', StringSplitOptions.RemoveEmptyEntries)[0].Replace ("<","").TrimEnd('/','>');
++                              crowIFaceService?.LoadIML ($"{document.TemplateContainerSource.TrimEnd('/','>')}><Template>{src}</Template></{tmpCloseTag}>");
++                      } else
+                               crowIFaceService?.LoadIML (imlSource);
  
                        RegisterForRedraw ();
                }
index 34a684f975e32bd13414c35464f9d3837fa59fe7,031f0cf8d99fd5abb8db144281112a9bfd2b3bc7..44060536a3e29293dad603359077302ddc1a1aba
@@@ -16,6 -16,6 +16,7 @@@ using static CrowEditBase.CrowEditBase
  using CrowEdit.Xml;
  using Drawing2D;
  using System.Diagnostics;
++using System.IO;
  
  namespace CECrowPlugin
  {
                public static bool Is(this Token tok, ImlTokenType type) => (ImlTokenType)tok.Type == type;
        }               
        public class ImlDocument : XmlDocument {
++              Configuration conf;
                public ImlDocument (string fullPath, string editorPath) : base (fullPath, editorPath) {
                        App.GetService<CrowService> ()?.Start ();
++                      conf = new Configuration(Path.Combine(Configuration.AppConfigPath, "editor", this.FileName + ".conf"));
  
                        /*if (project is MSBuildProject msbp) {
                                if (msbp.IsCrowProject)
                        }*/
                }
  
 -                      get => Configuration.Global.Get (nameof(EncloseInTemplatedControl), false);
+               CrowService crowService;
+               public CrowService CrowService {
+                       get => crowService;
+                       set {
+                               if (crowService == value)
+                                       return;
+                               crowService = value;
+                               NotifyValueChanged (crowService);
+                       }
+               }
+               public bool EncloseInTemplatedControl {
 -                              Configuration.Global.Set (nameof(EncloseInTemplatedControl), value);
++                      get => conf.Get (nameof(EncloseInTemplatedControl), false);
+                       set {
+                               if (EncloseInTemplatedControl == value)
+                                       return;
 -                      get => Configuration.Global.Get (nameof(TemplateContainerSource), "<Button/>");
++                              conf.Set (nameof(EncloseInTemplatedControl), value);
+                               NotifyValueChanged (value);
+                               
+                       }
+               }
+               public string TemplateContainerSource {
 -                              Configuration.Global.Set (nameof(TemplateContainerSource), value);
++                      get => conf.Get (nameof(TemplateContainerSource), "<Button/>");
+                       set {
+                               if (TemplateContainerSource == value)
+                                       return;
++                              conf.Set (nameof(TemplateContainerSource), value);
+                               NotifyValueChanged (value);
+                       }
+               }
                protected override SyntaxAnalyser CreateSyntaxAnalyser() => new ImlSyntaxAnalyser (ImmutableBufferCopy);
                public override string GetTokenTypeString (TokenType tokenType) => ((ImlTokenType)tokenType).ToString();
  
index 0000000000000000000000000000000000000000,b5cda478a65075bd701b54936f9ae753c44776b2..28fed4c6e050df2a69b0c52c199b11fba433d44a
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,62 +1,44 @@@
 -              <ListBox Style="DockWinTitleBarIconMenu" Data="{../dbgIfaceWidget.WindowCommands}"/>
 -              <VerticalStack Background="Black" Height="40%" >
 -                      <HorizontalStack Height="Fit" Spacing="5" >
 -                              <CheckBox Caption="Load source as template in:" Width="Fit" Name="cbEncloseInTemplate" IsChecked="{²EncloseInTemplatedControl}"/>
 -                              <TextBox Width="Stretched" Text="{²TemplateContainerSource}" IsEnabled="{../cbEncloseInTemplate.IsChecked}"/>
 -                      </HorizontalStack>
 -                      <DebugInterfaceWidget Name="dbgIfaceWidget" Focusable="true" CurrentWidget="{²CurrentWidget}"
 -                                              BubbleEvents="None"
 -                                              Document="{}"/>
 -                      <!--<Popper IsVisible="{PreviewHasError}" Background="DarkRed">
 -                              <Template>
 -                                      <CheckBox IsChecked="{²./IsPopped}" MouseEnter="{IsChecked='true'}" MouseLeave="{IsChecked='false'}">
 -                                              <Template>
 -                                                      <Label DataSource="{CurrentException}" Text="{Message}" Background="Red" Foreground="White" Width="Stretched" Margin="2"
 -                                                              Multiline="true"/>
 -                                              </Template>
 -                                      </CheckBox>
 -                              </Template>
 -                              <Label Text="{CurrentException}" Background="DarkRed" Foreground="White" Width="90%" Margin="2" Multiline="true"/>
 -                      </Popper>-->
 -              </VerticalStack>
 -              <Splitter/>
+ <?xml version="1.0"?>
+ <ListItem IsVisible="{IsSelected}" IsSelected="{²IsSelected}" Selected="{/tb.HasFocus='true'}">
+       <VerticalStack Spacing="0">
++              <HorizontalStack Height="Fit" Spacing="5" >
++                      <CheckBox Caption="Load source as template in:" Width="Fit" Name="cbEncloseInTemplate" IsChecked="{²EncloseInTemplatedControl}"/>
++                      <TextBox Width="Stretched" Text="{²TemplateContainerSource}" IsEnabled="{../cbEncloseInTemplate.IsChecked}"/>
++              </HorizontalStack>
+               <HorizontalStack Spacing="0" Background="WhiteSmoke">
+                       <SourceEditor Name="tb"  Font="mono, 14" Margin='0' CurrentNode="{CurrentNode}"
+                                       Document="{}" TextChanged="onTextChanged" />
+                       <ScrollBar Value="{²../tb.ScrollY}"
+                                       LargeIncrement="{../tb.PageHeight}" SmallIncrement="1"
+                                       CursorRatio="{../tb.ChildHeightRatio}" Maximum="{../tb.MaxScrollY}" />
+               </HorizontalStack>
+               <ScrollBar Style="HScrollBar" Value="{²../tb.ScrollX}"
+                               LargeIncrement="{../tb.PageWidth}" SmallIncrement="1"
+                               CursorRatio="{../tb.ChildWidthRatio}" Maximum="{../tb.MaxScrollX}" />
+               <HorizontalStack Height="Fit" Spacing='3'>
+                       <Widget Width="Stretched"/>
+                       <Label Text="TokType" Foreground="Grey"/>
+                       <Label Text="{../../tb.CurrentTokenType}" Margin="3"/>
+                       <Label Text="Tok" Foreground="Grey"/>
+                       <Label Text="{../../tb.CurrentTokenString}" Margin="3"/>
+                       <Label Text="Node" Foreground="Grey"/>
+                       <Label Text="{../../tb.CurrentNode}" Margin="3"/>
+                       <Label Text="MouseY:" Foreground="Grey"/>
+                       <Label Text="{../../tb.MouseY}" Margin="3"/>
+                       <Label Text="VisibleLines:" Foreground="Grey"/>
+                       <Label Text="{../../tb.VisibleLines}" Margin="3"/>
+                       <Label Text="ScrollX:" Foreground="Grey"/>
+                       <Label Text="{../../tb.ScrollX}" Margin="3"/>
+                       <Label Text="ScrollY:" Foreground="Grey"/>
+                       <Label Text="{../../tb.ScrollY}" Margin="3"/>
+                       <Label Text="ScrollLine:" Foreground="Grey"/>
+                       <Label Text="{../../tb.ScrollLine}" Margin="3"/>
+                       <Label Text="HoverLine:" Foreground="Grey"/>
+                       <Label Text="{../../tb.HoverLine}" Margin="3"/>
+                       <Label Text="Line:" Foreground="Grey"/>
+                       <Label Text="{../../tb.CurrentLine}" Margin="3"/>
+                       <Label Text="Col:" Foreground="Grey"/>
+                       <Label Text="{../../tb.TabulatedColumn}" Margin="3"/>
+               </HorizontalStack>
+       </VerticalStack>
+ </ListItem>
index e0edc44b184ff426a13d7726523fca95e745d5e8,c32cdb7278aa391c1a847b276d87bebf9599dc76..c3548c9039431e7a3f45729db897999fdc94bcaf
@@@ -1,10 -1,14 +1,10 @@@
  <?xml version="1.0"?>
--<DockWindow Caption="Crow Preview"  Width="60%" Commands="{/dbgIfaceWidget.WindowCommands}">
-       <VerticalStack Background="Black" >     
-               <DebugInterfaceWidget Name="dbgIfaceWidget" Focusable="true" CurrentWidget="{CurrentWidget}"
++<DockWindow Caption="Crow Preview"  Width="60%" FreezeDockState="true" AdditionalCommands="{/dbgIfaceWidget.WindowCommands}">
+       <VerticalStack Background="Black" >
 -              <HorizontalStack Height="Fit" Spacing="5" >
 -                      <CheckBox Caption="Load source as template in:" Width="Fit" Name="cbEncloseInTemplate" IsChecked="{²EncloseInTemplatedControl}"/>
 -                      <TextBox Width="Stretched" Text="{²TemplateContainerSource}" IsEnabled="{../cbEncloseInTemplate.IsChecked}"/>
 -              </HorizontalStack>
+               <DebugInterfaceWidget Name="dbgIfaceWidget" Focusable="true" CurrentWidget="{²CurrentWidget}"
                                        BubbleEvents="None"
                                        Document="{CurrentDocument}"/>
 -              <Popper IsVisible="{PreviewHasError}" Background="DarkRed">
 +              <Popper DataSource="{../dbgIfaceWidget.CrowIFaceService}" IsVisible="{PreviewHasError}" Background="DarkRed">
                        <Template>
                                <CheckBox IsChecked="{²./IsPopped}" MouseEnter="{IsChecked='true'}" MouseLeave="{IsChecked='false'}">
                                        <Template>