small improvements in edit_text_property() and get_instance()

This commit is contained in:
stefan schippers 2023-11-02 13:24:15 +01:00
parent 52c65f9d34
commit 722b1f4575
6 changed files with 16 additions and 10 deletions

View File

@ -93,7 +93,7 @@ p{padding: 15px 30px 10px;}
installation, for example in /usr/local):
</p>
<pre class="code">
user:~$ make install
user:~$ sudo make install
</pre>
<p>
This will install all the runtime needed files into the locations previously configured
@ -111,7 +111,7 @@ p{padding: 15px 30px 10px;}
<kbd>xschem-&lt;version&gt;/src/</kbd> without installation.
</p><br>
<pre class="code">
user:~$ cd xschem-2.7.0/src && ./xschem
user:~$ cd xschem-2.7.0/src &amp;&amp; ./xschem
</pre>
<p>
When xschem is running, type <kbd>puts $XSCHEM_LIBRARY_PATH</kbd> in the xschem tcl prompt to

View File

@ -1222,7 +1222,7 @@ static int edit_text_property(int x)
modified = 1;
xctx->push_undo();
}
set_modify(-2); /* clear text floater caches */
/* set_modify(-2); */ /* ? Not needed, overkill... clear text floater caches */
for(k=0;k<xctx->lastsel; ++k)
{
if(xctx->sel_array[k].type!=xTEXT) continue;
@ -1273,7 +1273,7 @@ static int edit_text_property(int x)
}
my_strdup2(_ALLOC_ID_, &xctx->text[sel].txt_ptr, (char *) tclgetvar("retval"));
}
if(x==0 && props_changed) {
if(props_changed) {
if(oldprop && preserve)
set_different_token(&xctx->text[sel].prop_ptr, (char *) tclgetvar("props"), oldprop);
else
@ -1282,6 +1282,9 @@ static int edit_text_property(int x)
my_free(_ALLOC_ID_, &xctx->text[sel].floater_ptr);
set_text_flags(&xctx->text[sel]);
}
if(text_changed || props_changed) {
get_text_floater(sel);
}
if(size_changed) {
xctx->text[sel].xscale=hsize;
xctx->text[sel].yscale=vsize;

View File

@ -624,7 +624,7 @@ static int bus_search(const char*s)
}
#ifndef __unix__
static int win_regexec(const char *options, const char *pattern, char *name)
static int win_regexec(const char *options, const char *pattern, const char *name)
{
if (options!=NULL)
tclvareval("regexp {", options,"} {", pattern, "} {", name, "}", NULL);

View File

@ -69,7 +69,7 @@ static int get_symbol(const char *s)
int get_instance(const char *s)
{
int i, found=0;
int i = -1, found=0;
Int_hashentry *entry;
if(isonlydigit(s)) {
@ -78,8 +78,10 @@ int get_instance(const char *s)
}
else if(xctx->floater_inst_table.table) {
entry = int_hash_lookup(&xctx->floater_inst_table, s, 0, XLOOKUP);
i = entry ? entry->value : -1;
found = 1;
if(entry) {
i = entry->value;
found = 1;
}
} else {
for(i=0;i<xctx->instances; ++i) {
if(!strcmp(xctx->inst[i].instname, s)) {

View File

@ -6416,6 +6416,7 @@ global env has_x OS autofocus_mainwindow
bind $topwin <Alt-ButtonPress> {xschem callback %W %T %x %y 0 %b 0 [expr {$Mod1Mask}]}
bind $topwin <Control-Alt-ButtonPress> {xschem callback %W %T %x %y 0 %b 0 [expr {$ControlMask + $Mod1Mask}]}
bind $topwin <Shift-Alt-ButtonPress> {xschem callback %W %T %x %y 0 %b 0 [expr {$ShiftMask + $Mod1Mask}]}
bind $topwin <Alt-Motion> {xschem callback %W %T %x %y 0 0 0 [expr {$Mod1Mask+%s}]}
bind $topwin <Alt-KeyPress> {xschem callback %W %T %x %y %N 0 0 [expr {$Mod1Mask}]}
bind $topwin <Control-Alt-KeyPress> {xschem callback %W %T %x %y %N 0 0 [expr {$ControlMask + $Mod1Mask}]}
bind $topwin <Shift-Alt-KeyPress> {xschem callback %W %T %x %y %N 0 0 [expr {$ShiftMask + $Mod1Mask}]}

View File

@ -4,7 +4,7 @@
# This file is part of XSCHEM,
# a schematic capture and Spice/Vhdl/Verilog netlisting tool for circuit
# simulation.
# Copyright (C) 1998-2022 Stefan Frederik Schippers
# Copyright (C) 1998-2023 Stefan Frederik Schippers
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -57,4 +57,4 @@ foreach tc $tcases {
}
source test_utility.tcl
exec $xschem_cmd --pipe -q --script xschemtest.tcl > stefan_xschemtest.log 2>@1
exec $xschem_cmd --pipe -q --script xschemtest.tcl 2>&1 > stefan_xschemtest.log