floater=1 in text elements assumed as floater=true to avoid referencing instance no.1. Texts with @params will go thru translation using parent level param assignments in translate()
This commit is contained in:
parent
e97a75f65a
commit
98395824bc
|
|
@ -114,6 +114,7 @@ const char *get_text_floater(int i)
|
|||
instname = get_tok_value(xctx->text[i].prop_ptr, "name", 0);
|
||||
if(!xctx->tok_size) {
|
||||
instname = get_tok_value(xctx->text[i].prop_ptr, "floater", 0);
|
||||
if(xctx->tok_size && !strboolcmp(instname, "true")) instname = "true";
|
||||
}
|
||||
}
|
||||
inst = get_instance(instname);
|
||||
|
|
@ -940,7 +941,10 @@ int set_text_flags(xText *t)
|
|||
t->flags |= strboolcmp(str, "true") ? 0 : HIDE_TEXT;
|
||||
}
|
||||
str = get_tok_value(t->prop_ptr, "name", 0);
|
||||
if(!xctx->tok_size) str = get_tok_value(t->prop_ptr, "floater", 0);
|
||||
if(!xctx->tok_size) {
|
||||
str = get_tok_value(t->prop_ptr, "floater", 0);
|
||||
if(xctx->tok_size && !strboolcmp(str, "true")) str = "true";
|
||||
}
|
||||
t->flags |= xctx->tok_size ? TEXT_FLOATER : 0;
|
||||
my_strdup2(_ALLOC_ID_, &t->floater_instname, str);
|
||||
}
|
||||
|
|
@ -2290,6 +2294,7 @@ void get_sch_from_sym(char *filename, xSymbol *sym, int inst, int fallback)
|
|||
if(strcmp(tclresult(), "yes") ) fallback = 0; /* 'no' or 'cancel' */
|
||||
if(!strcmp(tclresult(), "") ) { /* 'cancel' */
|
||||
cancel = 1;
|
||||
my_strncpy(filename,"", PATH_MAX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
15
src/token.c
15
src/token.c
|
|
@ -5203,10 +5203,15 @@ const char *translate(int inst, const char* s)
|
|||
/* if spiceprefix==0 and token == @spiceprefix then set empty value */
|
||||
} else if(!sp_prefix && !strcmp(token, "@spiceprefix")) {
|
||||
/* add nothing */
|
||||
} else if(inst >= 0) {
|
||||
value = get_tok_value(xctx->inst[inst].prop_ptr, token+1, 0);
|
||||
if(!xctx->tok_size && xctx->inst[inst].ptr >= 0) {
|
||||
value=get_tok_value(xctx->sym[xctx->inst[inst].ptr].templ, token+1, 0);
|
||||
} else {
|
||||
if(inst >= 0) {
|
||||
value = get_tok_value(xctx->inst[inst].prop_ptr, token+1, 0);
|
||||
if(!xctx->tok_size && xctx->inst[inst].ptr >= 0) {
|
||||
value=get_tok_value(xctx->sym[xctx->inst[inst].ptr].templ, token+1, 0);
|
||||
}
|
||||
} else {
|
||||
xctx->tok_size = 1;
|
||||
value = token + 1;
|
||||
}
|
||||
if(!xctx->tok_size) { /* above lines did not find a value for token */
|
||||
if(token[0] =='%') {
|
||||
|
|
@ -5285,7 +5290,7 @@ const char *translate(int inst, const char* s)
|
|||
* can be calculated */
|
||||
my_strdup2(_ALLOC_ID_, &result, spice_get_node(tcl_hook2(result)));
|
||||
|
||||
if(is_expr(result)) {
|
||||
if(is_expr(result) && inst >= 0) {
|
||||
dbg(1, "translate(): expr():%s\n", result);
|
||||
my_strdup2(_ALLOC_ID_, &result, eval_expr(
|
||||
translate3(result, 1, xctx->inst[inst].prop_ptr, xctx->sym[xctx->inst[inst].ptr].templ,
|
||||
|
|
|
|||
Loading…
Reference in New Issue