Place polygon bind key is now `p`, ctrl-w is now `Close current schematic`, while ctrl-q is `Quit xschem`. Reorganized File menu, added more orthogonal `Create new schematic/tab` removed some largely unused entries. Ctrl-w does not close the last window, just leaves it blank. Use ctrl-q to close xschem
This commit is contained in:
parent
57ea120a33
commit
e68ca0a0cc
|
|
@ -38,7 +38,6 @@ p{padding: 15px 30px 10px;}
|
|||
This list is available in XSCHEM in the <kbd>Help</kbd> menu
|
||||
</p>
|
||||
<pre class="code" style="height: 600px;">
|
||||
|
||||
XSCHEM MOUSE BINDINGS
|
||||
----------------------------------------------------------------------
|
||||
LeftButton Clear selection and select a graphic object
|
||||
|
|
@ -80,13 +79,14 @@ RightButton Context menu
|
|||
|
||||
Shift + RightButton Select object under the mouse and if label/pin
|
||||
select attached nets
|
||||
|
||||
|
||||
Ctrl + RightButton Select object under the mouse and if label/pin
|
||||
select attached nets up to net junctions
|
||||
|
||||
|
||||
LeftButton Double click Terminate Polygon placement
|
||||
Edit object attributes
|
||||
|
||||
|
||||
XSCHEM KEY BINDINGS
|
||||
----------------------------------------------------------------------
|
||||
- BackSpace Back to parent schematic
|
||||
|
|
@ -98,7 +98,7 @@ ctrl Enter Confirm closing dialog boxes
|
|||
- Left Move right
|
||||
- Right Move left
|
||||
- Up Move up
|
||||
ctrl Left Previous tab (if tabbed interface enabled)
|
||||
ctrl Left Previous tab (if tabbed interface enabled)
|
||||
ctrl Right Next tab (if tabbed interface enabled)
|
||||
- '\' Toggle fullscreen
|
||||
- '!' Break selected wires at any wire or component pin
|
||||
|
|
@ -145,6 +145,7 @@ alt 'g' Hilight selected nets and send to gaw waveform viewer
|
|||
alt 'h' create symbol pins from schematic pins
|
||||
ctrl 'h' Follow http link or execute command (url, tclcommand properties)
|
||||
shift 'H' Attach net labels to selected instance
|
||||
ctrl+shift 'H' Make schematic and symbol from selected components
|
||||
- 'i' Descend to symbol
|
||||
alt 'i' Edit selected symbol in a new window
|
||||
alt+shift 'J' Create labels with 'i' prefix from highlighted nets/pins
|
||||
|
|
@ -174,6 +175,7 @@ alt 'n' Empty schematic in new window
|
|||
alt+shift 'N' Empty symbol in new window
|
||||
shift 'O' Toggle Light / Dark colorscheme
|
||||
ctrl 'o' Load schematic
|
||||
- 'p' Place polygon. Operation ends by placing last point over first.
|
||||
alt 'p' Add symbol pin
|
||||
ctrl 'p' Pan schematic view
|
||||
shift 'P' Pan, other way to.
|
||||
|
|
@ -198,7 +200,7 @@ shift 'U' Redo
|
|||
ctrl 'v' Paste from clipboard
|
||||
shift 'V' Toggle spice/vhdl/verilog netlist
|
||||
- 'w' Place wire
|
||||
ctrl 'w' Place polygon. Operation ends by placing last point over first.
|
||||
ctrl 'w' close current schematic
|
||||
shift 'W' Place wire, snapping to closest pin or net endpoint
|
||||
ctrl 'x' Cut into clipboard
|
||||
- 'x' New cad session
|
||||
|
|
|
|||
|
|
@ -486,6 +486,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
|
||||
|
||||
|
||||
|
||||
<li><kbd> abort_operation</kbd></li><pre>
|
||||
Resets UI state, unselect all and abort any pending operation </pre>
|
||||
<li><kbd> add_symbol_pin</kbd></li><pre>
|
||||
|
|
@ -588,8 +589,9 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
Enable/disable layers depending on tcl array variable enable_layer() </pre>
|
||||
<li><kbd> escape_chars source</kbd></li><pre>
|
||||
escape tcl special characters with backslash </pre>
|
||||
<li><kbd> exit</kbd></li><pre>
|
||||
Exit the program, ask for confirm if current file modified. </pre>
|
||||
<li><kbd> exit [closewindow]</kbd></li><pre>
|
||||
Exit the program, ask for confirm if current file modified.
|
||||
if 'closewindow' is given close the window, otherwise leave with a blank schematic </pre>
|
||||
<li><kbd> expandlabel lab</kbd></li><pre>
|
||||
Expand vectored labels/instance names:
|
||||
xschem expandlabel {2*A[3:0]} --> A[3],A[2],A[1],A[0],A[3],A[2],A[1],A[0] 8
|
||||
|
|
@ -793,7 +795,8 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
'symbol': do not load symbols (used if loading a symbol instead of a schematic)
|
||||
'nofullzoom': do not do a fll zoom on new schematic.</pre>
|
||||
<li><kbd> load_new_window [f]</kbd></li><pre>
|
||||
Load schematic in a new tab/window. If 'f' not given prompt user </pre>
|
||||
Load schematic in a new tab/window. If 'f' not given prompt user
|
||||
if 'f' is given as empty '{}' then open untitled.sch </pre>
|
||||
<li><kbd> log f</kbd></li><pre>
|
||||
If 'f' is given output stderr messages to file 'f'
|
||||
if 'f' is not given and a file log is open, close log
|
||||
|
|
@ -1191,6 +1194,9 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- TCL global variables -->
|
||||
|
|
|
|||
|
|
@ -1826,6 +1826,50 @@ void go_back(int confirm) /* 20171006 add confirm */
|
|||
}
|
||||
}
|
||||
|
||||
void clear_schematic(int cancel, int symbol)
|
||||
{
|
||||
if(cancel == 1) cancel=save(1);
|
||||
if(cancel != -1) { /* -1 means user cancel save request */
|
||||
char name[PATH_MAX];
|
||||
struct stat buf;
|
||||
int i;
|
||||
xctx->currsch = 0;
|
||||
unselect_all(1);
|
||||
remove_symbols();
|
||||
clear_drawing();
|
||||
if(symbol == 1) {
|
||||
xctx->netlist_type = CAD_SYMBOL_ATTRS;
|
||||
set_tcl_netlist_type();
|
||||
for(i=0;; ++i) { /* find a non-existent untitled[-n].sym */
|
||||
if(i == 0) my_snprintf(name, S(name), "%s.sym", "untitled");
|
||||
else my_snprintf(name, S(name), "%s-%d.sym", "untitled", i);
|
||||
if(stat(name, &buf)) break;
|
||||
}
|
||||
my_snprintf(xctx->sch[xctx->currsch], S(xctx->sch[xctx->currsch]), "%s/%s", pwd_dir, name);
|
||||
my_strncpy(xctx->current_name, name, S(xctx->current_name));
|
||||
} else {
|
||||
xctx->netlist_type = CAD_SPICE_NETLIST;
|
||||
set_tcl_netlist_type();
|
||||
for(i=0;; ++i) {
|
||||
if(i == 0) my_snprintf(name, S(name), "%s.sch", "untitled");
|
||||
else my_snprintf(name, S(name), "%s-%d.sch", "untitled", i);
|
||||
if(stat(name, &buf)) break;
|
||||
}
|
||||
my_snprintf(xctx->sch[xctx->currsch], S(xctx->sch[xctx->currsch]), "%s/%s", pwd_dir, name);
|
||||
my_strncpy(xctx->current_name, name, S(xctx->current_name));
|
||||
}
|
||||
draw();
|
||||
set_modify(0);
|
||||
xctx->prep_hash_inst=0;
|
||||
xctx->prep_hash_wires=0;
|
||||
xctx->prep_net_structs=0;
|
||||
xctx->prep_hi_structs=0;
|
||||
if(has_x) {
|
||||
set_modify(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef __unix__
|
||||
/* Source: https://www.tcl.tk/man/tcl8.7/TclCmd/glob.htm */
|
||||
/* backslash character has a special meaning to glob command,
|
||||
|
|
|
|||
|
|
@ -1503,7 +1503,7 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
|
|||
xctx->ui_state |= START_SYMPIN;
|
||||
break;
|
||||
}
|
||||
if(key=='w' && !xctx->ui_state && state==ControlMask) /* start polygon, 20171115 */
|
||||
if(key=='p' && !xctx->ui_state && state==0) /* start polygon, 20171115 */
|
||||
{
|
||||
if(xctx->semaphore >= 2) break;
|
||||
dbg(1, "callback(): start polygon\n");
|
||||
|
|
@ -1599,30 +1599,13 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
|
|||
redraw_w_a_l_r_p_rubbers();
|
||||
break;
|
||||
}
|
||||
if(key=='q' && state == ControlMask) /* exit */
|
||||
if(key=='w' && state == ControlMask) /* close current schematic */
|
||||
{
|
||||
int remaining, save_sem;
|
||||
int save_sem;
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(!strcmp(xctx->current_win_path, ".drw")) {
|
||||
save_sem = xctx->semaphore;
|
||||
/* tcleval("new_window destroy_all"); */ /* close child schematics */
|
||||
remaining = new_schematic("destroy_all", NULL, NULL);
|
||||
xctx->semaphore = save_sem;
|
||||
/* if(tclresult()[0] == '1') { */
|
||||
if(!remaining) {
|
||||
if(xctx->modified) {
|
||||
tcleval("tk_messageBox -type okcancel -parent [xschem get topwindow] -message \""
|
||||
"[get_cell [xschem get schname] 0]"
|
||||
": UNSAVED data: want to exit?\"");
|
||||
}
|
||||
if(!xctx->modified || !strcmp(tclresult(),"ok")) tcleval("exit");
|
||||
}
|
||||
} else {
|
||||
/* xschem new_schematic destroy asks user confirmation if schematic changed */
|
||||
save_sem = xctx->semaphore;
|
||||
new_schematic("destroy", xctx->current_win_path, NULL);
|
||||
xctx->semaphore = save_sem;
|
||||
}
|
||||
save_sem = xctx->semaphore;
|
||||
tcleval("xschem exit");
|
||||
xctx->semaphore = save_sem;
|
||||
break;
|
||||
}
|
||||
if(key=='t' && state == 0) /* place text */
|
||||
|
|
@ -1847,6 +1830,12 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
|
|||
{
|
||||
edit_property(2);break;
|
||||
}
|
||||
if(key=='q' && state==ControlMask) /* quit xschem */
|
||||
{
|
||||
if(xctx->semaphore >= 2) break;
|
||||
tcleval("quit_xschem");
|
||||
break;
|
||||
}
|
||||
if(key=='q' && state==0) /* edit attributes */
|
||||
{
|
||||
if(xctx->semaphore >= 2) break;
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ alt 'n' Empty schematic in new window
|
|||
alt+shift 'N' Empty symbol in new window
|
||||
shift 'O' Toggle Light / Dark colorscheme
|
||||
ctrl 'o' Load schematic
|
||||
- 'p' Place polygon. Operation ends by placing last point over first.
|
||||
alt 'p' Add symbol pin
|
||||
ctrl 'p' Pan schematic view
|
||||
shift 'P' Pan, other way to.
|
||||
|
|
@ -159,7 +160,7 @@ shift 'U' Redo
|
|||
ctrl 'v' Paste from clipboard
|
||||
shift 'V' Toggle spice/vhdl/verilog netlist
|
||||
- 'w' Place wire
|
||||
ctrl 'w' Place polygon. Operation ends by placing last point over first.
|
||||
ctrl 'w' close current schematic
|
||||
shift 'W' Place wire, snapping to closest pin or net endpoint
|
||||
ctrl 'x' Cut into clipboard
|
||||
- 'x' New cad session
|
||||
|
|
|
|||
122
src/scheduler.c
122
src/scheduler.c
|
|
@ -414,46 +414,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
if(!strcmp(argv[i], "force") ) cancel = 0;
|
||||
if(!strcmp(argv[i], "symbol")) symbol = 1;
|
||||
}
|
||||
if(cancel == 1) cancel=save(1);
|
||||
if(cancel != -1) { /* -1 means user cancel save request */
|
||||
char name[PATH_MAX];
|
||||
struct stat buf;
|
||||
int i;
|
||||
xctx->currsch = 0;
|
||||
unselect_all(1);
|
||||
remove_symbols();
|
||||
clear_drawing();
|
||||
if(symbol == 1) {
|
||||
xctx->netlist_type = CAD_SYMBOL_ATTRS;
|
||||
set_tcl_netlist_type();
|
||||
for(i=0;; ++i) { /* find a non-existent untitled[-n].sym */
|
||||
if(i == 0) my_snprintf(name, S(name), "%s.sym", "untitled");
|
||||
else my_snprintf(name, S(name), "%s-%d.sym", "untitled", i);
|
||||
if(stat(name, &buf)) break;
|
||||
}
|
||||
my_snprintf(xctx->sch[xctx->currsch], S(xctx->sch[xctx->currsch]), "%s/%s", pwd_dir, name);
|
||||
my_strncpy(xctx->current_name, name, S(xctx->current_name));
|
||||
} else {
|
||||
xctx->netlist_type = CAD_SPICE_NETLIST;
|
||||
set_tcl_netlist_type();
|
||||
for(i=0;; ++i) {
|
||||
if(i == 0) my_snprintf(name, S(name), "%s.sch", "untitled");
|
||||
else my_snprintf(name, S(name), "%s-%d.sch", "untitled", i);
|
||||
if(stat(name, &buf)) break;
|
||||
}
|
||||
my_snprintf(xctx->sch[xctx->currsch], S(xctx->sch[xctx->currsch]), "%s/%s", pwd_dir, name);
|
||||
my_strncpy(xctx->current_name, name, S(xctx->current_name));
|
||||
}
|
||||
draw();
|
||||
set_modify(0);
|
||||
xctx->prep_hash_inst=0;
|
||||
xctx->prep_hash_wires=0;
|
||||
xctx->prep_net_structs=0;
|
||||
xctx->prep_hi_structs=0;
|
||||
if(has_x) {
|
||||
set_modify(-1);
|
||||
}
|
||||
}
|
||||
clear_schematic(cancel, symbol);
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
|
|
@ -719,21 +680,58 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
}
|
||||
}
|
||||
|
||||
/* exit
|
||||
* Exit the program, ask for confirm if current file modified. */
|
||||
/* exit [closewindow]
|
||||
* Exit the program, ask for confirm if current file modified.
|
||||
* if 'closewindow' is given close the window, otherwise leave with a blank schematic */
|
||||
else if(!strcmp(argv[1], "exit"))
|
||||
{
|
||||
int closewindow = 0;
|
||||
|
||||
if(argc > 2 && !strcmp(argv[2], "closewindow")) closewindow = 1;
|
||||
if(!strcmp(xctx->current_win_path, ".drw")) {
|
||||
if(has_x) {
|
||||
int remaining;
|
||||
remaining = new_schematic("destroy_all", NULL, NULL);
|
||||
if(!remaining) {
|
||||
if(xctx->modified) {
|
||||
tcleval("tk_messageBox -type okcancel -parent [xschem get topwindow] -message \""
|
||||
"[get_cell [xschem get schname] 0]"
|
||||
": UNSAVED data: want to exit?\"");
|
||||
if(!tclgetboolvar("tabbed_interface")) { /* non tabbed interface */
|
||||
if(closewindow) {
|
||||
remaining = new_schematic("destroy_all", NULL, NULL);
|
||||
if(!remaining) {
|
||||
if(xctx->modified) {
|
||||
tcleval("tk_messageBox -type okcancel -parent [xschem get topwindow] -message \""
|
||||
"[get_cell [xschem get schname] 0]"
|
||||
": UNSAVED data: want to exit?\"");
|
||||
}
|
||||
if(!xctx->modified || !strcmp(tclresult(), "ok")) {
|
||||
tcleval("exit");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
clear_schematic(0, 0);
|
||||
}
|
||||
} else { /* tabbed interface */
|
||||
int wc = get_window_count();
|
||||
dbg(1, "wc=%d\n", wc);
|
||||
if(wc > 0 ) {
|
||||
if(xctx->modified) {
|
||||
tcleval("tk_messageBox -type okcancel -parent [xschem get topwindow] -message \""
|
||||
"[get_cell [xschem get schname] 0]"
|
||||
": UNSAVED data: want to exit?\"");
|
||||
}
|
||||
if(!xctx->modified || !strcmp(tclresult(), "ok")) {
|
||||
swap_tabs();
|
||||
set_modify(0);
|
||||
new_schematic("destroy", xctx->current_win_path, NULL);
|
||||
}
|
||||
} else {
|
||||
if(xctx->modified) {
|
||||
tcleval("tk_messageBox -type okcancel -parent [xschem get topwindow] -message \""
|
||||
"[get_cell [xschem get schname] 0]"
|
||||
": UNSAVED data: want to exit?\"");
|
||||
}
|
||||
if(!xctx->modified || !strcmp(tclresult(), "ok")) {
|
||||
if(closewindow) tcleval("exit");
|
||||
else clear_schematic(0, 0);
|
||||
}
|
||||
}
|
||||
if(!xctx->modified || !strcmp(tclresult(), "ok")) tcleval("exit");
|
||||
}
|
||||
}
|
||||
else tcleval("exit"); /* if has_x == 0 there are no additional windows to close */
|
||||
|
|
@ -1966,10 +1964,12 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
}
|
||||
|
||||
/* load_new_window [f]
|
||||
* Load schematic in a new tab/window. If 'f' not given prompt user */
|
||||
* Load schematic in a new tab/window. If 'f' not given prompt user
|
||||
* if 'f' is given as empty '{}' then open untitled.sch */
|
||||
else if(!strcmp(argv[1], "load_new_window") )
|
||||
{
|
||||
char f[PATH_MAX + 100];
|
||||
int cancel = 0;
|
||||
if(has_x) {
|
||||
if(argc > 2) {
|
||||
my_snprintf(f, S(f),"regsub {^~/} {%s} {%s/}", argv[2], home_dir);
|
||||
|
|
@ -1977,15 +1977,22 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
my_strncpy(f, tclresult(), S(f));
|
||||
} else {
|
||||
tcleval("load_file_dialog {Load file} *.\\{sch,sym\\} INITIALLOADDIR");
|
||||
my_snprintf(f, S(f), "%s", tclresult());
|
||||
if(tclresult()[0]) {
|
||||
my_snprintf(f, S(f), "%s", tclresult());
|
||||
} else {
|
||||
cancel = 1;
|
||||
}
|
||||
}
|
||||
if(f[0] ) {
|
||||
new_schematic("create", NULL, f);
|
||||
tclvareval("update_recent_file {", f, "}", NULL);
|
||||
if(!cancel) {
|
||||
if(f[0]) {
|
||||
new_schematic("create", NULL, f);
|
||||
tclvareval("update_recent_file {", f, "}", NULL);
|
||||
} else {
|
||||
new_schematic("create", NULL, NULL);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
/* log f
|
||||
|
|
@ -3751,8 +3758,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
* testmode */
|
||||
else if(!strcmp(argv[1], "test"))
|
||||
{
|
||||
dbg(0, "--> %d\n", get_window_count());
|
||||
/* swap_tabs(0, 1); */
|
||||
swap_tabs();
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
|
|
|
|||
21
src/xinit.c
21
src/xinit.c
|
|
@ -1182,14 +1182,26 @@ void preview_window(const char *what, const char *win_path, const char *fname)
|
|||
semaphore--;
|
||||
}
|
||||
|
||||
|
||||
void swap_tabs(int i, int j)
|
||||
/* swap primary view (.drw) with first valid tab (x1.drw, x2.drw, ...) */
|
||||
void swap_tabs(void)
|
||||
{
|
||||
int wc = window_count;
|
||||
if(wc && j <=wc && i <= wc && j!=i) {
|
||||
if(wc) {
|
||||
Xschem_ctx *ctx;
|
||||
char *tmp;
|
||||
|
||||
int i = 0;
|
||||
int j;
|
||||
for(j = 1; j < MAX_NEW_WINDOWS; j++) {
|
||||
if(save_xctx[j]) break;
|
||||
}
|
||||
if(j >= MAX_NEW_WINDOWS) {
|
||||
dbg(0, "swap_tabs(): no tab to swap to found\n");
|
||||
return;
|
||||
}
|
||||
if(!save_xctx[i]) {
|
||||
dbg(0, "swap_tabs(): no tab to swap from found\n");
|
||||
return;
|
||||
}
|
||||
|
||||
tmp = save_xctx[i]->top_path;
|
||||
save_xctx[i]->top_path = save_xctx[j]->top_path;
|
||||
|
|
@ -1211,6 +1223,7 @@ void swap_tabs(int i, int j)
|
|||
set_modify(-1);
|
||||
xctx = ctx;
|
||||
set_modify(-1);
|
||||
new_schematic("switch_tab", save_xctx[j]->current_win_path, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1332,7 +1332,7 @@ extern void mem_delete_undo(void);
|
|||
extern void mem_clear_undo(void);
|
||||
extern void load_schematic(int load_symbol, const char *fname, int reset_undo, int alert);
|
||||
/* check if filename already in an open window/tab */
|
||||
extern void swap_tabs(int i, int j);
|
||||
extern void swap_tabs(void);
|
||||
extern int check_loaded(const char *f, char *win_path);
|
||||
extern char *get_window_path(int i);
|
||||
extern int get_window_count(void);
|
||||
|
|
@ -1347,6 +1347,7 @@ extern const char *get_sym_name(int inst, int ndir, int ext);
|
|||
extern void get_additional_symbols(int what);
|
||||
extern int descend_schematic(int instnumber);
|
||||
extern void go_back(int confirm);
|
||||
extern void clear_schematic(int cancel, int symbol);
|
||||
extern void view_unzoom(double z);
|
||||
extern void view_zoom(double z);
|
||||
extern void draw_stuff(void);
|
||||
|
|
|
|||
101
src/xschem.tcl
101
src/xschem.tcl
|
|
@ -689,8 +689,7 @@ proc update_recent_file {f {topwin {} } } {
|
|||
set recentfile [lreplace $recentfile 10 end]
|
||||
}
|
||||
write_recent_file
|
||||
if { [info exists has_x] } {setup_recent_menu 0 $topwin}
|
||||
if { [info exists has_x] } {setup_recent_menu 1 $topwin}
|
||||
if { [info exists has_x] } {setup_recent_menu $topwin}
|
||||
}
|
||||
|
||||
proc write_recent_file {} {
|
||||
|
|
@ -721,26 +720,15 @@ proc write_recent_file {} {
|
|||
close $fd
|
||||
}
|
||||
|
||||
proc setup_recent_menu { {in_new_window 0} { topwin {} } } {
|
||||
proc setup_recent_menu { { topwin {} } } {
|
||||
global recentfile
|
||||
# puts "setup recent menu in_new_window=$in_new_window"
|
||||
if {$in_new_window} {
|
||||
$topwin.menubar.file.menu.recent_new_window delete 0 9
|
||||
} else {
|
||||
$topwin.menubar.file.menu.recent delete 0 9
|
||||
}
|
||||
$topwin.menubar.file.menu.recent delete 0 9
|
||||
set i 0
|
||||
if { [info exists recentfile] } {
|
||||
foreach i $recentfile {
|
||||
if {$in_new_window} {
|
||||
$topwin.menubar.file.menu.recent_new_window add command \
|
||||
-command "xschem load_new_window {$i} gui" \
|
||||
-label [file tail $i]
|
||||
} else {
|
||||
$topwin.menubar.file.menu.recent add command \
|
||||
-command "xschem load {$i} gui" \
|
||||
-label [file tail $i]
|
||||
}
|
||||
$topwin.menubar.file.menu.recent add command \
|
||||
-command "xschem load {$i} gui" \
|
||||
-label [file tail $i]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5231,17 +5219,12 @@ proc setup_tabbed_interface {} {
|
|||
destroy .tabs
|
||||
}
|
||||
if {$tabbed_interface} {
|
||||
.menubar.file.menu entryconfigure {Open recent in new window} -state disabled
|
||||
.menubar.file.menu entryconfigure {Open new window} -state disabled
|
||||
set_tab_names
|
||||
} else {
|
||||
.menubar.file.menu entryconfigure {Open recent in new window} -state normal
|
||||
.menubar.file.menu entryconfigure {Open new window} -state normal
|
||||
}
|
||||
}
|
||||
# update tabbed window close (X) function
|
||||
if {$tabbed_interface} {
|
||||
wm protocol . WM_DELETE_WINDOW {
|
||||
xschem exit
|
||||
xschem exit closewindow
|
||||
}
|
||||
# restore non tabbed window close function for main window
|
||||
} else {
|
||||
|
|
@ -5251,7 +5234,7 @@ proc setup_tabbed_interface {} {
|
|||
restore_ctx .drw
|
||||
housekeeping_ctx
|
||||
xschem new_schematic switch_win .drw
|
||||
xschem exit
|
||||
xschem exit closewindow
|
||||
# did not exit (user cancel) ... switch back
|
||||
restore_ctx $old
|
||||
housekeeping_ctx
|
||||
|
|
@ -5350,9 +5333,6 @@ proc set_tab_names {{mod {}}} {
|
|||
regsub {\.drw} $currwin {} tabname
|
||||
if {$tabname eq {}} { set tabname .x0}
|
||||
.tabs$tabname configure -text [file tail [xschem get schname]]$mod -bg Palegreen
|
||||
if {$tabname eq {.x0}} {
|
||||
.tabs$tabname configure -fg red
|
||||
}
|
||||
for { set i 0} { $i < $tctx::max_new_windows} { incr i} {
|
||||
if { [winfo exists .tabs.x$i] && ($tabname ne ".x$i")} {
|
||||
.tabs.x$i configure -bg $tctx::tab_bg
|
||||
|
|
@ -5361,6 +5341,23 @@ proc set_tab_names {{mod {}}} {
|
|||
}
|
||||
}
|
||||
|
||||
proc quit_xschem {} {
|
||||
global tabbed_interface
|
||||
|
||||
set remaining [xschem new_schematic destroy_all]
|
||||
if {$tabbed_interface != 1} {
|
||||
if {$remaining == 0 } {
|
||||
save_ctx [xschem get current_win_path]
|
||||
restore_ctx .drw
|
||||
xschem new_schematic switch_win .drw
|
||||
housekeeping_ctx
|
||||
xschem exit closewindow
|
||||
}
|
||||
} else {
|
||||
xschem new_schematic switch_tab .drw
|
||||
xschem exit closewindow
|
||||
}
|
||||
}
|
||||
proc raise_dialog {parent window_path } {
|
||||
global myload_loadfile component_browser_on_top
|
||||
foreach i ".dialog .graphdialog .load" {
|
||||
|
|
@ -5754,46 +5751,29 @@ proc build_widgets { {topwin {} } } {
|
|||
$topwin.menubar.help.menu add command -label "Keys" -command "textwindow \"${XSCHEM_SHAREDIR}/keys.help\" ro"
|
||||
$topwin.menubar.help.menu add command -label "About XSCHEM" -command "about"
|
||||
|
||||
$topwin.menubar.file.menu add command -label "New Schematic" -accelerator Ctrl+N\
|
||||
$topwin.menubar.file.menu add command -label "Clear Schematic" -accelerator Ctrl+N\
|
||||
-command {
|
||||
xschem clear schematic
|
||||
}
|
||||
# toolbar_add FileNew {xschem clear schematic} "New Schematic" $topwin
|
||||
$topwin.menubar.file.menu add command -label "New Symbol" -accelerator Ctrl+Shift+N \
|
||||
$topwin.menubar.file.menu add command -label "Clear Symbol" -accelerator Ctrl+Shift+N \
|
||||
-command {
|
||||
xschem clear symbol
|
||||
}
|
||||
# toolbar_add FileNewSym {xschem clear symbol} "New Symbol" $topwin
|
||||
$topwin.menubar.file.menu add command -label "New empty Schematic window" -accelerator {Alt+N} \
|
||||
-command {
|
||||
xschem new_window
|
||||
}
|
||||
$topwin.menubar.file.menu add command -label "New empty Symbol window" -accelerator {Alt+Shift+N} \
|
||||
-command {
|
||||
xschem new_symbol_window
|
||||
}
|
||||
$topwin.menubar.file.menu add command -label "Component browser" -accelerator {Shift-Ins, Ctrl-I} \
|
||||
-command {
|
||||
load_file_dialog {Insert symbol} *.sym INITIALINSTDIR 2
|
||||
}
|
||||
$topwin.menubar.file.menu add command -label "Open" -command "xschem load" -accelerator {Ctrl+O}
|
||||
$topwin.menubar.file.menu add cascade -label "Open recent" -menu $topwin.menubar.file.menu.recent
|
||||
$topwin.menubar.file.menu add cascade -label {Open recent in new window} \
|
||||
-menu $topwin.menubar.file.menu.recent_new_window
|
||||
menu $topwin.menubar.file.menu.recent_new_window -tearoff 0
|
||||
menu $topwin.menubar.file.menu.recent -tearoff 0
|
||||
setup_recent_menu 0 $topwin
|
||||
setup_recent_menu 1 $topwin
|
||||
$topwin.menubar.file.menu add command -label {Open new window} -command "xschem load_new_window"
|
||||
if {$tabbed_interface} {
|
||||
$topwin.menubar.file.menu entryconfigure {Open new window} -state disabled
|
||||
$topwin.menubar.file.menu entryconfigure {Open recent in new window} -state disabled
|
||||
}
|
||||
toolbar_add FileOpen "xschem load" "Open File" $topwin
|
||||
$topwin.menubar.file.menu add command -label "Delete files" -command "xschem delete_files" -accelerator {Shift-D}
|
||||
|
||||
$topwin.menubar.file.menu add command -label "Open Most Recent" \
|
||||
-command {xschem load [lindex "$recentfile" 0] gui} -accelerator {Ctrl+Shift+O}
|
||||
$topwin.menubar.file.menu add cascade -label "Open recent" -menu $topwin.menubar.file.menu.recent
|
||||
menu $topwin.menubar.file.menu.recent -tearoff 0
|
||||
setup_recent_menu $topwin
|
||||
$topwin.menubar.file.menu add command -label {Create new window/tab} -command "xschem new_schematic create"
|
||||
toolbar_add FileOpen "xschem load" "Open File" $topwin
|
||||
$topwin.menubar.file.menu add command -label "Delete files" -command "xschem delete_files" -accelerator {Shift-D}
|
||||
$topwin.menubar.file.menu add command -label "Save" -command "xschem save" -accelerator {Ctrl+S}
|
||||
toolbar_add FileSave "xschem save" "Save File" $topwin
|
||||
$topwin.menubar.file.menu add command -label "Merge" -command "xschem merge" -accelerator {B}
|
||||
|
|
@ -5820,9 +5800,12 @@ proc build_widgets { {topwin {} } } {
|
|||
$topwin.menubar.file.menu add command -label "PNG Export" -command "xschem print png" -accelerator {Ctrl+*}
|
||||
$topwin.menubar.file.menu add command -label "SVG Export" -command "xschem print svg" -accelerator {Alt+*}
|
||||
$topwin.menubar.file.menu add separator
|
||||
$topwin.menubar.file.menu add command -label "Exit" -accelerator {Ctrl+Q} -command {
|
||||
$topwin.menubar.file.menu add command -label "Close schematic" -accelerator {Ctrl+W} -command {
|
||||
xschem exit
|
||||
}
|
||||
$topwin.menubar.file.menu add command -label "Quit Xschem" -accelerator {Ctrl+Q} -command {
|
||||
quit_xschem
|
||||
}
|
||||
$topwin.menubar.option.menu add checkbutton -label "Color Postscript/SVG" -variable color_ps \
|
||||
-command {
|
||||
if { $color_ps==1 } {xschem set color_ps 1} else { xschem set color_ps 0}
|
||||
|
|
@ -6075,7 +6058,7 @@ proc build_widgets { {topwin {} } } {
|
|||
toolbar_add ToolInsertLine "xschem line" "Insert Line" $topwin
|
||||
$topwin.menubar.tools.menu add command -label "Insert rect" -command "xschem rect" -accelerator R
|
||||
toolbar_add ToolInsertRect "xschem rect" "Insert Rectangle" $topwin
|
||||
$topwin.menubar.tools.menu add command -label "Insert polygon" -command "xschem polygon" -accelerator Ctrl+W
|
||||
$topwin.menubar.tools.menu add command -label "Insert polygon" -command "xschem polygon" -accelerator Ctrl+P
|
||||
toolbar_add ToolInsertPolygon "xschem polygon" "Insert Polygon" $topwin
|
||||
$topwin.menubar.tools.menu add command -label "Insert arc" -command "xschem arc" -accelerator Shift+C
|
||||
toolbar_add ToolInsertArc "xschem arc" "Insert Arc" $topwin
|
||||
|
|
@ -6238,9 +6221,9 @@ tclcommand=\"xschem raw_read \$netlist_dir/[file tail [file rootname [xschem get
|
|||
$rootwin configure -background {}
|
||||
wm geometry $rootwin $initial_geometry
|
||||
#wm maxsize . 1600 1200
|
||||
if {$tabbed_interface && $rootwin eq {.}} {
|
||||
if {$tabbed_interface} {
|
||||
wm protocol $rootwin WM_DELETE_WINDOW {
|
||||
xschem exit
|
||||
xschem exit closewindow
|
||||
}
|
||||
} elseif { $rootwin == {.}} {
|
||||
wm protocol $rootwin WM_DELETE_WINDOW {
|
||||
|
|
@ -6249,7 +6232,7 @@ tclcommand=\"xschem raw_read \$netlist_dir/[file tail [file rootname [xschem get
|
|||
restore_ctx .drw
|
||||
housekeeping_ctx
|
||||
xschem new_schematic switch_win .drw
|
||||
xschem exit
|
||||
xschem exit closewindow
|
||||
# did not exit ... switch back
|
||||
restore_ctx $old
|
||||
housekeeping_ctx
|
||||
|
|
|
|||
Loading…
Reference in New Issue