public Command CMDOptions_SelectCrowAssemblyLocation, CMDOptions_AddCrowAssembly, CMDOptions_RemoveCrowAssembly;
public Command CMDOptions_SelectDebugLogDirectory;
public Command CMDViewPreview, CMDViewGraphicTree, CMDViewProperties;
+ public Command CMDEditMode, CMDRun;
public CommandGroup ViewCommands;
void initCommands ()
CMDViewProperties = new ActionCommand("Widget Properties", () => App.LoadWindow (ServiceWindowsPath[2], this), "#icons.property.svg");
ViewCommands = new CommandGroup("C.R.O.W.", "#icons.crow.svg" ,CMDViewPreview, CMDViewGraphicTree, CMDViewProperties);
+ CMDRun = new ActionCommand ("Run", () => EditMode = false, "#icons.presentation.svg", true);
+ CMDEditMode = new ActionCommand ("Edit mode", () => EditMode = true, "#icons.edit.svg", false);
+
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);
FieldInfo fiDbg_IncludedEvents, fiDbg_ConsoleOutput, fiDbgIFace_MaxLayoutingTries, fiDbgIFace_MaxDiscardCount, fiDbgIFace_Terminate;
+ FieldInfo fiDbgIFace_UPDATE_INTERVAL, fiDbgIFace_Edition;
FieldInfo fiITor_NextInstantiatorID;
#endregion
public bool HasVkvgBackend { get; private set; }
+ public int CrowUpdateInterval {
+ get => (int)fiDbgIFace_UPDATE_INTERVAL.GetValue(null);
+ set {
+ if (CrowUpdateInterval == value)
+ return;
+ fiDbgIFace_UPDATE_INTERVAL.SetValue (null, value);
+ NotifyValueChanged (value);
+ }
+ }
public int RefreshRate {
get => Configuration.Global.Get<int> ("RefreshRate", 10);
set {
fiDbgIFace_MaxDiscardCount.SetValue (null, value);
}
}
+ public bool EditMode {
+ get => (bool)fiDbgIFace_Edition.GetValue(dbgIFace);
+ set {
+ if (EditMode == value)
+ return;
+ fiDbgIFace_Edition.SetValue(dbgIFace, value);
+ CMDEditMode.CanExecute = !value;
+ CMDRun.CanExecute = value;
+ NotifyValueChanged(value);
+ }
+ }
+
public double ZoomFactor {
get => Configuration.Global.Get<Double> ("CrowPreviewZoomFactor", 1.0);
set {
fiDbgIFace_Terminate = dbgIfaceType.GetField("Terminate");
fiDbgIFace_IsDirty = dbgIfaceType.GetField("IsDirty");
+ fiDbgIFace_Edition = dbgIfaceType.GetField("Edition");
+ fiDbgIFace_UPDATE_INTERVAL = dbgIfaceType.GetField("UPDATE_INTERVAL", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
fiDbgIFace_MaxLayoutingTries = dbgIfaceType.GetField("MaxLayoutingTries", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
fiDbgIFace_MaxDiscardCount = dbgIfaceType.GetField("MaxDiscardCount", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
if (CurrentState == Status.Running) {
try
{
- //e.Handled = delMouseDown (e.Button);
- CurrentWidget = HoverWidget;
+ if (EditMode)
+ CurrentWidget = HoverWidget;
+ else
+ e.Handled = delMouseDown (e.Button);
}
catch (System.Exception ex)
{
if (CurrentState == Status.Running) {
try
{
- e.Handled = true;//delMouseUp (e.Button);
+ if (EditMode)
+ e.Handled = true;
+ else
+ delMouseUp (e.Button);
}
catch (System.Exception ex)
{
if (CurrentState == Status.Running) {
try
{
- e.Handled = true;// delMouseWheelChanged (e.Delta);
+ if (EditMode)
+ e.Handled = true;
+ else
+ delMouseWheelChanged (e.Delta);
}
catch (System.Exception ex)
{
RegisterForGraphicUpdate ();
}
}, "#icons.zoom-out.svg");
- //CMDRun = new ToggleCommand(this,"Run",,)
-
Thread t = new Thread (backgroundThreadFunc);
t.IsBackground = true;
t.Start ();
}
~DebugInterfaceWidget() {
if (crowIFaceService != null)
- crowIFaceService.ValueChanged -= service_ValueChanged;
+ crowIFaceService.ValueChanged -= service_ValueChanged;
}
void service_ValueChanged(object instance, ValueChangeEventArgs e) {
if (e.MemberName == "CurrentWidget") {
ImlDocument document;
ForeignWidgetContainer currentWidget, hoverWidget;
- Command CMDRefresh, CMDZoomIn, CMDZoomOut, CMDRun;
+ Command CMDRefresh, CMDZoomIn, CMDZoomOut;
public CommandGroup WindowCommands => new CommandGroup (
+ crowIFaceService.CMDRun,
+ crowIFaceService.CMDEditMode,
CMDRefresh, //CMDZoomIn, CMDZoomOut,
crowIFaceService.CMDStartRecording,
crowIFaceService.CMDStopRecording,
if (crowIFaceService != null && crowIFaceService.IsRunning && bmp != null) {
//crowIFaceService.LockRenderMutex();
paintCache (ctx, Slot + Parent.ClientRectangle.Position);
- if (hoverWidget != null && hoverWidget != currentWidget) {
- //currentWidget.
- RectangleD r = hoverWidget.GetScreenCoordinate() + Slot.Position + Parent.ClientRectangle.Position;
- ctx.SetDash([1,3]);
- ctx.SetSource(Colors.Yellow);
- ctx.Rectangle(r, 1);
- ctx.SetDash([]);
- }
- if (currentWidget != null) {
- //currentWidget.
- RectangleD r = currentWidget.GetScreenCoordinate() + Slot.Position + Parent.ClientRectangle.Position;
- //ctx.ResetClip();
- //ctx.SetDash([2,3]);
- ctx.SetSource(Colors.White);
- ctx.Rectangle(r.Inflated(1), 1);
-// ctx.Stroke();
- //ctx.SetDash([0]);
- }
+ if (crowIFaceService.EditMode) {
+ if (hoverWidget != null && hoverWidget != currentWidget) {
+ //currentWidget.
+ RectangleD r = hoverWidget.GetScreenCoordinate() + Slot.Position + Parent.ClientRectangle.Position;
+ ctx.SetDash([1,3]);
+ ctx.SetSource(Colors.Yellow);
+ ctx.Rectangle(r, 1);
+ ctx.SetDash([]);
+ }
+ if (currentWidget != null) {
+ //currentWidget.
+ RectangleD r = currentWidget.GetScreenCoordinate() + Slot.Position + Parent.ClientRectangle.Position;
+ //ctx.ResetClip();
+ //ctx.SetDash([2,3]);
+ ctx.SetSource(Colors.White);
+ ctx.Rectangle(r.Inflated(1), 1);
+ // ctx.Stroke();
+ //ctx.SetDash([0]);
+ }
+ }
//crowIFaceService.UnlockRenderMutex();
crowIFaceService.ResetDirtyState ();
}