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

This commit is contained in:
stefan schippers 2024-09-07 10:11:52 +02:00
parent a329b996d6
commit e5015488f3
2 changed files with 5 additions and 6 deletions

View File

@ -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;

View File

@ -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