From 1015a9d71ec76d57fff0134a678b4d4144c655f1 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Tue, 21 Jan 2025 16:50:31 +0100 Subject: [PATCH] added command `xschem set crosshair_layer` to change layer used for crosshair drawing --- doc/xschem_man/developer_info.html | 1 + src/scheduler.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/doc/xschem_man/developer_info.html b/doc/xschem_man/developer_info.html index cf43eea3..3d64a8ee 100644 --- a/doc/xschem_man/developer_info.html +++ b/doc/xschem_man/developer_info.html @@ -1438,6 +1438,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
  • cadgrid set cad grid (default: 20)
  • cadsnap set mouse snap (default: 10)
  • color_ps set color psoscript (1 or 0)
  • +
  • crosshair_layer set layer for mouse crosshair
  • constr_mv set constrained move (1=horiz, 2=vert, 0=none)
  • cursor1_x set graph cursor1 position
  • cursor2_x set graph cursor2 position
  • diff --git a/src/scheduler.c b/src/scheduler.c index 08d6c033..ffb1ff47 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -5081,8 +5081,16 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg else if(!strcmp(argv[2], "color_ps")) { /* set color psoscript (1 or 0) */ color_ps=atoi(argv[3]); } + else if(!strcmp(argv[2], "crosshair_layer")) { /* set layer for mouse crosshair */ + int c = atoi(argv[3]); + tclsetintvar("crosshair_layer", c); + xctx->crosshair_layer = c; + if(xctx->crosshair_layer < 0 ) xctx->crosshair_layer = 2; + if(xctx->crosshair_layer >= cadlayers ) xctx->crosshair_layer = 2; + } else if(!strcmp(argv[2], "constr_mv")) { /* set constrained move (1=horiz, 2=vert, 0=none) */ xctx->constr_mv = atoi(argv[3]); + if(xctx->constr_mv < 0 || xctx->constr_mv > 2) xctx->constr_mv = 0; } else if(!strcmp(argv[2], "cursor1_x")) { /* set graph cursor1 position */ xctx->graph_cursor1_x = atof_spice(argv[3]);