From 333dc91b48129531a6ff785ce2ae881ac8ca07d1 Mon Sep 17 00:00:00 2001 From: Chayan Deb Date: Fri, 14 Mar 2025 20:02:49 +0530 Subject: [PATCH] [ANSI-C Compatibilty Update + Remove Redundant TCL Menu Entries]: Made changes to conform to ANSI-C standard and removed some redundant code in 'src/xschem.tcl'. --- src/callback.c | 11 +++++++++-- src/xschem.tcl | 7 +------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/callback.c b/src/callback.c index a9158ee3..78b00491 100644 --- a/src/callback.c +++ b/src/callback.c @@ -2607,7 +2607,11 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m { char str[PATH_MAX + 100]; switch (key) { - case '0' ... '4': + case '0': + case '1': + case '2': + case '3': + case '4': if(state == 0) { /* toggle pin logic level */ if(xctx->semaphore >= 2) break; if(key == '4') logic_set(-1, 1, NULL); @@ -2638,7 +2642,10 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m } /* /20110112 */ break; - case '6' ... '9': + case '6': + case '7': + case '8': + case '9': if(state==ControlMask) { /* choose layer */ char n[30]; xctx->rectcolor = (int)key - '0'+4; diff --git a/src/xschem.tcl b/src/xschem.tcl index 122a0d75..51c4575c 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -8736,17 +8736,12 @@ proc build_widgets { {topwin {} } } { -variable intuitive_interface -selectcolor $selectcolor \ -command {xschem set intuitive_interface $intuitive_interface} - $topwin.menubar.option add checkbutton -label "Draw crosshair" \ - -variable draw_crosshair -selectcolor $selectcolor -accelerator {Alt-X} - $topwin.menubar.option add checkbutton -label "Draw persistent snap cursor" -variable snap_cursor \ - -selectcolor $selectcolor -accelerator {Alt-Z} - $topwin.menubar.option add cascade -label "Crosshair" \ -menu $topwin.menubar.option.crosshair menu $topwin.menubar.option.crosshair -tearoff 0 $topwin.menubar.option.crosshair add checkbutton -label "Draw snap cursor" \ - -variable snap_cursor -selectcolor $selectcolor + -variable snap_cursor -selectcolor $selectcolor -accelerator {Alt-Z} $topwin.menubar.option.crosshair add checkbutton -label "Draw crosshair" \ -variable draw_crosshair -selectcolor $selectcolor -accelerator {Alt-X} $topwin.menubar.option.crosshair add command -label "Crosshair size" \