HoverWidget = value;
}
}
-
+ public virtual void ForceMousePosition () {
+ Glfw3.SetCursorPosition (hWin, MousePosition.X, MousePosition.Y);
+ }
/// <summary>Processes mouse move events from the root container, this function
/// should be called by the host on mouse move event to forward events to crow interfaces</summary>
stickedWidget = null;
stickyMouseDelta = default;
} else {
- Glfw3.SetCursorPosition (hWin, MousePosition.X, MousePosition.Y);
+ ForceMousePosition ();
DbgLogger.EndEvent (DbgEvtType.MouseMove);
return true;
}
string source;
Action delRegisterForRepaint;//call RegisterForRepaint in the container widget (DebugInterfaceWidget)
Action<Exception> delSetCurrentException;
+ Func<object> delGetScreenCoordinate;
void interfaceThread () {
while (!Terminate) {
Type t = w.GetType();
delRegisterForRepaint = (Action)Delegate.CreateDelegate(typeof(Action), w, t.GetMethod("RegisterForRepaint"));
delSetCurrentException = (Action<Exception>)Delegate.CreateDelegate(typeof(Action<Exception>), w, t.GetProperty("CurrentException").GetSetMethod());
+ delGetScreenCoordinate = (Func<object>)Delegate.CreateDelegate(typeof(Func<object>), w, t.GetMethod("GetScreenCoordinates"));
}
public void ResetDirtyState () {
IsDirty = false;
g.RegisterForLayouting (LayoutingType.All);
RegisterClip (clientRectangle);
}
- }
+ }
+ public override void ForceMousePosition()
+ {
+ Point p = (Point)delGetScreenCoordinate();
+ Glfw.Glfw3.SetCursorPosition (WindowHandle, p.X + MousePosition.X, p.Y + MousePosition.Y);
+ }
}
}
\ No newline at end of file
public bool CrowDebuggerOK => initialized;
public bool CrowDebuggerNOK => !initialized;
- void notifyCrowDebuggerState () {
+ public string CrowDebuggerErrorMessage = "";
+ void notifyCrowDebuggerState (string errorMsg = null) {
NotifyValueChanged("CrowDebuggerOK", CrowDebuggerOK);
NotifyValueChanged("CrowDebuggerNOK", CrowDebuggerNOK);
+ CrowDebuggerErrorMessage = errorMsg;
+ NotifyValueChanged("CrowDebuggerErrorMessage", CrowDebuggerErrorMessage);
}
void tryStartDebugInterface () {
if (initialized)
return;
if (!File.Exists (crowDbgAssemblyLocation)) {
- notifyCrowDebuggerState();
+ notifyCrowDebuggerState($"Crow.dll for debugging file not found");
return;
}
Type debuggerType = crowAssembly.GetType("Crow.DbgLogger");
if (!(bool)debuggerType.GetField("IsEnabled").GetValue(null)) {
- notifyCrowDebuggerState();
+ notifyCrowDebuggerState("Crow.dll must be compiled with CrowDebugLogEnabled='True'");
return;
}
dbgIfaceType.GetMethod("Run").Invoke (dbgIFace, null);
initialized = true;
+ notifyCrowDebuggerState();
//Console.WriteLine($"DbgIFace: LoadCtx:{AssemblyLoadContext.GetLoadContext (dbgIFace.GetType().Assembly).Name})");
//}
dla.Events = events;
}
}
+
+ public virtual object GetScreenCoordinates () => ScreenCoordinates(Slot).TopLeft;
}
}
\ No newline at end of file
public static CommandGroup GetCommands (this System.IO.DirectoryInfo di) =>
new CommandGroup(
- new Command ("Set as root", ()=> {Program.CurrentProgramInstance.CurrentDir = di.FullName;}));
+ new Command ("Set as root", ()=> {Program.CurrentProgramInstance.CurrentDir = di.FullName;})
+ );
public static CommandGroup GetCommands (this System.IO.FileInfo fi) =>
new CommandGroup(
new Command ("Delete", (sender0) => {
<Widget Width="5" Height="5" Background="SeaGreen" IsVisible="{../../../../dbgIfaceWidget.HasFocus}"/>
<Widget Width="5" Height="5" Background="Yellow" IsVisible="{../../../../dbgIfaceWidget.IsHover}"/>
<TextBox Text="{²CrowDbgAssemblyLocation}" Margin="2"/>
- </HorizontalStack>
+ </HorizontalStack>
+ <Label Background="Red" Foreground="White" Margin="5" Width="Stretched" Text="{../../../dbgIfaceWidget.CrowDebuggerErrorMessage}"
+ IsVisible="{../../../dbgIfaceWidget.CrowDebuggerNOK}"/>
<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 file:" Fit="true"/>