From 3754c2d3ed03909fec35aed6781b8dd56c3c8ea4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sun, 2 Mar 2025 20:46:21 +0100 Subject: [PATCH] wip --- CrowEditBase/ui/CrowEdit.style | 14 +- plugins/CECrowPlugin/src/CrowService.cs | 123 +++++++++++++----- plugins/CECrowPlugin/src/DebugInterface.cs | 99 +++++++++++--- .../CECrowPlugin/src/DebugInterfaceWidget.cs | 36 +++-- .../src/Parsing/IML/ImlDocument.cs | 35 +++-- plugins/CECrowPlugin/ui/dbg.style | 8 +- plugins/CECrowPlugin/ui/winConfiguration.crow | 7 +- .../CEXmlPlugin/src/Parsing/XmlDocument.cs | 2 +- ui/windows/winSyntaxExplorer.crow | 2 +- 9 files changed, 247 insertions(+), 79 deletions(-) diff --git a/CrowEditBase/ui/CrowEdit.style b/CrowEditBase/ui/CrowEdit.style index 5ae11c4..10de94f 100644 --- a/CrowEditBase/ui/CrowEdit.style +++ b/CrowEditBase/ui/CrowEdit.style @@ -157,7 +157,7 @@ CheckBox { Template= "#Crow.CheckBox2.template"; Width = "Stretched"; Height = "Fit"; - CornerRadius = "0"; + CornerRadius = "2"; Background = "${ControlIdle}"; Foreground = "${ControlForeground}"; Checked = "{Background=${ControlHighlight}}"; @@ -165,6 +165,18 @@ CheckBox { MouseEnter = "{Foreground=${ControlCaptionHoverColor}}"; MouseLeave = "{Foreground=${ControlForeground}}"; } +StateBox { + Template= "#Crow.CheckBox2.template"; + Width = "Stretched"; + Height = "Fit"; + CornerRadius = "2"; + Background = "${ControlIdle}"; + Foreground = "${ControlForeground}"; + Checked = "{Background=Green}"; + Unchecked = "{Background=DarkRed}"; + Focusable = "false"; +} + LogViewerWidget { Background = "0.01,0.01,0.01,1"; MouseWheelSpeed = "2"; diff --git a/plugins/CECrowPlugin/src/CrowService.cs b/plugins/CECrowPlugin/src/CrowService.cs index c1aa4e2..1b62aa3 100644 --- a/plugins/CECrowPlugin/src/CrowService.cs +++ b/plugins/CECrowPlugin/src/CrowService.cs @@ -7,27 +7,25 @@ using Glfw; using System.Reflection; using System.Runtime.Loader; using System.IO; -using System.Diagnostics; using System.Collections.Generic; using Crow.DebugLogger; using System.Linq; using CrowEditBase; -using System.Threading; -using Crow.Text; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; using static CrowEditBase.CrowEditBase; using Drawing2D; +using System.Diagnostics; namespace Crow { + public class ForeignWidgetContainer { + Type type; + object instance; + + } public class CrowService : Service { public CrowService () : base () { restoreCrowAssemblies (); initCommands (); - - crowLoadCtx = new AssemblyLoadContext("CrowDebuggerLoadContext"); - } public override string ConfigurationWindowPath => "#CECrowPlugin.ui.winConfiguration.crow"; @@ -58,6 +56,7 @@ namespace Crow dlg.DataSource = this; } ); + public ActionCommand CMDOptions_RemoveCrowAssembly; public ActionCommand CMDViewPreview; void initCommands () { @@ -70,6 +69,12 @@ namespace Crow CMDGotoParentEvent = new ActionCommand("parent", ()=> { CurrentEvent = CurrentEvent?.parentEvent; }, "#icons.level-up.svg", false); CMDEventHistoryBackward = new ActionCommand("back.", currentEventHistoryGoBack, "#icons.previous.svg", false); CMDEventHistoryForward = new ActionCommand("forw.", currentEventHistoryGoForward, "#icons.forward-arrow.svg", false); + + CMDOptions_RemoveCrowAssembly = new ActionCommand ("Remove Selected Assembly", () => + { + crowAssemblies.Remove(selectedCrowAssembly); + saveCrowAssemblies (); + }, "#icons.trash.svg", false); } #endregion @@ -77,6 +82,7 @@ namespace Crow if (CurrentState == Status.Running) delSetSource (imlSource); } + Project activeSolution; Exception currentException; public string ErrorMessage = ""; @@ -86,7 +92,9 @@ namespace Crow Assembly crowAssembly, thisAssembly; Type dbgIfaceType; -#region dbgIface delegates + + #region dbgIface delegates + Func delGetWidgetTypeFromName; Action delResize; Func delMouseMove; Func delMouseWheelChanged; @@ -99,14 +107,19 @@ namespace Crow Func delGetMainSurface; Action delSetSource; Action delReloadIml; + Action delLockRenderMutex; + Action delUnlockRenderMutex; Func delGetZoomFactor; Action delSetZoomFactor; FieldInfo fiDbg_IncludedEvents, fiDbg_ConsoleOutput, fiDbgIFace_MaxLayoutingTries, fiDbgIFace_MaxDiscardCount, fiDbgIFace_Terminate; -#endregion + + //design mode members, present only if crow compiled with DESIGN_MODE enabled + FieldInfo fiWidget_design_id; + #endregion -#region DebugLog + #region DebugLog bool recording, debugLogIsEnabled; IList recordedEvents = new ObservableList(new DbgEvtType[] {DbgEvtType.Widget} ); DbgEvtType addRecordedEvents = DbgEvtType.None; @@ -168,7 +181,7 @@ namespace Crow NotifyValueChanged (value); } } -#endregion + #endregion public bool HasVkvgBackend { get; private set; } public int RefreshRate { @@ -232,13 +245,28 @@ namespace Crow if (IsRunning) fiDbgIFace_IsDirty.SetValue (dbgIFace, false); } + public void LockRenderMutex() { + if (IsRunning) + delLockRenderMutex(); + } + public void UnlockRenderMutex() { + if (IsRunning) + delUnlockRenderMutex(); + } public bool GetDirtyState => IsRunning ? (bool)fiDbgIFace_IsDirty.GetValue (dbgIFace) : false; + public bool DesignModeEnabled => IsRunning && fiWidget_design_id != null ? true : false; + public Type GetWidgetTypeFromeName(string typeName) { + if (!IsRunning) + return null; + return delGetWidgetTypeFromName(typeName); + } void updateCrowDebuggerState (string errorMsg = null) { ErrorMessage = errorMsg; ServiceIsInError = errorMsg != null; NotifyValueChanged ("ServiceErrorMessage", (object)ErrorMessage); NotifyValueChanged ("ServiceIsInError", ServiceIsInError); NotifyValueChanged ("CrowAssemblyName", (object)CrowAssemblyName); + NotifyValueChanged ("DesignModeEnabled", DesignModeEnabled); } #region DesignInterface callbacks @@ -272,6 +300,8 @@ namespace Crow #endregion static string defaultCrowAssemblyLocation => System.IO.Path.Combine (System.IO.Path.GetDirectoryName (Assembly.GetEntryAssembly().Location), "Crow.dll"); + + #region service start/stop public override void Start() { if (CurrentState == Status.Running) @@ -314,8 +344,12 @@ namespace Crow Recording = false; DebugLogIsEnabled = false; + dbgIFace = null; + crowAssembly = null; crowLoadCtx = null; CurrentState = Status.Stopped; + + updateCrowDebuggerState(); } public override void Pause() { @@ -326,17 +360,7 @@ namespace Crow base.onStateChange(previousState, newState); CMDRefresh.CanExecute = IsRunning; } - - public Project ActiveSolution { - get => activeSolution; - set { - //CERoslynPlugin.SolutionProject sol = value as CERoslynPlugin.SolutionProject; - if (activeSolution == value) - return; - activeSolution = value; - NotifyValueChanged (activeSolution); - } - } + #endregion bool updateCrowDesignAssemblyLocation() { if (!File.Exists (CrowDbgAssemblyLocation)) { @@ -344,10 +368,8 @@ namespace Crow updateCrowDebuggerState($"Crow.dll for debugging file not found"); return false; } - - if (crowAssembly != null) - crowLoadCtx.Unload(); - + + crowLoadCtx = new AssemblyLoadContext("CrowDebuggerLoadContext"); crowAssembly = crowLoadCtx.LoadFromAssemblyPath (CrowDbgAssemblyLocation); Type debuggerType = crowAssembly.GetType("Crow.DbgLogger"); @@ -370,13 +392,16 @@ namespace Crow delResize = (Action)Delegate.CreateDelegate(typeof(Action), dbgIFace, dbgIfaceType.GetMethod("Resize")); - delMouseMove = (Func)Delegate.CreateDelegate(typeof(Func), - dbgIFace, dbgIfaceType.GetMethod("OnMouseMove")); + delGetWidgetTypeFromName = (Func)Delegate.CreateDelegate(typeof(Func), + dbgIFace, dbgIfaceType.GetMethod("GetWidgetTypeFromName")); + + delMouseWheelChanged = (Func)Delegate.CreateDelegate(typeof(Func), dbgIFace, dbgIfaceType.GetMethod("OnMouseWheelChanged")); - + delMouseMove = (Func)Delegate.CreateDelegate(typeof(Func), + dbgIFace, dbgIfaceType.GetMethod("OnMouseMove")); delMouseDown = (Func)Delegate.CreateDelegate(typeof(Func), dbgIFace, dbgIfaceType.GetMethod("OnMouseButtonDown")); @@ -396,6 +421,8 @@ namespace Crow delSetSource = (Action)Delegate.CreateDelegate(typeof(Action), dbgIFace, dbgIfaceType.GetProperty("Source").GetSetMethod()); delReloadIml = (Action)Delegate.CreateDelegate(typeof(Action), dbgIFace, dbgIfaceType.GetMethod("ReloadIml")); + delLockRenderMutex = (Action)Delegate.CreateDelegate(typeof(Action), dbgIFace, dbgIfaceType.GetMethod("LockRenderMutex")); + delUnlockRenderMutex = (Action)Delegate.CreateDelegate(typeof(Action), dbgIFace, dbgIfaceType.GetMethod("UnlockRenderMutex")); /*delGetZoomFactor = (Func)Delegate.CreateDelegate(typeof(Func), dbgIFace, dbgIfaceType.GetProperty("ZoomFactor").GetGetMethod()); @@ -419,6 +446,10 @@ namespace Crow fiDbgIFace_MaxLayoutingTries.SetValue (null, MaxLayoutingTries); fiDbgIFace_MaxDiscardCount.SetValue (null, MaxDiscardCount); + //DESIGN_MODE only + Type widgetType = crowAssembly.GetType("Crow.Widget"); + fiWidget_design_id = widgetType.GetField("design_id"); + return true; } @@ -431,9 +462,32 @@ namespace Crow NotifyValueChanged(value); } } + public Project ActiveSolution { + get => activeSolution; + set { + //CERoslynPlugin.SolutionProject sol = value as CERoslynPlugin.SolutionProject; + if (activeSolution == value) + return; + activeSolution = value; + NotifyValueChanged (activeSolution); + } + } + + #region Additional crow Assemblies + string selectedCrowAssembly = null; //assemblies with crow resources in order of loading IList crowAssemblies = new ObservableList (); public IList CrowAssemblies => crowAssemblies; + public string SelectedCrowAssembly { + get => selectedCrowAssembly; + set { + if (value == selectedCrowAssembly) + return; + selectedCrowAssembly = value; + CMDOptions_RemoveCrowAssembly.CanExecute = !string.IsNullOrEmpty(selectedCrowAssembly); + NotifyValueChanged(selectedCrowAssembly); + } + } void saveCrowAssemblies () { if (crowAssemblies.Count > 0) Configuration.Global.Set ("CrowAssemblies", crowAssemblies.Aggregate ((a, b)=> $"{a};{b}")); @@ -445,9 +499,10 @@ namespace Crow if (!Configuration.Global.TryGet ("CrowAssemblies", out string assemblies)) return; foreach (string a in assemblies.Split (';')) - crowAssemblies.Add (a); + if (!string.IsNullOrEmpty(a)) + crowAssemblies.Add (a); } - + #endregion #region Mouse & Keyboard Point mouseScreenPos;//absolute on screen position. @@ -500,7 +555,9 @@ namespace Crow } catch (System.Exception ex) { - Log(LogType.Error, $"[Error][DebugIFace mouse move]{ex}"); + //Log(LogType.Error, $"[Error][DebugIFace mouse move]{ex}"); + Debug.WriteLine(ex.Message); + Debug.WriteLine(ex.StackTrace); } } } diff --git a/plugins/CECrowPlugin/src/DebugInterface.cs b/plugins/CECrowPlugin/src/DebugInterface.cs index 2f5ba94..fd495a8 100644 --- a/plugins/CECrowPlugin/src/DebugInterface.cs +++ b/plugins/CECrowPlugin/src/DebugInterface.cs @@ -11,6 +11,9 @@ using System.Linq; using Crow; using Drawing2D; using IML = Crow.IML; +using System.Diagnostics; +using Crow.IML; +using System.Runtime.Loader; namespace CECrowPlugin { @@ -34,22 +37,19 @@ namespace CECrowPlugin public override void Run() { initBackend (); - Init(); + try { + Init(); + } catch (Exception e) { + Debug.WriteLine(e.Message); + Debug.WriteLine(e.StackTrace); + } + Thread t = new Thread (interfaceThread) { IsBackground = true }; t.Start (); } public bool Terminate; - string source; - Action delRegisterForRepaint;//call RegisterForRepaint in the container widget (DebugInterfaceWidget) - Action delCrowServiceSetCurrentException; - - delegate void GetScreenCoordinateDelegateType(out int x, out int y); - GetScreenCoordinateDelegateType delCrowServiceGetScreenCoordinate; - Func> delCrowServiceGetStyling; - Func delCrowServiceGetStreamFromPath; - void interfaceThread () { while (!Terminate) { try @@ -83,12 +83,22 @@ namespace CECrowPlugin } /*if (IsDirty) - delRegisterForRepaint(); */ + delRegisterForRepaint();*/ Thread.Sleep (UPDATE_INTERVAL); } Dispose(); } + string source; + //Action delRegisterForRepaint;//call RegisterForRepaint in the container widget (DebugInterfaceWidget) + Action delCrowServiceSetCurrentException; + + delegate void GetScreenCoordinateDelegateType(out int x, out int y); + GetScreenCoordinateDelegateType delCrowServiceGetScreenCoordinate; + Func> delCrowServiceGetStyling; + Func delCrowServiceGetStreamFromPath; + + public void RegisterDebugInterfaceCallback (object crowService){ Type t = crowService.GetType(); //delRegisterForRepaint = (Action)Delegate.CreateDelegate(typeof(Action), w, t.GetMethod("RegisterForRepaint")); @@ -131,6 +141,7 @@ namespace CECrowPlugin } } } + void resetInterface () { ClearInterface(); initDictionaries(); @@ -151,7 +162,7 @@ namespace CECrowPlugin public void Resize (int width, int height) { ProcessResize (new Rectangle(0, 0, width, height)); } - /*public override void ProcessResize(Rectangle bounds) { + /*public override void ProcessResize(Rectangle bounds) { lock (UpdateMutex) { clientRectangle = bounds.Size; @@ -163,7 +174,18 @@ namespace CECrowPlugin RegisterClip (clientRectangle); } }*/ - public override void ForceMousePosition() + public override Widget HoverWidget { + get => base.HoverWidget; + set { + base.HoverWidget = value; + } + } + public override bool OnMouseMove(int x, int y) + { + return base.OnMouseMove(x, y); + } + + public override void ForceMousePosition() { delCrowServiceGetScreenCoordinate(out int x, out int y); Glfw.Glfw3.SetCursorPosition (WindowHandle, x, y); @@ -187,8 +209,8 @@ namespace CECrowPlugin public override Type GetWidgetTypeFromName (string typeName){ if (knownCrowWidgetTypes.ContainsKey (typeName)) return knownCrowWidgetTypes [typeName]; - System.Runtime.Loader.AssemblyLoadContext dbgLoadCtx = - System.Runtime.Loader.AssemblyLoadContext.All.FirstOrDefault (ctx=>ctx.Name == "CrowDebuggerLoadContext"); + AssemblyLoadContext dbgLoadCtx = + AssemblyLoadContext.All.FirstOrDefault (ctx=>ctx.Name == "CrowDebuggerLoadContext"); foreach (Assembly a in dbgLoadCtx.Assemblies) { try { foreach (Type expT in a.GetExportedTypes ()) { @@ -203,5 +225,52 @@ namespace CECrowPlugin } return null; } + public override MethodInfo SearchExtMethod (Type t, string methodName) { + string key = t.Name + "." + methodName; + if (knownExtMethods.ContainsKey (key)) + return knownExtMethods [key]; + + Debug.WriteLine ($"[CECrowPlugin] search extension method: {t};{methodName} => key={key}"); + + MethodInfo mi = null; + AssemblyLoadContext dbgLoadCtx = + AssemblyLoadContext.All.FirstOrDefault (ctx=>ctx.Name == "CrowDebuggerLoadContext"); + foreach (Assembly a in dbgLoadCtx.Assemblies) { + try { + if (CompilerServices.TryGetExtensionMethods (a, t, methodName, out mi)) { + break; + } + } catch (Exception ex) { + Console.WriteLine ($"[CECrowPlugin]Error: SearchExtMethod failed for {t};{methodName} => key={key}"); + } + } + + if (mi == null) { + Debug.WriteLine ($"[CECrowPlugin] Extension method not found: {t};{methodName} => key={key}"); + return null; + } + + knownExtMethods.Add (key, mi); + return mi; + } + public Type GetTypeFromName (string typeName) { + AssemblyLoadContext dbgLoadCtx = + AssemblyLoadContext.All.FirstOrDefault (ctx=>ctx.Name == "CrowDebuggerLoadContext"); + foreach (Assembly a in dbgLoadCtx.Assemblies) { + try { + foreach (Type expT in a.GetExportedTypes ()) { + if (string.Equals(expT.Name,typeName,StringComparison.Ordinal)) + return expT; + } + } catch (Exception ex) { + Console.WriteLine ($"[CECrowPlugin]Error: GetWidgetTypeFromName failed for {typeName} in {a}.\n{ex}"); + } + } + return null; + } + + + public void LockRenderMutex() => Monitor.Enter(this.UpdateMutex); + public void UnlockRenderMutex() => Monitor.Exit(this.UpdateMutex); } } \ No newline at end of file diff --git a/plugins/CECrowPlugin/src/DebugInterfaceWidget.cs b/plugins/CECrowPlugin/src/DebugInterfaceWidget.cs index 7b96840..c69f166 100644 --- a/plugins/CECrowPlugin/src/DebugInterfaceWidget.cs +++ b/plugins/CECrowPlugin/src/DebugInterfaceWidget.cs @@ -130,7 +130,7 @@ namespace Crow new Command("Load from file", () => loadLogFromDebugLogFilePath ()) );*/ public CommandGroup WindowCommands => new CommandGroup ( - CMDRefresh, CMDZoomIn, CMDZoomOut, + CMDRefresh, //CMDZoomIn, CMDZoomOut, crowIFaceService.CMDStartRecording, crowIFaceService.CMDStopRecording, crowIFaceService.CMDOpenConfig, @@ -158,14 +158,16 @@ namespace Crow public override bool Paint(IContext ctx) { - return base.Paint(ctx); + crowIFaceService.LockRenderMutex(); + try { + return base.Paint(ctx); + } finally { + crowIFaceService.UnlockRenderMutex(); + } } protected override void RecreateCache() { - //bmp?.Dispose (); - if (crowIFaceService != null && crowIFaceService.IsRunning) { - crowIFaceService.Resize (Slot.Width, Slot.Height); bmp = crowIFaceService.MainSurface; } else base.RecreateCache (); @@ -174,17 +176,33 @@ namespace Crow } protected override void UpdateCache(IContext ctx) { - if (bmp != null) { + if (crowIFaceService != null && crowIFaceService.IsRunning && bmp != null) { + crowIFaceService.LockRenderMutex(); paintCache (ctx, Slot + Parent.ClientRectangle.Position); - crowIFaceService?.ResetDirtyState (); + crowIFaceService.UnlockRenderMutex(); + crowIFaceService.ResetDirtyState (); + } + + } + public override void OnLayoutChanges (LayoutingType layoutType) + { + base.OnLayoutChanges (layoutType); + switch (layoutType) { + case LayoutingType.Width: + //DesignWidth = Slot.Width * 100 / zoom; + crowIFaceService.Resize (Slot.Width, Slot.Height); + break; + case LayoutingType.Height: + //DesignHeight = Slot.Height * 100 / zoom; + crowIFaceService.Resize (Slot.Width, Slot.Height); + break; } } - protected override void Dispose(bool disposing) { CMDRefresh?.Dispose (); - crowIFaceService?.Stop (); + //crowIFaceService?.Stop (); base.Dispose(disposing); } } diff --git a/plugins/CECrowPlugin/src/Parsing/IML/ImlDocument.cs b/plugins/CECrowPlugin/src/Parsing/IML/ImlDocument.cs index 290bf68..bca46b4 100644 --- a/plugins/CECrowPlugin/src/Parsing/IML/ImlDocument.cs +++ b/plugins/CECrowPlugin/src/Parsing/IML/ImlDocument.cs @@ -14,6 +14,7 @@ using static CrowEditBase.CrowEditBase; using CrowEdit.Xml; using Drawing2D; +using System.Diagnostics; namespace CECrowPlugin { @@ -32,20 +33,27 @@ namespace CECrowPlugin IEnumerable getAllCrowTypeMembers (string crowTypeName) { - Type crowType = IML.Instantiator.GetWidgetTypeFromName (crowTypeName); + Type crowType = App.GetService()?.GetWidgetTypeFromeName(crowTypeName); return crowType?.GetMembers (BindingFlags.Public | BindingFlags.Instance). Where (m=>((m is PropertyInfo pi && pi.CanWrite) || (m is EventInfo)) && m.GetCustomAttribute() == null); } - MemberInfo getCrowTypeMember (string crowTypeName, string memberName) { - Type crowType = IML.Instantiator.GetWidgetTypeFromName (crowTypeName); + /*MemberInfo getCrowTypeMember (string crowTypeName, string memberName) { + Type crowType = App.GetService()?.GetWidgetTypeFromeName(crowTypeName); return crowType.GetMember (memberName, BindingFlags.Public | BindingFlags.Instance).FirstOrDefault (); - } + }*/ protected override IEnumerable getElementNameSuggestions(string curName, TextChange change) { - IEnumerable widgetTypes = typeof (Widget).Assembly.GetExportedTypes ().Where(t=> - typeof(Widget).IsAssignableFrom (t) && !t.IsAbstract); + CrowService srv = App.GetService(); + if (srv == null || !srv.IsRunning) + return null; + Type widgetType = srv.GetWidgetTypeFromeName("Widget"); + if (widgetType == null) + return null; + + IEnumerable widgetTypes = widgetType.Assembly.GetExportedTypes ().Where(t=> + widgetType.IsAssignableFrom (t) && !t.IsAbstract); int curNameLength = 0; if (!string.IsNullOrEmpty(curName)) { widgetTypes = widgetTypes.Where(t=>t.Name.StartsWith(curName, StringComparison.OrdinalIgnoreCase)); @@ -59,15 +67,20 @@ namespace CECrowPlugin protected override IEnumerable getAttributeNameSuggestions(string eltName, string curName, TextChange change) { int endPosOffset = change.HasNewText ? -1 : 0; var members = getAllCrowTypeMembers(eltName); + if (members == null) + return null; if (!string.IsNullOrEmpty(curName)) members = members.Where(m => - m.Name.StartsWith (curName, StringComparison.OrdinalIgnoreCase)); - return members.Select(m + m.Name.StartsWith (curName, StringComparison.OrdinalIgnoreCase)); + return members?.Select(m => new MemberInfoSuggestion(m, new TextChange(change.Start, change.Length, m.Name + change.ChangedText), endPosOffset)); } protected override IEnumerable getAttributeValueSuggestions(string eltName, string attribName, string attribValue, TextChange change) { - MemberInfo mi = getAllCrowTypeMembers(eltName).Where(m=>m.Name.Equals(attribName, StringComparison.Ordinal)).FirstOrDefault(); + CrowService srv = App.GetService(); + if (srv == null || !srv.IsRunning) + return null; + MemberInfo mi = getAllCrowTypeMembers(eltName)?.Where(m=>m.Name.Equals(attribName, StringComparison.Ordinal)).FirstOrDefault(); if (mi is PropertyInfo pi) { if (pi.Name == "Style") return App.Styling.Keys @@ -84,12 +97,12 @@ namespace CECrowPlugin Where (s => s.StartsWith (attribValue, StringComparison.OrdinalIgnoreCase)) .Select(s=>new Suggestion(s, new TextChange(change.Start, change.Length, s + change.ChangedText))); - if (pi.PropertyType == typeof (Measure)) + if (pi.PropertyType.Name == "Measure") return (new string[] {"Stretched", "Fit"}). Where (s => s.StartsWith (attribValue, StringComparison.OrdinalIgnoreCase)) .Select(s=>new Suggestion(s, new TextChange(change.Start, change.Length, s + change.ChangedText))); - if (pi.PropertyType == typeof (Fill)) + if (pi.PropertyType.Name == "Fill") return EnumsNET.Enums.GetValues () .Where (s => s.ToString().StartsWith (attribValue, StringComparison.OrdinalIgnoreCase)) .Select(c=>new ColorSuggestion(c, diff --git a/plugins/CECrowPlugin/ui/dbg.style b/plugins/CECrowPlugin/ui/dbg.style index 93edb9e..2cd82c1 100644 --- a/plugins/CECrowPlugin/ui/dbg.style +++ b/plugins/CECrowPlugin/ui/dbg.style @@ -2,13 +2,7 @@ Template = "#CECrowPlugin.ui.Button.template"; Background = "Onyx"; } -CheckBox2 { - Template= "#CECrowPlugin.ui.CheckBox2.imlt"; - Background = "Jet"; - Checked="{Background=MediumSeaGreen}"; - Unchecked = "{Background=Jet}"; - Width = "200"; -} + smallLabCaption { Font="mono, 8"; Foreground="Grey"; diff --git a/plugins/CECrowPlugin/ui/winConfiguration.crow b/plugins/CECrowPlugin/ui/winConfiguration.crow index 9d4e7fa..4f8c87b 100644 --- a/plugins/CECrowPlugin/ui/winConfiguration.crow +++ b/plugins/CECrowPlugin/ui/winConfiguration.crow @@ -22,13 +22,18 @@