add accelerator Shift-B for edit schematic header/license

This commit is contained in:
Stefan Schippers 2023-01-02 19:34:27 +01:00
parent 329d472d56
commit 479b8ef6e9
3 changed files with 17 additions and 8 deletions

View File

@ -2378,6 +2378,10 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
}
break;
}
if(key=='B' && state==ShiftMask) /* edit schematic header/license */
{
tcleval("update_schematic_header");
}
if(key=='b' && state==0) /* merge schematic */
{
if(xctx->semaphore >= 2) break;

View File

@ -835,6 +835,15 @@ proc ngspice::get_voltage {n} {
return $res
}
proc update_schematic_header {} {
global retval rcode
set retval [xschem get header_text]
text_line {Header/License text:} 0
if { $rcode ne {}} {
xschem set header_text $retval
}
}
proc ngspice::get_node {n} {
global graph_raw_level
set path [string range [xschem get sch_path] 1 end]
@ -5861,13 +5870,7 @@ proc build_widgets { {topwin {} } } {
$topwin.menubar.prop.menu add command -label "Edit with editor" -command "xschem edit_vi_prop" -accelerator Shift+Q
$topwin.menubar.prop.menu add command -label "View" -command "xschem view_prop" -accelerator Ctrl+Shift+Q
$topwin.menubar.prop.menu add command -label "Edit Header/License text" \
-command {
set retval [xschem get header_text]
text_line {Header/License text:} 0
if { $rcode ne {}} {
xschem set header_text $retval
}
}
-command { update_schematic_header } -accelerator Shift+B
$topwin.menubar.prop.menu add command -background red -label "Edit file (danger!)" \
-command "xschem edit_file" -accelerator Alt+Q
$topwin.menubar.sym.menu add radiobutton -label "Show Symbols" \

View File

@ -1,5 +1,7 @@
v {xschem version=3.1.0 file_version=1.2
}
Solar panel simulation.
A Photovoltaic model has been created for this (pv_ngspice.sym)
Stefan.}
G {}
K {}
V {}