From 9570439e165ce3c21301c0c3016137f00c074e9d Mon Sep 17 00:00:00 2001 From: schippes Date: Sun, 16 Aug 2020 03:34:45 +0200 Subject: [PATCH] made edit_symbol_property and tcl edit_prop procedure much simpler when user clicks another instance while edit_prop dialog still open --- src/actions.c | 26 ++++++------ src/callback.c | 12 +++--- src/draw.c | 2 +- src/editprop.c | 67 +++++++++++++------------------ src/netlist.c | 6 +-- src/paste.c | 4 +- src/psprint.c | 4 +- src/save.c | 2 +- src/scheduler.c | 15 +++---- src/svgdraw.c | 4 +- src/token.c | 8 ++-- src/traduci.awk | 5 ++- src/xinit.c | 28 ++++++------- src/xschem.h | 2 +- src/xschem.tcl | 68 ++++++++++---------------------- xschem_library/devices/pnp.sym | 4 +- xschem_library/devices/zener.sym | 4 +- 17 files changed, 111 insertions(+), 150 deletions(-) diff --git a/src/actions.c b/src/actions.c index 76744abe..d2285222 100644 --- a/src/actions.c +++ b/src/actions.c @@ -149,7 +149,7 @@ int set_netlist_dir(int force, char *dir) if(dir) my_snprintf(cmd, S(cmd), "select_netlist_dir %d %s", force, dir); else my_snprintf(cmd, S(cmd), "select_netlist_dir %d", force); tcleval(cmd); - if(!strcmp("", Tcl_GetStringResult(interp)) ) { + if(!strcmp("", tclresult()) ) { return 0; } return 1; @@ -161,7 +161,7 @@ const char *abs_sym_path(const char *s, const char *ext) char c[PATH_MAX+1000]; my_snprintf(c, S(c), "abs_sym_path {%s} {%s}", s, ext); tcleval(c); - return Tcl_GetStringResult(interp); + return tclresult(); } /* Wrapper to Tcl function */ @@ -170,7 +170,7 @@ const char *rel_sym_path(const char *s) char c[PATH_MAX+1000]; my_snprintf(c, S(c), "rel_sym_path {%s}", s); tcleval(c); - return Tcl_GetStringResult(interp); + return tclresult(); } const char *add_ext(const char *f, const char *ext) @@ -437,7 +437,7 @@ const char *get_file_path(char *f) char tmp[2*PATH_MAX+100]; my_snprintf(tmp, S(tmp),"get_file_path \"%s\"", f); tcleval(tmp); - return Tcl_GetStringResult(interp); + return tclresult(); } int save(int confirm) /* 20171006 add confirm */ @@ -451,8 +451,8 @@ int save(int confirm) /* 20171006 add confirm */ { if(confirm) { tcleval("ask_save"); - if(!strcmp(Tcl_GetStringResult(interp), "") ) cancel=1; - if(!strcmp(Tcl_GetStringResult(interp), "yes") ) save_ok = save_schematic(schematic[currentsch]); + if(!strcmp(tclresult(), "") ) cancel=1; + if(!strcmp(tclresult(), "yes") ) save_ok = save_schematic(schematic[currentsch]); } else { save_ok = save_schematic(schematic[currentsch]); } @@ -479,7 +479,7 @@ void saveas(const char *f) /* changed name from ask_save_file to saveas 2012120 } tcleval(name); - my_strncpy(res, Tcl_GetStringResult(interp), S(res)); + my_strncpy(res, tclresult(), S(res)); } else if(f) { my_strncpy(res, f, S(res)); @@ -505,7 +505,7 @@ void ask_new_file(void) if(save(1)) return; /* user cancels save, so do nothing. */ } tcleval("load_file_dialog {Load Schematic} .sch.sym INITIALLOADDIR"); - my_snprintf(fullname, S(fullname),"%s", Tcl_GetStringResult(interp)); + my_snprintf(fullname, S(fullname),"%s", tclresult()); if( fullname[0] ) { @@ -893,7 +893,7 @@ int place_symbol(int pos, const char *symbol_name, double x, double y, int rot, if(current_type==SYMBOL) return 0; /* 20161210 dont allow components placed inside symbols */ if(symbol_name==NULL) { tcleval("load_file_dialog {Choose symbol} .sym INITIALINSTDIR"); - my_strncpy(name, Tcl_GetStringResult(interp), S(name)); + my_strncpy(name, tclresult(), S(name)); } else { my_strncpy(name, symbol_name, S(name)); } @@ -1094,7 +1094,7 @@ void descend_schematic(void) my_strncpy(filename, schematic[currentsch], S(filename)); my_snprintf(cmd, S(cmd), "save_file_dialog {Save file} .sch.sym INITIALLOADDIR {%s}", filename); tcleval(cmd); - my_strncpy(res, Tcl_GetStringResult(interp), S(res)); + my_strncpy(res, tclresult(), S(res)); if(!res[0]) return; /* 20071104 */ dbg(1, "descend_schematic(): saving: %s\n",res); save_ok = save_schematic(res); @@ -1139,7 +1139,7 @@ void descend_schematic(void) Tcl_VarEval(interp, "input_line ", "{input instance number (leftmost = 1) to descend into:\n" "negative numbers select instance starting\nfrom the right (rightmost = -1)}" " {} 1 6", NULL); - inum = Tcl_GetStringResult(interp); + inum = tclresult(); dbg(1, "descend_schematic(): inum=%s\n", inum); if(!inum[0]) { my_free(710, &sch_path[currentsch+1]); @@ -1203,8 +1203,8 @@ void go_back(int confirm) /* 20171006 add confirm */ { if(confirm) { tcleval("ask_save"); - if(!strcmp(Tcl_GetStringResult(interp), "yes") ) save_ok = save_schematic(schematic[currentsch]); - else if(!strcmp(Tcl_GetStringResult(interp), "") ) return; + if(!strcmp(tclresult(), "yes") ) save_ok = save_schematic(schematic[currentsch]); + else if(!strcmp(tclresult(), "") ) return; } else { save_ok = save_schematic(schematic[currentsch]); } diff --git a/src/callback.c b/src/callback.c index f757f59b..e95ace79 100644 --- a/src/callback.c +++ b/src/callback.c @@ -654,7 +654,7 @@ int callback(int event, int mx, int my, KeySym key, if(semaphore >= 2) break; if(modified) { tcleval("tk_messageBox -type okcancel -message {UNSAVED data: want to exit?}"); - if(strcmp(Tcl_GetStringResult(interp),"ok")==0) { + if(strcmp(tclresult(),"ok")==0) { tcleval( "exit"); } } @@ -755,7 +755,7 @@ int callback(int event, int mx, int my, KeySym key, if(semaphore >= 2) break; /* 20180914 */ if(current_type==SCHEMATIC) { tcleval("tk_messageBox -type okcancel -message {do you want to make symbol view ?}"); - if(strcmp(Tcl_GetStringResult(interp),"ok")==0) + if(strcmp(tclresult(),"ok")==0) { save_schematic(schematic[currentsch]); make_symbol(); @@ -893,7 +893,7 @@ int callback(int event, int mx, int my, KeySym key, { if(semaphore >= 2) break; tcleval("tk_messageBox -type okcancel -message {Are you sure you want to reload from disk?}"); - if(strcmp(Tcl_GetStringResult(interp),"ok")==0) { + if(strcmp(tclresult(),"ok")==0) { char filename[PATH_MAX]; unselect_all(); remove_symbols(); @@ -1440,9 +1440,9 @@ int callback(int event, int mx, int my, KeySym key, ui_state |= STARTPAN2; break; } - else if(semaphore >= 2) { - if(button==Button1 && state==0) { - tcleval("set editprop_semaphore 2"); /* 20160423 */ + else if(semaphore >= 2) { /* button1 click to select another instance while edit prop dialog open */ + if(button==Button1 && state==0 && tclgetvar("edit_symbol_prop_new_sel")[0]) { + tcleval("set edit_symbol_prop_new_sel 1; .dialog.f1.b1 invoke"); /* invoke 'OK' of edit prop dialog */ } break; } diff --git a/src/draw.c b/src/draw.c index 037a4ecc..1e0f83df 100644 --- a/src/draw.c +++ b/src/draw.c @@ -51,7 +51,7 @@ void print_image() if(!plotfile[0]) { my_strdup(60, &tmpstring, "tk_getSaveFile -title {Select destination file} -initialdir $env(PWD)"); tcleval(tmpstring); - r = Tcl_GetStringResult(interp); + r = tclresult(); my_free(717, &tmpstring); if(r[0]) my_strncpy(plotfile, r, S(plotfile)); else return; diff --git a/src/editprop.c b/src/editprop.c index 5c133961..b6564e7b 100644 --- a/src/editprop.c +++ b/src/editprop.c @@ -793,34 +793,6 @@ static char *old_prop=NULL; static int i=-1; static int netlist_commands; -void fill_symbol_editprop_form(int x) -{ - /* 20160423 if no more stuff selected close editprop toplevel form */ - if(lastselected==0 || selectedgroup[0].type!=ELEMENT) { - Tcl_GlobalEval(interp, "set editprop_semaphore 0"); - return; - } - i=selectedgroup[0].n; - dbg(1, "fill_symbol_editprop_form(): element %d property=%s\n",i,inst_ptr[i].prop_ptr); - dbg(1, "fill_symbol_editprop_form(): modified=%d\n", modified); - dbg(1, "fill_symbol_editprop_form(): symbol=%s\n", inst_ptr[i].name); - if(inst_ptr[i].prop_ptr!=NULL) { - dbg(1, "fill_symbol_editprop_form(): element %d property=%s\n",i,inst_ptr[i].prop_ptr); - - if(netlist_commands && x==1) { - /* 20070318 */ - tclsetvar("retval",get_tok_value( inst_ptr[i].prop_ptr,"value",0)); - } else { - tclsetvar("retval",inst_ptr[i].prop_ptr); - } - } - else { - tclsetvar("retval",""); - } - my_strdup(91, &old_prop, inst_ptr[i].prop_ptr); - tclsetvar("symbol",inst_ptr[i].name); -} - /* x=0 use text widget x=1 use vim editor */ void edit_symbol_property(int x) { @@ -831,11 +803,22 @@ void edit_symbol_property(int x) if ((inst_ptr[i].ptr + instdef)->type!=NULL) netlist_commands = !strcmp( (inst_ptr[i].ptr+instdef)->type, "netlist_commands"); - fill_symbol_editprop_form( x); + if(inst_ptr[i].prop_ptr!=NULL) { + if(netlist_commands && x==1) { + tclsetvar("retval",get_tok_value( inst_ptr[i].prop_ptr,"value",0)); + } else { + tclsetvar("retval",inst_ptr[i].prop_ptr); + } + } + else { + tclsetvar("retval",""); + } + my_strdup(91, &old_prop, inst_ptr[i].prop_ptr); + tclsetvar("symbol",inst_ptr[i].name); if(x==0) { tcleval("edit_prop {Input property:}"); - my_strdup(77, &result, Tcl_GetStringResult(interp)); + my_strdup(77, &result, tclresult()); } else { /* edit_vi_netlist_prop will replace \" with " before editing, @@ -844,7 +827,7 @@ void edit_symbol_property(int x) if(netlist_commands && x==1) tcleval("edit_vi_netlist_prop {Input property:}"); else if(x==1) tcleval("edit_vi_prop {Input property:}"); else if(x==2) tcleval("viewdata $::retval"); - my_strdup(78, &result, Tcl_GetStringResult(interp)); + my_strdup(78, &result, tclresult()); } dbg(1, "edit_symbol_property(): before update_symbol, modified=%d\n", modified); update_symbol(result, x); @@ -868,6 +851,7 @@ void update_symbol(const char *result, int x) int cond, allow_change_name; int pushed=0; /* 20150327 */ + dbg(1, "update_symbol(): entering\n"); i=selectedgroup[0].n; /* 20110413 */ if(!result) { dbg(1, "update_symbol(): edit symbol prop aborted\n"); @@ -1035,14 +1019,6 @@ void update_symbol(const char *result, int x) dbg(1, "update_symbol(): redrawing inst_ptr.txtprop string\n"); draw(); bbox(END,0.0,0.0,0.0,0.0); - /* 20160308 added if(), leave edited objects selected after updating properties */ - /* unless i am clicking another element with edit property dialog box open */ - /* in this latter case the last pointed element remains selected. */ - if( !strcmp(tclgetvar("editprop_semaphore"), "2")) { - unselect_all(); - select_object(mousex,mousey,SELECTED, 0); - } - rebuild_selected_array(); my_free(731, &name); my_free(732, &ptr); my_free(733, &new_prop); @@ -1147,7 +1123,7 @@ void edit_property(int x) tcleval("edit_vi_prop {Global schematic property:}"); } else if(x==2) tcleval("viewdata $::retval"); - dbg(1, "edit_property(): done executing edit_vi_prop, result=%s\n",Tcl_GetStringResult(interp)); + dbg(1, "edit_property(): done executing edit_vi_prop, result=%s\n",tclresult()); dbg(1, "edit_property(): rcode=%s\n",tclgetvar("rcode") ); if(strcmp(tclgetvar("rcode"),"") ) { @@ -1202,6 +1178,17 @@ void edit_property(int x) { case ELEMENT: edit_symbol_property(x); + while( x == 0 && tclgetvar("edit_symbol_prop_new_sel")[0] == '1' ) { + unselect_all(); + select_object(mousex, mousey, SELECTED, 0); + rebuild_selected_array(); + if(lastselected && selectedgroup[0].type ==ELEMENT) { + edit_symbol_property(0); + } else { + break; + } + } + tclsetvar("edit_symbol_prop_new_sel", ""); break; case ARC: edit_arc_property(); diff --git a/src/netlist.c b/src/netlist.c index d68a8662..19697b46 100644 --- a/src/netlist.c +++ b/src/netlist.c @@ -373,14 +373,14 @@ int check_lib(char *s) found=0; tcleval("llength $xschem_libs"); - range = atoi(Tcl_GetStringResult(interp)); + range = atoi(tclresult()); dbg(1, "check_lib(): %s, range=%d\n", s, range); for(i=0;i> 16; ps_colors[i].green = (c & 0x00ff00) >> 8; ps_colors[i].blue = (c & 0x0000ff); @@ -389,7 +389,7 @@ void ps_draw(void) my_strdup(59, &tmp, "tk_getSaveFile -title {Select destination file} -initialdir $env(PWD)"); tcleval(tmp); my_free(878, &tmp); - r = Tcl_GetStringResult(interp); + r = tclresult(); if(r[0]) my_strncpy(plotfile, r, S(plotfile)); else { return; diff --git a/src/save.c b/src/save.c index f69d8a2b..c7f0757c 100644 --- a/src/save.c +++ b/src/save.c @@ -1838,7 +1838,7 @@ void create_sch_from_sym(void) my_strcat(354, &savecmd, schname); my_strcat(355, &savecmd, " ?\nWARNING: This schematic file already exists, it will be overwritten\""); tcleval(savecmd); - if(strcmp(Tcl_GetStringResult(interp), "yes") ) { + if(strcmp(tclresult(), "yes") ) { my_free(914, &savecmd); return; } diff --git a/src/scheduler.c b/src/scheduler.c index b9a0d8ea..a86cb4a6 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -213,7 +213,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg else if(!strcmp(argv[1],"make_symbol")) { if(has_x) tcleval("tk_messageBox -type okcancel -message {do you want to make symbol view ?}"); - if(!has_x || strcmp(Tcl_GetStringResult(interp),"ok")==0) + if(!has_x || strcmp(tclresult(),"ok")==0) if(current_type==SCHEMATIC) { save_schematic(schematic[currentsch]); @@ -373,7 +373,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg { if(modified && has_x) { tcleval("tk_messageBox -type okcancel -message {UNSAVED data: want to exit?}"); - if(strcmp(Tcl_GetStringResult(interp),"ok")==0) tcleval( "exit"); + if(strcmp(tclresult(),"ok")==0) tcleval( "exit"); } else tcleval( "exit"); Tcl_ResetResult(interp); @@ -1109,12 +1109,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } } - else if(!strcmp(argv[1],"fill_symbol_editprop_form") ) { - fill_symbol_editprop_form(0); - } - else if(!strcmp(argv[1],"update_symbol") ) { if(argc >= 3) update_symbol(argv[2],0); + else update_symbol(NULL, 0); } else if(!strcmp(argv[1], "print_hilight_net") && argc == 3) { @@ -1941,10 +1938,14 @@ void tcleval(const char str[]) { dbg(2, "tcleval(): %s\n", str); /* if( Tcl_EvalEx(interp, str, -1, TCL_EVAL_GLOBAL) != TCL_OK) {*/ - if( Tcl_Eval(interp, str) != TCL_OK) { + if( Tcl_GlobalEval(interp, str) != TCL_OK) { fprintf(errfp, "tcleval(): evaluation of script: %s failed\n", str); } } +const char *tclresult(void) +{ + return Tcl_GetStringResult(interp); +} void tclsetvar(const char *s, const char *value) { diff --git a/src/svgdraw.c b/src/svgdraw.c index d56a7b56..e40db5ef 100644 --- a/src/svgdraw.c +++ b/src/svgdraw.c @@ -393,7 +393,7 @@ static void fill_svg_colors() for(i=0;i> 16; svg_colors[i].green = (c & 0x00ff00) >> 8; svg_colors[i].blue = (c & 0x0000ff); @@ -419,7 +419,7 @@ void svg_draw(void) if(!plotfile[0]) { my_strdup(61, &tmpstring, "tk_getSaveFile -title {Select destination file} -initialdir $env(PWD)"); tcleval(tmpstring); - r = Tcl_GetStringResult(interp); + r = tclresult(); my_free(963, &tmpstring); if(r[0]) my_strncpy(plotfile, r, S(plotfile)); else return; diff --git a/src/token.c b/src/token.c index 10ab7091..9b964ddc 100644 --- a/src/token.c +++ b/src/token.c @@ -1544,7 +1544,7 @@ void print_spice_element(FILE *fd, int inst) my_snprintf(tclcmd, s, "tclpropeval {%s} {%s} {%s}", token, name, inst_ptr[inst].name); dbg(1, "tclpropeval {%s} {%s} {%s}", token, name, inst_ptr[inst].name); tcleval(tclcmd); - fprintf(fd, "%s", Tcl_GetStringResult(interp)); + fprintf(fd, "%s", tclresult()); my_free(1018, &tclcmd); } /* /20171029 */ /* 20151028 dont print escaping backslashes */ @@ -1798,7 +1798,7 @@ void print_tedax_element(FILE *fd, int inst) Tcl_ResetResult(interp); my_snprintf(tclcmd, s, "tclpropeval {%s} {%s} {%s}", token, name, inst_ptr[inst].name); tcleval(tclcmd); - fprintf(fd, "%s", Tcl_GetStringResult(interp)); + fprintf(fd, "%s", tclresult()); my_free(1032, &tclcmd); /* fprintf(errfp, "%s\n", tclcmd); */ } /* /20171029 */ @@ -2175,7 +2175,7 @@ void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 20071217 * Tcl_ResetResult(interp); my_snprintf(tclcmd, s, "tclpropeval {%s} {%s} {%s}", token, name, inst_ptr[inst].name); tcleval(tclcmd); - fprintf(fd, "%s", Tcl_GetStringResult(interp)); + fprintf(fd, "%s", tclresult()); my_free(1049, &tclcmd); } @@ -2347,7 +2347,7 @@ void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level primiti Tcl_ResetResult(interp); my_snprintf(tclcmd, s, "tclpropeval {%s} {%s} {%s}", token, name, inst_ptr[inst].name); tcleval(tclcmd); - fprintf(fd, "%s", Tcl_GetStringResult(interp)); + fprintf(fd, "%s", tclresult()); my_free(1057, &tclcmd); } /* 20180911 dont print escaping backslashes */ diff --git a/src/traduci.awk b/src/traduci.awk index e4a597e4..2fba272d 100755 --- a/src/traduci.awk +++ b/src/traduci.awk @@ -17,11 +17,12 @@ END { endfile(_filename_) } BEGIN{ } -/if(.*) *my_free/{ - $0 = gensub(/( +)(if\(.*\) +)(my_free.*)/, "\\1\\3","1") +/Tcl_GetStringResult\(interp\)/{ found = 1 + gsub(/Tcl_GetStringResult\(interp\)/, "tclresult()") } + function replace_pattern(old, new) { if($0 ~ old) { diff --git a/src/xinit.c b/src/xinit.c index 85217185..bf0c32e4 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -165,7 +165,7 @@ void windowid() mainwindow=Tk_MainWindow(interp); display = Tk_Display(mainwindow); tcleval( "winfo id ."); - sscanf(Tcl_GetStringResult(interp), "0x%x", (unsigned int *) &ww); + sscanf(tclresult(), "0x%x", (unsigned int *) &ww); framewin = ww; XQueryTree(display, framewin, &rootwindow, &parent_of_topwindow, &framewin_child_ptr, &framewindow_nchildren); dbg(1,"framewinID=%x\n", (unsigned int) framewin); @@ -393,9 +393,9 @@ void init_color_array(double dim) for(i=0;i=cadlayers){ + if(atoi(tclresult())>=cadlayers){ tcleval("set colors $dark_colors"); } } else { tcleval("llength $light_colors"); - if(atoi(Tcl_GetStringResult(interp)) >=cadlayers){ + if(atoi(tclresult()) >=cadlayers){ tcleval("set colors $light_colors"); } } tcleval("llength $colors"); - if(atoi(Tcl_GetStringResult(interp)) { # puts [wm geometry .dialog] set geom [wm geometry .dialog] - regsub {\+.*} $geom {} geom - set edit_prop_default_geometry $geom + regsub {\+.*} $geom {} edit_prop_size + regsub {[^+]*\+} $geom {+} edit_prop_pos } + wm geometry .dialog "${edit_prop_size}+$X+$Y" set prev_symbol $symbol set editprop_sympath [file dirname [abs_sym_path $symbol]] @@ -2027,7 +2022,6 @@ proc edit_prop {txtlabel} { set symbol [.dialog.f1.e2 get] set abssymbol [abs_sym_path $symbol] set rcode {ok} - set editprop_semaphore 0 set user_wants_copy_cell $copy_cell set prev_symbol [abs_sym_path $prev_symbol] if { ($abssymbol ne $prev_symbol) && $copy_cell } { @@ -2051,19 +2045,21 @@ proc edit_prop {txtlabel} { # puts "file copy [file rootname $prev_symbol].sym [file rootname $abssymbol].sym" } } - ## 20190326 } #puts "symbol: $symbol , prev_symbol: $prev_symbol" set copy_cell 0 ;# 20120919 + destroy .dialog } button .dialog.f1.b2 -text "Cancel" -command { set rcode {} - set editprop_semaphore 0 + set edit_symbol_prop_new_sel {} + destroy .dialog } wm protocol .dialog WM_DELETE_WINDOW { set rcode {} - set editprop_semaphore 0 + set edit_symbol_prop_new_sel {} + destroy .dialog } button .dialog.f1.b3 -text "Load" -command { @@ -2106,39 +2102,12 @@ proc edit_prop {txtlabel} { .dialog.f1.b2 invoke } } - #tkwait visibility .dialog - #grab set .dialog - #focus .dialog.e1 - #tkwait window .dialog - while {1} { - tkwait variable editprop_semaphore - if { $editprop_semaphore == 2 } { - set retval [.dialog.e1 get 1.0 {end - 1 chars}] - set symbol [ .dialog.f1.e2 get] - xschem update_symbol ok - set editprop_semaphore 1 - xschem fill_symbol_editprop_form - set editprop_sympath [file dirname [abs_sym_path $symbol]] - - # 20160423 no more setected stuff--> close - if {$editprop_semaphore==0 } { - break - } - # 20110325 update symbol variable after clicking another element to avoid - # modified flag to be set even when nothing changed - ## set symbol [ .dialog.f1.e2 get] - .dialog.e1 delete 1.0 end - .dialog.e1 insert 1.0 $retval - .dialog.f1.e2 delete 0 end - .dialog.f1.e2 insert 0 $symbol - } else { - break - } - + if {$edit_symbol_prop_new_sel == 1} { + wm geometry .dialog $edit_prop_pos } - destroy .dialog - set editprop_semaphore 0 + set edit_symbol_prop_new_sel 0 + tkwait window .dialog return $rcode } @@ -2602,7 +2571,9 @@ proc reconfigure_layers_menu {} { proc get_file_path {ff} { global env - if { [regexp {/} $ff] } { return $ff } + # Absolute path ? return as is. + # Linux Windows + if { [regexp {^/} $ff] || [regexp {^[a-zA-Z]:} $ff] } { return $ff } if {$::OS == "Windows"} { set pathlist [split $env(PATH) \;] } else { @@ -2612,6 +2583,7 @@ proc get_file_path {ff} { set ii $i/$ff if { [file exists $ii]} {return $ii} } + # nothing found, return $ff as is and hope for the best :-) return $ff } @@ -2865,10 +2837,10 @@ set_ne disable_unique_names 1 set_ne sym_txt 1 set_ne show_infowindow 0 set_ne symbol_width 150 -set_ne editprop_semaphore 0 set_ne editor {gvim -f} set_ne rainbow_colors 0 set_ne initial_geometry {700x448+10+10} +set_ne edit_symbol_prop_new_sel {} #20161102 set_ne launcher_var {} set_ne launcher_default_program {xdg-open} @@ -2879,7 +2851,7 @@ set_ne auto_hilight 0 set_ne to_png {gm convert} ## 20160325 remember edit_prop widget size -set_ne edit_prop_default_geometry 80x12 +set_ne edit_prop_size 80x12 set_ne text_line_default_geometry 80x12 set_ne terminal xterm diff --git a/xschem_library/devices/pnp.sym b/xschem_library/devices/pnp.sym index 0aee3b2e..db46c3d9 100644 --- a/xschem_library/devices/pnp.sym +++ b/xschem_library/devices/pnp.sym @@ -1,4 +1,4 @@ -v {xschem version=2.9.5_RC6 file_version=1.1} +v {xschem version=2.9.7 file_version=1.2} G {type=pnp format="@spiceprefix@name @pinlist @model area=@area" tedax_format="footprint @name @footprint @@ -19,7 +19,7 @@ B 5 17.5 27.5 22.5 32.5 {name=C dir=inout pinnumber=3} B 5 -22.5 -2.5 -17.5 2.5 {name=B dir=in pinnumber=1} B 5 17.5 -32.5 22.5 -27.5 {name=E dir=inout pinnumber=2} P 4 4 0 -10 15 -15 5 -25 0 -10 {fill=true} -T {@device} 20 -13.75 0 0 0.2 0.2 {} +T {@model} 20 -13.75 0 0 0.2 0.2 {} T {@name} 20 1.25 0 0 0.2 0.2 {} T {@#2:pinnumber} 25 -28.75 0 0 0.2 0.2 {layer=13} T {@#0:pinnumber} 25 17.5 0 0 0.2 0.2 {layer=13} diff --git a/xschem_library/devices/zener.sym b/xschem_library/devices/zener.sym index 46aedaff..12f15abf 100644 --- a/xschem_library/devices/zener.sym +++ b/xschem_library/devices/zener.sym @@ -1,4 +1,4 @@ -v {xschem version=2.9.5_RC5 file_version=1.1} +v {xschem version=2.9.7 file_version=1.2} G {type=diode format="@spiceprefix@name @pinlist @model" tedax_format="footprint @name @footprint @@ -16,6 +16,6 @@ B 5 -2.5 -32.5 2.5 -27.5 {name=p dir=inout pinnumber=1} B 5 -2.5 27.5 2.5 32.5 {name=m dir=inout pinnumber=2} P 4 4 -0 5 -10 -5 10 -5 -0 5 {fill=true} T {@name} 2.5 -20 0 0 0.2 0.2 {} -T {@device} 2.5 12.5 0 0 0.2 0.2 {} +T {@model} 2.5 12.5 0 0 0.2 0.2 {} T {@#0:pinnumber} -5 -26.25 0 1 0.2 0.2 {layer=13} T {@#1:pinnumber} -5 17.5 0 1 0.2 0.2 {layer=13}