From e5015488f3db454cde7d979da19f16ac95de9b84 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sat, 7 Sep 2024 10:11:52 +0200 Subject: [PATCH] double clicking in the center of a graph will now bring up the graph edit attributes dialog box even if no raw file is loaded --- src/callback.c | 8 ++++---- src/xschem.tcl | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/callback.c b/src/callback.c index a20e1c82..c5c9d912 100644 --- a/src/callback.c +++ b/src/callback.c @@ -36,7 +36,7 @@ static int waves_selected(int event, KeySym key, int state, int button) rstate = state; /* rstate does not have ShiftMask bit, so easier to test for KeyPress events */ rstate &= ~ShiftMask; /* don't use ShiftMask, identifying characters is sifficient */ if(xctx->ui_state & excl) skip = 1; - else if(sch_waves_loaded() < 0 ) skip = 1; + else if(event != -3 && sch_waves_loaded() < 0 ) skip = 1; else if(SET_MODMASK) skip = 1; else if(event == MotionNotify && (state & Button2Mask)) skip = 1; else if(event == MotionNotify && (state & Button1Mask) && (state & ShiftMask)) skip = 1; @@ -357,7 +357,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int int track_dset = -2; /* used to find dataset of closest wave to mouse if 't' is pressed */ xRect *r = NULL; - if(!xctx->raw) return 0; + if(event != -3 && !xctx->raw) return 0; rstate = state; /* rstate does not have ShiftMask bit, so easier to test for KeyPress events */ rstate &= ~ShiftMask; /* don't use ShiftMask, identifying characters is sifficient */ @@ -584,7 +584,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int } else { need_all_redraw = 1; } - } else { + } else if(xctx->raw) { xctx->raw->annot_p = -1; xctx->raw->annot_sweep_idx = -1; /* need_all_redraw = 1; */ @@ -688,7 +688,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int dbg(1, "graph_master=%d\n", xctx->graph_master); /* parameters for absolute positioning by mouse drag in bottom graph area */ - if( event == MotionNotify && (state & Button1Mask) && xctx->graph_bottom ) { + if( xctx->raw && event == MotionNotify && (state & Button1Mask) && xctx->graph_bottom ) { int idx; int dset; double wwx1, wwx2, pp, delta, ccx, ddx; diff --git a/src/xschem.tcl b/src/xschem.tcl index e236bea7..80e54707 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -2565,8 +2565,8 @@ proc graph_update_nodelist {} { proc graph_fill_listbox {} { global graph_selected + if { [xschem raw loaded] == -1 } return set retval [.graphdialog.center.left.search get] - set autoload [uplevel #0 {subst [xschem getprop rect 2 $graph_selected autoload 2]}] set rawfile [uplevel #0 {subst [xschem getprop rect 2 $graph_selected rawfile 2]}] set sim_type [uplevel #0 {subst [xschem getprop rect 2 $graph_selected sim_type 2]}] @@ -2728,7 +2728,6 @@ proc graph_edit_properties {n} { pack .graphdialog.top3 -side top -fill x pack .graphdialog.center -side top -fill both -expand yes pack .graphdialog.bottom -side top -fill x - # center-left frame label .graphdialog.center.left.labsearch -text Search: entry .graphdialog.center.left.search -width 10