Alt-b command toggles bounding box view: 0: view all, 1: bbox view for subcircuits, 2: bbox view for all symbols.

This commit is contained in:
Stefan Schippers 2020-09-25 00:23:34 +02:00
parent c627f21057
commit 5e85a87545
3 changed files with 12 additions and 6 deletions

View File

@ -1330,9 +1330,9 @@ int callback(int event, int mx, int my, KeySym key,
if(key=='b' && state==Mod1Mask) /* hide/show instance details */
{
if(semaphore >= 2) break;
hide_symbols = !hide_symbols;
if(hide_symbols) tclsetvar("hide_symbols", "1");
else tclsetvar("hide_symbols", "0");
hide_symbols++;
if(hide_symbols == 3) hide_symbols = 0;
tclsetvar("hide_symbols", hide_symbols == 2 ? "2" : hide_symbols == 1 ? "1" : "0");
draw();
break;
}

View File

@ -480,8 +480,10 @@ void draw_symbol(int what,int c, int n,int layer,int tmp_flip, int rot,
if(inst_ptr[n].ptr == -1) return;
if( (layer != PINLAYER && !enable_layer[layer]) ) return;
if(!has_x) return;
if(hide_symbols && (inst_ptr[n].ptr+instdef)->prop_ptr &&
!strcmp(get_tok_value( (inst_ptr[n].ptr+instdef)->prop_ptr, "type",0 ), "subcircuit") ) {
if(
(hide_symbols==1 && (inst_ptr[n].ptr+instdef)->prop_ptr &&
!strcmp(get_tok_value( (inst_ptr[n].ptr+instdef)->prop_ptr, "type",0 ), "subcircuit") ) ||
(hide_symbols == 2) ) {
hide = 1;
} else {
hide = 0;

View File

@ -3640,7 +3640,11 @@ font configure Underline-Font -underline true -size 24
.menubar.prop.menu add command -label "Edit with editor" -command "xschem edit_vi_prop" -accelerator Shift+Q
.menubar.prop.menu add command -label "View" -command "xschem view_prop" -accelerator Ctrl+Q
.menubar.prop.menu add command -background red -label "Edit file (danger!)" -command "xschem edit_file" -accelerator Alt+Q
.menubar.sym.menu add checkbutton -label "Show only instance Bounding boxes" -variable hide_symbols \
.menubar.sym.menu add radiobutton -label "Show Symbols" -variable hide_symbols -value 0 \
-command {xschem set hide_symbols $hide_symbols; xschem redraw} -accelerator Alt+B
.menubar.sym.menu add radiobutton -label "Show instance Bounding boxes for subcircuit symbols" -variable hide_symbols -value 1 \
-command {xschem set hide_symbols $hide_symbols; xschem redraw} -accelerator Alt+B
.menubar.sym.menu add radiobutton -label "Show instance Bounding boxes for all symbols" -variable hide_symbols -value 2 \
-command {xschem set hide_symbols $hide_symbols; xschem redraw} -accelerator Alt+B
.menubar.sym.menu add command -label "Make symbol from schematic" -command "xschem make_symbol" -accelerator A
.menubar.sym.menu add command -label "Make schematic from symbol" -command "xschem make_sch" -accelerator Ctrl+L