]> O.S.I.I.S - jp/crowedit.git/commitdiff
debug log, wip
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 16 Jul 2025 18:22:06 +0000 (20:22 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 16 Jul 2025 18:22:06 +0000 (20:22 +0200)
14 files changed:
CrowEditBase/CrowEditBase.csproj
CrowEditBase/src/LogViewerWidget.cs
CrowEditBase/ui/CrowEdit.style
CrowEditBase/ui/sourceEditor.itmp
plugins/CECrowPlugin/src/CrowService.cs
plugins/CECrowPlugin/ui/EnumSelector.template
plugins/CECrowPlugin/ui/WidgetRecord.itemp
plugins/CECrowPlugin/ui/dbg.style
plugins/CECrowPlugin/ui/winConfiguration.crow
plugins/CECrowPlugin/ui/winDebugLog.crow
plugins/CEEbnfPlugin/src/Parsing/EbnfTokenType.cs
plugins/CEXmlPlugin/src/Parsing/XmlTokenizer.cs
src/CrowEdit.cs
ui/windows/winLogs.crow

index 962c66c4fd08fd286d09dab404aae952e7110b39..15f76efe8fcf28ea8b55198f6e3d3018640d7090 100644 (file)
@@ -20,7 +20,7 @@
        <ItemGroup>
                <ProjectReference Include="/mnt/sdata/devel/crow/Crow/Crow.csproj"/>
                <!--<PackageReference Include="Crow" Version="1.3.2-beta" />-->
-               <PackageReference Include="Crow.CairoBackend" Version="1.2.3-beta" />
+               <PackageReference Include="Crow.CairoBackend" Version="1.2.4-beta" />
        </ItemGroup>
        <ItemGroup>
                <AssemblyAttribute Include="Crow.CrowAssemblyPriority">
index 8d575cbdaeb132db38c6e9d6d50607f2d451c903..1a83c74e0c5f52421c8c5e87e80343e364d24239 100644 (file)
@@ -322,8 +322,6 @@ namespace Crow
                                entries = filteredLines.Skip(ScrollY).Take(visibleLines).ToArray();
                        }
 
-                       //perf.Restart();
-
                        for (int i = 0; i < entries.Count(); i++) {
                                int idx = i + ScrollY;
                                LogEntry le = entries.ElementAt(i);
@@ -371,14 +369,11 @@ namespace Crow
                                                        break;
                                        }
                                        gr.MoveTo (x, y + fe.Ascent);
-                                       ReadOnlySpan<char> tmp = le.msg.AsSpan(0, Math.Min (400, le.msg.Length));
+                                       ReadOnlySpan<char> tmp = le.msg.AsSpan(0, Math.Min (100, le.msg.Length));
                                        gr.ShowText (tmp);
                                }
                                y += fe.Height;
                        }
-                       /*perf.Stop();
-                       Console.WriteLine($"log onDraw: {visibleLines} lines in {perf.ElapsedMilliseconds} ms");*/
-                       
                }
                
                public override void onMouseLeave(object sender, MouseMoveEventArgs e)
index 83011fe7f166b39cc8f1c97c4fce7d7beebc8c9b..099d56abb8da4ff0d8b1b6c9adec34209c387066 100644 (file)
@@ -153,7 +153,7 @@ EnumSelector {
        Template = "#ui.EnumSelector.template";
        //ItemStyle = "CheckBox";
 }
-/*CheckBox {
+CheckBox {
        Template= "#Crow.CheckBox2.template";
        Width = "Stretched";
        Height = "Fit";
@@ -164,7 +164,7 @@ EnumSelector {
        Unchecked = "{Background=${ControlIdle}}";
        MouseEnter = "{Foreground=${ControlCaptionHoverColor}}";
        MouseLeave = "{Foreground=${ControlForeground}}";
-}*/
+}
 StateBox {
        Template= "#Crow.CheckBox2.template";
        Width = "Stretched";
index 53cdcad4e61cf22aba6b763cd8e0f68496d1ea19..e88413ce5f0ba5984bee8f89e6db6ce386abe3e2 100644 (file)
@@ -12,7 +12,7 @@
                                        LargeIncrement="{../tb.PageWidth}" SmallIncrement="1"
                                        CursorRatio="{../tb.ChildWidthRatio}" Maximum="{../tb.MaxScrollX}" />
                        <HorizontalStack Height="Fit" Spacing='3'>
-                               <Widget Width="Stretched"/>
+                               <!--<Widget Width="Stretched"/>
                                <Label Text="TokType" Foreground="Grey"/>
                                <Label Text="{../../tb.CurrentTokenType}" Margin="3"/>
                                <Label Text="Tok" Foreground="Grey"/>
@@ -40,7 +40,7 @@
                                <Label Text="Col:" Foreground="Grey"/>
                                <Label Text="{../../tb.TabulatedColumn}" Margin="3"/>
                                <Label Text="Abs:" Foreground="Grey"/>
-                               <Label Text="{../../tb.AbsoluteCharLoc}" Margin="3"/>
+                               <Label Text="{../../tb.AbsoluteCharLoc}" Margin="3"/>-->
                        </HorizontalStack>
        </VerticalStack>
 </ListItem>
index 770820d55adbd8a26e7c1cb275cfcc085061931f..d38a4cfb32a271772e188c682655bcfb55cb0fa3 100644 (file)
@@ -50,36 +50,17 @@ namespace CECrowPlugin
                ];
 
                #region Commands
-               public Command CMDStartRecording, CMDStopRecording, CMDRefresh;
+               public Command CMDStartRecording, CMDStopRecording, CMDRefresh, CMDAddEventToRecord, CMDRemoveEventToRecord;
                public Command CMDGotoParentEvent, CMDEventHistoryForward, CMDEventHistoryBackward;
                public CommandGroup LoggerCommands => new CommandGroup (CMDRefresh, CMDStartRecording, CMDStopRecording);
                public CommandGroup GraphicTreeCommands => new CommandGroup (CMDRefresh);
                public CommandGroup EventCommands => new CommandGroup(
                                CMDGotoParentEvent, CMDEventHistoryBackward, CMDEventHistoryForward);
-               public ActionCommand CMDOptions_SelectCrowAssemblyLocation => new ActionCommand ("...",
-                       () => {
-                               FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
-                               <FileDialog Caption='Select Crow.dll assembly' CurrentDirectory='{CrowDbgAssemblyLocation}'
-                                                       ShowFiles='true' ShowHidden='true' />");
-                               dlg.OkClicked += (sender, e) => CrowDbgAssemblyLocation = (sender as FileDialog).SelectedFileFullPath;
-                               dlg.DataSource = this;
-                       }
-               );
-               public ActionCommand CMDOptions_AddCrowAssembly => new ActionCommand ("Add Assembly with Crow Ressource",
-                       () => {
-                               FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
-                               <FileDialog Caption='Select Assembly with Crow Ressources' CurrentDirectory='{CrowDbgAssemblyLocation}'
-                                                       ShowFiles='true' ShowHidden='true' />");
-                               dlg.OkClicked += (sender, e) => {
-                                       crowAssemblies.Add ((sender as FileDialog).SelectedFileFullPath);
-                                       saveCrowAssemblies ();
-                               };
-                               dlg.DataSource = this;
-                       }
-               );
-               public ActionCommand CMDOptions_RemoveCrowAssembly;
-               public ActionCommand CMDViewPreview, CMDViewGraphicTree, CMDViewProperties;
+               public Command CMDOptions_SelectCrowAssemblyLocation, CMDOptions_AddCrowAssembly, CMDOptions_RemoveCrowAssembly;
+               public Command CMDOptions_SelectDebugLogDirectory;
+               public Command CMDViewPreview, CMDViewGraphicTree, CMDViewProperties;
                public CommandGroup ViewCommands;
+               
                void initCommands ()
                {
                        CMDViewPreview = new ActionCommand("Preview", () => App.LoadWindow ("#CECrowPlugin.ui.winCrowPreview.crow", App), "#icons.presentation.svg");
@@ -90,6 +71,19 @@ namespace CECrowPlugin
                        CMDRefresh = new ActionCommand ("Refresh", refresh, "#icons.refresh.svg", IsRunning);
                        CMDStartRecording = new ActionCommand ("Start Recording", () => Recording = true, "#icons.circle.svg", false);
                        CMDStopRecording = new ActionCommand ("Stop Recording", stopRecording, "#icons.circle-red.svg", false);
+                       CMDAddEventToRecord = new ActionCommand ("Add Event To Record", () => {
+                               if (EvtTypeToAddForRecording != DbgEvtType.None && !recordedEvents.Contains(EvtTypeToAddForRecording)) {
+                                       recordedEvents.Add(EvtTypeToAddForRecording);
+                                       EvtTypeToAddForRecording = DbgEvtType.None;
+                               }
+                       });
+                       CMDRemoveEventToRecord = new ActionCommand ("Remove Event To Record", () => {
+                               if (currentRecordedEvent != DbgEvtType.None && recordedEvents.Contains(currentRecordedEvent)) {
+                                       recordedEvents.Remove(currentRecordedEvent);
+                                       currentRecordedEvent = DbgEvtType.None;
+                               }
+                       });
+
 
                        CMDGotoParentEvent = new ActionCommand("parent", ()=> { CurrentEvent = CurrentEvent?.parentEvent; }, "#icons.level-up.svg", false);
                        CMDEventHistoryBackward = new ActionCommand("back.", currentEventHistoryGoBack, "#icons.previous.svg", false);
@@ -100,6 +94,32 @@ namespace CECrowPlugin
                                        crowAssemblies.Remove(selectedCrowAssembly);
                                        saveCrowAssemblies ();
                                }, "#icons.trash.svg", false);
+                       CMDOptions_SelectCrowAssemblyLocation = new ActionCommand ("...", () =>
+                       {
+                               FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
+                               <FileDialog Caption='Select Crow.dll assembly' CurrentDirectory='{CrowDbgAssemblyLocation}'
+                                                       ShowFiles='true' ShowHidden='true' />");
+                               dlg.OkClicked += (sender, e) => CrowDbgAssemblyLocation = (sender as FileDialog).SelectedFileFullPath;
+                               dlg.DataSource = this;
+                       });
+                       CMDOptions_AddCrowAssembly = new ActionCommand ("Add Assembly with Crow Ressource", () => {
+                               FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
+                               <FileDialog Caption='Select Assembly with Crow Ressources' CurrentDirectory='{CrowDbgAssemblyLocation}'
+                                                       ShowFiles='true' ShowHidden='true' />");
+                               dlg.OkClicked += (sender, e) => {
+                                       crowAssemblies.Add ((sender as FileDialog).SelectedFileFullPath);
+                                       saveCrowAssemblies ();
+                               };
+                               dlg.DataSource = this;
+                       });
+                       CMDOptions_SelectDebugLogDirectory = new ActionCommand ("...", () =>
+                       {
+                               FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
+                               <FileDialog Caption='Select Logs directory ' CurrentDirectory='{²DebugLogFileDirectory}'
+                                                       ShowFiles='false' ShowHidden='false' />");
+                               dlg.DataSource = this;
+                       });
+
                }
                #endregion
 
@@ -109,6 +129,14 @@ namespace CECrowPlugin
                                delSetSource (imlSource);
                        }
                }
+               void refresh () {
+                       if (!IsRunning)
+                               Start ();
+                       if (IsRunning) {
+                               fiITor_NextInstantiatorID?.SetValue (null, 0);
+                               delReloadIml ();
+                       }
+               }
                
                Project currentSolution;
                Exception currentException;
@@ -228,70 +256,6 @@ namespace CECrowPlugin
                
                #endregion
 
-               #region DebugLog
-               bool recording, debugLogIsEnabled;
-               IList<DbgEvtType> recordedEvents = new ObservableList<DbgEvtType>(new DbgEvtType[] {DbgEvtType.Widget} );
-               DbgEvtType addRecordedEvents = DbgEvtType.None;
-               public bool DebugLogIsEnabled {
-                       get => debugLogIsEnabled;
-                       set {
-                               if (debugLogIsEnabled == value)
-                                       return;
-                               debugLogIsEnabled = value;
-                               CMDStartRecording.CanExecute = debugLogIsEnabled & !Recording;
-                               CMDStopRecording.CanExecute = debugLogIsEnabled & Recording;
-                               NotifyValueChanged (debugLogIsEnabled);
-                       }
-               }
-               public bool Recording {
-                       get => recording;
-                       set {
-                               if (recording == value)
-                                       return;
-                               recording = IsRunning & DebugLogIsEnabled & value;
-                               if (recording) {
-                                       fiDbg_IncludedEvents.SetValue (dbgIFace, RecordedEvents.ToList());
-                                       CMDStartRecording.CanExecute = false;
-                                       CMDStopRecording.CanExecute = true;
-                               } else {
-                                       fiDbg_IncludedEvents.SetValue (dbgIFace, new List<DbgEvtType>());
-                                       CMDStartRecording.CanExecute = debugLogIsEnabled;
-                                       CMDStopRecording.CanExecute = false;
-                               }
-                               NotifyValueChanged(recording);
-                       }
-               }
-               public IList<DbgEvtType> RecordedEvents {
-                       get => recordedEvents;
-                       set {
-                               if (recordedEvents == value)
-                                       return;
-                               recordedEvents = value;
-                               if (Recording)
-                                       fiDbg_IncludedEvents.SetValue (dbgIFace, value);
-                               NotifyValueChanged (recordedEvents);
-                       }
-               }
-               public DbgEvtType AddRecordedEvents {
-                       get => addRecordedEvents;
-                       set {
-                               if (addRecordedEvents == value)
-                                       return;
-                               addRecordedEvents = value;
-                               NotifyValueChanged (addRecordedEvents);
-                       }
-               }               
-               public string DebugLogFilePath {
-                       get => Configuration.Global.Get<string> ("DebugLogFilePath");
-                       set {
-                               if (DebugLogFilePath == value)
-                                       return;
-                               Configuration.Global.Set ("DebugLogFilePath", value);
-                               NotifyValueChanged (value);
-                       }
-               }
-               #endregion
-
                public bool HasVkvgBackend { get; private set; }
                public int RefreshRate {
                        get => Configuration.Global.Get<int> ("RefreshRate", 10);
@@ -662,7 +626,7 @@ namespace CECrowPlugin
                }
                #endregion
                
-               #region Mouse & Keyboard                
+               #region Mouse & Keyboard
                Point mouseScreenPos;//absolute on screen position.
                public void onKeyDown(KeyEventArgs e)
                {
@@ -763,8 +727,91 @@ namespace CECrowPlugin
                #endregion
 
                #region Debug log
+               bool recording, debugLogIsEnabled;
+               int firstWidgetIndexToGet = 0;
+               public object LogMutex = new object ();
                IList<DbgEvent> events;
                IList<DbgWidgetRecord> widgets;
+               IList<DbgEvtType> recordedEvents = new ObservableList<DbgEvtType>(new DbgEvtType[] { DbgEvtType.Widget } );
+               DbgEvtType evtTypeToAddForRecording = DbgEvtType.None, currentRecordedEvent = DbgEvtType.None;
+               public bool DebugLogIsEnabled {
+                       get => debugLogIsEnabled;
+                       set {
+                               if (debugLogIsEnabled == value)
+                                       return;
+                               debugLogIsEnabled = value;
+                               CMDStartRecording.CanExecute = debugLogIsEnabled & !Recording;
+                               CMDStopRecording.CanExecute = debugLogIsEnabled & Recording;
+                               NotifyValueChanged (debugLogIsEnabled);
+                       }
+               }
+               public bool Recording {
+                       get => recording;
+                       set {
+                               if (recording == value)
+                                       return;
+                               recording = IsRunning & DebugLogIsEnabled & value;
+                               if (recording) {
+                                       fiDbg_IncludedEvents.SetValue (dbgIFace, RecordedEvents.ToList());
+                                       CMDStartRecording.CanExecute = false;
+                                       CMDStopRecording.CanExecute = true;
+                               } else {
+                                       fiDbg_IncludedEvents.SetValue (dbgIFace, new List<DbgEvtType>());
+                                       CMDStartRecording.CanExecute = debugLogIsEnabled;
+                                       CMDStopRecording.CanExecute = false;
+                               }
+                               NotifyValueChanged(recording);
+                       }
+               }
+               public IList<DbgEvtType> RecordedEvents {
+                       get => recordedEvents;
+                       set {
+                               if (recordedEvents == value)
+                                       return;
+                               recordedEvents = value;
+                               if (Recording)
+                                       fiDbg_IncludedEvents.SetValue (dbgIFace, value);
+                               NotifyValueChanged (recordedEvents);
+                       }
+               }
+               public DbgEvtType EvtTypeToAddForRecording {
+                       get => evtTypeToAddForRecording;
+                       set {
+                               if (evtTypeToAddForRecording == value)
+                                       return;
+                               evtTypeToAddForRecording = value;
+                               NotifyValueChanged (evtTypeToAddForRecording);
+                       }
+               }
+               public object CurrentRecordedEvent {
+                       get => currentRecordedEvent;
+                       set {
+                               if (currentRecordedEvent == (DbgEvtType)value)
+                                       return;
+                               currentRecordedEvent = (DbgEvtType)value;
+                               NotifyValueChanged(currentRecordedEvent);
+                       }
+               }
+               public string DebugLogFileDirectory {
+                       get => Configuration.Global.Get<string> ("DebugLogFileDirectory", Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments));
+                       set {
+                               if (DebugLogFileDirectory == value)
+                                       return;
+                               Configuration.Global.Set ("DebugLogFileDirectory", value);
+                               NotifyValueChanged (value);
+                       }
+               }
+               public bool DebugLogToFile {
+                       get => Configuration.Global.Get<bool> (nameof(DebugLogToFile));
+                       set {
+                               if (DebugLogToFile == value)
+                                       return;
+                               Configuration.Global.Set (nameof(DebugLogToFile), value);
+                               NotifyValueChanged(DebugLogToFile);
+                               DbgLogger.ConsoleOutput = !value;
+                       }
+               }
+
                public IList<DbgEvent> Events {
                        get => events;
                        set {
@@ -783,42 +830,42 @@ namespace CECrowPlugin
                                NotifyValueChanged (nameof (Widgets), widgets);
                        }
                }
-               void refresh () {
-                       if (!IsRunning)
-                               Start ();
-                       if (IsRunning) {
-                               fiITor_NextInstantiatorID?.SetValue (null, 0);
-                               delReloadIml ();
-                       }
-                               
-                       //updateCrowApp();
-               }
+
                void stopRecording () {
                        if (!Recording)
                                return;
                        Recording = false;
-                       getLog ();
-                       App.LoadWindow ("#CECrowPlugin.ui.winDebugLog.crow", this);
+                       if (DebugLogToFile) {
+                               string logfilepath = Path.Combine(DebugLogFileDirectory,  $"crow-{DateTime.Now:yyyy-MM-dd_hh-mm}.log");
+                               using (FileStream stream = new FileStream(logfilepath, FileMode.CreateNew, FileAccess.Write)) {
+                                       writeLog(stream);
+                                       MessageBox.ShowModal(App, MessageBox.Type.Information, $"Debug log saved to: {logfilepath}");
+                               }
+                       } else {
+                               getLog ();
+                               App.LoadWindow ("#CECrowPlugin.ui.winDebugLog.crow", this);
+                       }
+               }
+               void writeLog(Stream stream) {
+                       Type debuggerType = crowAssembly.GetType("Crow.DbgLogger");
+                       MethodInfo miSave = debuggerType.GetMethod("Save",
+                               new Type[] {
+                                       dbgIfaceType,
+                                       typeof(Stream),
+                                       typeof(int),
+                                       typeof(bool)
+                               });
+                       miSave.Invoke(null, new object[] {dbgIFace, stream, firstWidgetIndexToGet, true});
                }
-               int firstWidgetIndexToGet = 0;
-               public object LogMutex = new object ();
                void getLog () {
 
                        using (Stream stream = new MemoryStream (1024)) {
-                               Type debuggerType = crowAssembly.GetType("Crow.DbgLogger");
-                               MethodInfo miSave = debuggerType.GetMethod("Save",
-                                       new Type[] {
-                                               dbgIfaceType,
-                                               typeof(Stream),
-                                               typeof(int),
-                                               typeof(bool)
-                                       });
-
-
                                List<DbgWidgetRecord> widgets = new List<DbgWidgetRecord>();
                                List<DbgEvent> events = new List<DbgEvent>();
-                               miSave.Invoke(null, new object[] {dbgIFace, stream, firstWidgetIndexToGet, true});
+
+                               writeLog(stream);
                                stream.Seek(0, SeekOrigin.Begin);
+
                                DbgLogger.Load (stream, events, widgets);
 
                                lock (LogMutex) {
@@ -918,7 +965,6 @@ namespace CECrowPlugin
 
                        disableCurrentEventHistory = false;
                }
-
                void currentEventHistoryGoForward () {
                        disableCurrentEventHistory = true;
                        CurrentEventHistoryBackward.Push (CurrentEvent);
@@ -935,7 +981,7 @@ namespace CECrowPlugin
                                if (curWidgetRecord == value)
                                        return;
                                curWidgetRecord = value;
-                               NotifyValueChanged (nameof (CurrentWidget), curWidgetRecord);
+                               NotifyValueChanged ("CurrentWidgetRecord", curWidgetRecord);
                                NotifyValueChanged ("CurWidgetRootEvents", curWidgetRecord?.RootEvents);
                                NotifyValueChanged ("CurrentWidgetEvents", curWidgetRecord?.Events);
                                NotifyValueChanged ("CurWidgetProperties", CurWidgetProperties);
index b0a9f25377d445777e32b0b6ca3ff08c854fecd9..b2f65591490b6ca67b0091320262959abf13520e 100644 (file)
@@ -1,10 +1,21 @@
 <?xml version="1.0"?>
-<Popper >
+<!--<Popper >
        <Template>
                <HorizontalStack Background="{../../Background}" Margin="5" Spacing="10">
                        <Label Text="{../../../Caption}" Width="Stretched"/>
-                       <Label Background="SeaGreen" Text="{../../../EnumValue}" Margin="3"/>
+                       <Label Background="SeaGreen" Text="{../../../EnumValue}" Margin="3" Width="Stretched"/>
                </HorizontalStack>
        </Template>     
-       <Wrapper Name="Content" Height="Fit" Width="700" Background="Jet" Orientation="Vertical" />     
-</Popper>
\ No newline at end of file
+       <Wrapper Name="Content" Height="300" Width="Fit" Background="Jet" Orientation="Horizontal" />   
+</Popper>-->
+<Border Style="ControlBorder" Background="{./Background}" CornerRadius="{./CornerRadius}">
+       <HorizontalStack>
+               <Label Text="{./Caption}"/>
+               <Popper Caption="{./EnumValue}" PopDirection="BottomLeft" >
+                       <Template>
+                               <Label Style="ControlCaption" Text="{./Caption}" Foreground="{./Foreground}" MinimumSize="80,1" TextAlignment="Center"/>
+                       </Template>
+                       <Wrapper Name="Content" Background="Onyx" Width="60%" Height="Fit" Margin="5" Orientation="Vertical"/>
+               </Popper>
+       </HorizontalStack>
+</Border>
\ No newline at end of file
index 2b1297d3cd8373b78b7573908bba6bebcb431d62..69d42423977e2aa3c8cf17fefd5e65b84dad8018 100644 (file)
@@ -1,10 +1,11 @@
+<?xml version="1.0"?>
 <ListItem Height="Fit" Margin="1" Focusable="true" HorizontalAlignment="Left" 
                                Selected = "{Background=${ControlHighlight}}"
                                Unselected = "{Background=Transparent}">
        <HorizontalStack>
                <Label Text="{name}" Width="Stretched"/>
                <Label Style="labWidgetRecordList" Text="{listIndex}" Tooltip="List index"/>
-               <Label Style="labWidgetRecordList" Text="{treeIndex}" Tooltip="tree index"/>
+               <Label Style="labWidgetRecordList" Text="{InstanceIndex}" Tooltip="tree index"/>
                <Label Style="labWidgetRecordList" Text="{yIndex}" Tooltip="yIndex"/>
                <Label Style="labWidgetRecordList" Text="{xLevel}" Tooltip="xLevel"/>
        </HorizontalStack>
index 2cd82c1a96620c6a4a5a404f2f2843bed5302320..5cd53013bf47a336d62c1a1e8bbde0c58f4ac3fc 100644 (file)
@@ -4,7 +4,7 @@
 }
 
 smallLabCaption {
-       Font="mono, 8";
+       Font="mono, 10";
        Foreground="Grey";
 }
 smallLabValue {
@@ -32,4 +32,16 @@ labWidgetRecordList {
 
 DbgEventWidget {
        CacheEnabled = "true";
+}
+CheckBoxEvtType {
+       Template= "#Crow.CheckBox2.template";
+       Width = "160";
+       Height = "Fit";
+       CornerRadius = "2";
+       Background = "${ControlIdle}";
+       Foreground = "${ControlForeground}";
+       Checked = "{Background=${ControlHighlight}}";
+       Unchecked = "{Background=${ControlIdle}}";
+       MouseEnter = "{Foreground=${ControlCaptionHoverColor}}";
+       MouseLeave = "{Foreground=${ControlForeground}}";
 }
\ No newline at end of file
index 4f8c87b21e0cd2cf23d4d811c131edd393392396..42f7c2796b1a0e34058661f7bfe98ede068142e2 100644 (file)
                <Spinner Caption="Max Layout Try" Value="{²MaxLayoutingTries}" Maximum="1000"/>
                <Spinner Caption="Max Layout Discard" Value="{²MaxDiscardCount}" Maximum="1000"/>
                <GroupBox Caption="Debug Logger" IsEnabled="{DebugLogIsEnabled}" Height="40%">
-                       <HorizontalStack>
-                               <ListBox Data="{²RecordedEvents}"/>
+                       <HorizontalStack Margin="4">
+                               <ListBox Data="{RecordedEvents}" SelectedItem="{²CurrentRecordedEvent}"/>
                                <VerticalStack Width="50%">
-                                       <EnumSelector RadioButtonStyle="CheckBox2" Template="#CECrowPlugin.ui.EnumSelector.template" Width="Stretched"
-                                               Caption="Recorded Events" EnumValue="{²AddRecordedEvents}"  />
-                                       <HorizontalStack>
-                                               <Button/>
+                                       <CheckBox Name="cbFile" Caption="Record to file" IsChecked="{²DebugLogToFile}" Background="Onyx"/>
+                                       <HorizontalStack Height="Fit" Width="Stretched" IsEnabled="{../cbFile.IsChecked}" Background="Onyx" Margin="5">
+                                               <Label Text="Debug log output directory:" Fit="true"/>
+                                               <TextBox Text="{²DebugLogFileDirectory}"  />
+                                               <Button Command="{CMDOptions_SelectDebugLogDirectory}" MinimumSize="0,0"/>
+                                       </HorizontalStack>
+                                       <Label Text="{CurrentRecordedEvent}"/>
+                                       <EnumSelector RadioButtonStyle="CheckBoxEvtType" Template="#CECrowPlugin.ui.EnumSelector.template" Width="Stretched"
+                                               Caption="Event Type to add for recording:" EnumValue="{²EvtTypeToAddForRecording}"  />
+                                       <HorizontalStack Width="Stretched">
+                                               <Button Command="{CMDAddEventToRecord}" Width="Fit"/>
+                                               <Button Command="{CMDRemoveEventToRecord}" Width="Fit"/>
                                        </HorizontalStack>
                                </VerticalStack>
                        </HorizontalStack>
index 1f97a6b8699551a54d659fba3378dc5c2c43a472..2feb08e919be540448fc9d9fdde9a51c0cfc736f 100644 (file)
                                        <Template>
                                                <Wrapper Name="ItemsContainer" Spacing="1" Background="{./Background}"/>
                                        </Template>
-                               </ListBox>                      
-                       </VerticalStack>                        
+                               </ListBox>
+                       </VerticalStack>
                </TabView>
                <Splitter/>
                <HorizontalStack Height="30%">
-                       <!--<ListBox Data="{Widgets}" Width="200" SelectedItem="{²CurrentWidget}"
-                               ItemTemplate="#CECrowPlugin.ui.WidgetRecord.itemp">                             
-                       </ListBox>-->
+                       <ListBox Data="{Widgets}" Width="200" SelectedItem="{²CurrentWidgetRecord}"
+                               ItemTemplate="#CECrowPlugin.ui.WidgetRecord.itemp">
+                       </ListBox>
                        <ListBox Data="{CurWidgetProperties}" Width="25%" >
                                <ItemTemplate>
                                        <ListItem Height="Fit" Margin="1" Focusable="true" HorizontalAlignment="Left" 
                                                        <Label Text="{Key}" Width="140"/>
                                                        <Label Text="{Value}" Width="Stretched" Background="White" Foreground="Black" TextAlignment="Left"/>
                                                </HorizontalStack>
-                                       </ListItem>                             
+                                       </ListItem>
                                </ItemTemplate>
                        </ListBox>
                        <Splitter/>
                        <VerticalStack>
                                <HorizontalStack Height="Fit" Background="Onyx" Spacing="5">
-                                       <Label Text="{CurrentWidget}"/>
+                                       <Label Text="{CurrentWidgetRecord}"/>
                                        <Label Text="events"/>
-                               </HorizontalStack>                              
+                               </HorizontalStack>
                                <ListBox Height="Stretched" Data="{CurrentWidgetEvents}" SelectedItem="{²CurrentEvent}" Background="DarkGrey"
                                                        ItemTemplate="#CECrowPlugin.ui.DbgWidgetEventListItems.itemp"/>
                        </VerticalStack>
index 9535a3155074276415ee0ecfdde4f6ea11d54f1d..5701fca488b8fa0419d30bca017930fa61ef6976 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (c) 2013-2021  Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
+// Copyright (c) 2013-2025  Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
 //
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
@@ -47,5 +47,6 @@ namespace CrowEdit.Ebnf
                CharMatch                               = 0x2002,
                CodePointMatch                  = 0x2003,
                TokenSectionStart,
+               UnexpectedChar                  = 0x8000,
        }
 }
\ No newline at end of file
index 0c627acb68c866451b98f5b2de7ea1af7a072b38..41ec30a40ec13697c99633061d8db201bac8ed30 100644 (file)
@@ -202,6 +202,5 @@ namespace CrowEdit.Xml
                        addTok (ref reader, XmlTokenType.Unknown);
                        return Toks.ToArray();
                }
-
        }
 }
index b3f1e3d63524ec2468cdce353de2b024825d9999..a206b1c4f50af81f62638b4a46088bc79686c861 100644 (file)
@@ -37,20 +37,10 @@ namespace CrowEdit
 
                static void Main ()
                {
-                       /*DbgLogger.IncludedEvents.AddRange ( new DbgEvtType[] {
-                               DbgEvtType.MouseEnter,
-                               DbgEvtType.MouseLeave,
-                               DbgEvtType.WidgetMouseDown,
-                               DbgEvtType.WidgetMouseUp,
-                               DbgEvtType.WidgetMouseClick,
-                               DbgEvtType.HoverWidget
-                       });*/
                        using (CrowEdit app = new CrowEdit ())
                                app.Run ();
                }
-               public CrowEdit () : base (Configuration.Global.Get<int>("MainWinWidth", 800), Configuration.Global.Get<int>("MainWinHeight", 600), true) {
-
-               }
+               public CrowEdit () : base (Configuration.Global.Get<int>("MainWinWidth", 800), Configuration.Global.Get<int>("MainWinHeight", 600), true) {     }
                public override void ProcessResize(Rectangle bounds)
                {
                        base.ProcessResize(bounds);
@@ -90,7 +80,6 @@ namespace CrowEdit
                                }
                        }
 
-
                        reopenLastProjectList ();
 
                        reopenLastDocumentList ();
index 98dc2f64ae4ec7f32bfcf811768227bd3098d639..edae52362da9ebeacded7991850b31af1515daf5 100644 (file)
@@ -29,7 +29,6 @@
                                                                                Unselected="{.DataSource.IsVisible='false'};{Background=${InactiveTabBackground}};{Foreground=${InactiveTabForeground}}"
                                                                                BubbleEvents="MouseWheel">
                                                                        <HorizontalStack DataSource="{DataSource}" Margin="3" Spacing="5">
-                                                                               <!--<Image Style="TreeIcon" Path="{Icon}" SvgSub="{IconSub}"/> No icon in Document class-->
                                                                                <Label Text="{Name}" ContextCommands="{TabCommands}" Foreground="{../../Foreground}" />
                                                                                <Border CornerRadius="5" BorderWidth="1" Foreground="Transparent"  Height="12" Width="12"
                                                                                                        MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
                                                        <ScrollBar Name="scrollbarY" Value="{²../log.ScrollY}" CursorRatio="{../log.ChildHeightRatio}" Maximum="{../log.MaxScrollY}" />
                                                </HorizontalStack>
                                                <ScrollBar Style="HScrollBar" Name="scrollbarX" Value="{²../log.ScrollX}" Maximum="{../log.MaxScrollX}" SmallIncrement="30"/>
-                                               <HorizontalStack Height="Fit">
+                                               <!--<HorizontalStack Height="Fit">
                                                        <Label Text="MaxScrollY:"/>
                                                        <Label Text="{../../log.MaxScrollY}"/>
                                                        <Label Text="ScrollY:"/>
                                                        <Label Text="{../../log.ScrollY}"/>
-                                               </HorizontalStack>
+                                               </HorizontalStack>-->
                                        </VerticalStack>
                                </ListItem>
                        </ItemTemplate>