summaryrefslogtreecommitdiff
path: root/js/Misc/TEXT_f.js
blob: 6e3dfeed5bb41ab290c6d89237e6aa9114fb3f21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* autogenerated from "macros/Misc/TEXT_f.sci" */
function TEXT_f() {
    TEXT_f.prototype.define = function TEXT_f() {
        font = 2;
        siz = 1;
        model = scicos_model();
        model.sim = "text";
        model.rpar = "Text";
        model.ipar = [[font],[siz]];
        exprs = [["Text"],[string(font)],[string(siz)]];
        graphics = scicos_graphics();
        graphics.orig = [0,0];
        graphics.sz = [2,1];
        graphics.exprs = exprs;
        x = mlist(["Text","graphics","model","void","gui"],graphics,model," ","TEXT_f");
    }
    TEXT_f.prototype.details = function TEXT_f() {
    }
    TEXT_f.prototype.get = function TEXT_f() {
    }
    TEXT_f.prototype.set = function TEXT_f() {
        x = arg1;
        graphics = arg1.graphics;
        orig = graphics.orig;
        exprs = graphics.exprs;
        model = arg1.model;
        if (size(exprs,"*")==1) {
        exprs = [[exprs],["3"],["1"]];
}
        while (true) {
        [ok,txt,font,siz,exprs] = scicos_getvalue("Set Text block parameters",[["Text"],["Font number"],["Font size"]],list("str",-1,"vec",1,"vec",1),exprs);
        if (!ok) {
break;
}
        if (font<=0||font>6) {
message("Font number must be greater than 0 and less than 7");
        ok = false;
}
        if (siz<0) {
message("Font size must be positive");
        ok = false;
}
        if (ok) {
        graphics.exprs = exprs;
        gh_winpal = gca();
        default_font_style = gh_winpal.font_style;
        default_font_size = gh_winpal.font_size;
        default_font_color = gh_winpal.font_color;
        gh_winpal.font_style = font;
        gh_winpal.font_size = siz;
        r = xstringl(0,0,exprs[1-1],evstr(exprs[2-1]),evstr(exprs[3-1]));
        gh_winpal.font_style = default_font_style;
        gh_winpal.font_size = default_font_size;
        gh_winpal.font_color = default_font_color;
        sz = r.slice(3-1,4);
        graphics.sz = sz;
        x.graphics = graphics;
        ipar = [[font],[siz]];
        model.rpar = txt;
        model.ipar = ipar;
        x.model = model;
break;
}
}
    }
}