add Button3 drag for rectangle zoom, move ctx menu to Button3Release, updates in traversal and cellview

This commit is contained in:
stefan schippers 2024-12-29 19:35:49 +01:00
parent b68731481c
commit 0b4cedbf05
2 changed files with 26 additions and 11 deletions

View File

@ -1262,6 +1262,9 @@ static int end_place_move_copy_zoom()
{
if(xctx->ui_state & STARTZOOM) {
zoom_rectangle(END);
if( xctx->nl_x1 == xctx->nl_x2 && xctx->nl_y1 == xctx->nl_y2) {
return 0;
}
return 1;
}
else if(xctx->ui_state & STARTWIRE) {
@ -3729,9 +3732,16 @@ int rstate; /* (reduced state, without ShiftMask) */
sel = select_object(xctx->mousex, xctx->mousey, SELECTED, 0, NULL);
if(sel.type) select_connected_nets(0);
}
else if(button == Button3 && state == 0 && xctx->semaphore <2) {
context_menu_action(xctx->mousex_snap, xctx->mousey_snap);
/* moved to Button3 release */
/*
* else if(button == Button3 && state == 0 && xctx->semaphore <2) {
* context_menu_action(xctx->mousex_snap, xctx->mousey_snap);
* }
*/
else if(button == Button3 && state == 0 && xctx->semaphore < 2) {
zoom_rectangle(START);break;
}
/* Mouse wheel events */
else if(handle_mouse_wheel(event, mx, my, key, button, aux, state)) break;
/* Alt - Button1 click to unselect */
@ -3871,6 +3881,11 @@ int rstate; /* (reduced state, without ShiftMask) */
break;
}
if(state == Button3Mask && xctx->semaphore <2) {
if(!end_place_move_copy_zoom()) {
context_menu_action(xctx->mousex_snap, xctx->mousey_snap);
}
}
/* launcher, no intuitive interface */
if(!xctx->intuitive_interface && state == (Button1Mask | ControlMask) &&

View File

@ -1898,9 +1898,9 @@ proc traversal {{only_subckts {0}}} {
wm geometry .cv 800x200
frame .cv.top
label .cv.top.inst -text {INSTANCE} -width 20 -bg grey60 -anchor w -padx 4 -font $font
label .cv.top.sym -text {SYMBOL} -width 12 -bg grey60 -anchor w -padx 4 -font $font
label .cv.top.sch -text SCHEMATIC -width 20 -bg grey60 -anchor w -padx 4 -font $font
label .cv.top.inst -text {INSTANCE} -width 25 -bg grey60 -anchor w -padx 4 -font $font
label .cv.top.sym -text {SYMBOL} -width 10 -bg grey60 -anchor w -padx 4 -font $font
label .cv.top.sch -text SCHEMATIC -width 10 -bg grey60 -anchor w -padx 4 -font $font
label .cv.top.pad -text { } -bg grey60 -font $font
pack .cv.top.inst .cv.top.sym .cv.top.sch -side left -fill x -expand 1
pack .cv.top.pad -side left -fill x
@ -1946,7 +1946,7 @@ proc hier_traversal {{level 0} only_subckts} {
set type [xschem getprop symbol $symbol type]
set schematic [xschem get_sch_from_sym $i]
set sch_exists [expr {[file exists $schematic] ? {} : {**missing**}}]
set sch_tail [file tail $schematic]
set sch_tail [rel_sym_path $schematic]
set sch_rootname [file rootname [file tail $schematic]]
set inst_spice_sym_def [xschem getprop instance $i spice_sym_def]
set sym_spice_sym_def [xschem getprop instance $i cell::spice_sym_def]
@ -1965,12 +1965,12 @@ proc hier_traversal {{level 0} only_subckts} {
puts "building frame $sf.f$traversal_cnt"
frame $sf.f$traversal_cnt
pack $sf.f$traversal_cnt -side top -fill x
label $sf.f$traversal_cnt.i -text "[spaces $level]$schpath$instname" \
-width 20 -anchor w -padx 4 -borderwidth 1 \
label $sf.f$traversal_cnt.i -text "[spaces $level 2]$schpath$instname" \
-width 25 -anchor w -padx 4 -borderwidth 1 \
-relief sunken -pady 1 -bg grey80 -font $font
label $sf.f$traversal_cnt.l -text $symbol -width 12 -anchor w -padx 4 -borderwidth 1 \
label $sf.f$traversal_cnt.l -text $symbol -width 10 -anchor w -padx 4 -borderwidth 1 \
-relief sunken -pady 1 -bg grey80 -font $font
entry $sf.f$traversal_cnt.s -width 20 -borderwidth 1 -relief sunken -font $font
entry $sf.f$traversal_cnt.s -width 10 -borderwidth 1 -relief sunken -font $font
if {$type eq {subcircuit}} {
if {$inst_spice_sym_def ne {}} {
@ -1998,7 +1998,7 @@ proc hier_traversal {{level 0} only_subckts} {
bind $sf.f$traversal_cnt.s <KeyRelease> "traversal_conf_color %W $sch_tail"
}
pack $sf.f$traversal_cnt.i $sf.f$traversal_cnt.l $sf.f$traversal_cnt.s -side left -fill x -expand 1
pack $sf.f$traversal_cnt.bsch $sf.f$traversal_cnt.bsym -side left
pack $sf.f$traversal_cnt.bsym $sf.f$traversal_cnt.bsch -side left
set done_print 1
if {$type eq {subcircuit}} {