svghmi/widget_input.ysl2
branchsvghmi
changeset 3001 003fd80ff0b8
parent 2929 9179cbc6fc49
child 3004 705e34c6fe93
equal deleted inserted replaced
3000:a9a45977bac0 3001:003fd80ff0b8
    24     foreach "$hmi_element/*[regexp:test(@inkscape:label,'^[=+\-].+')]" {
    24     foreach "$hmi_element/*[regexp:test(@inkscape:label,'^[=+\-].+')]" {
    25     |         id("«@id»").setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_op_click('«func:escape_quotes(@inkscape:label)»')");
    25     |         id("«@id»").setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_op_click('«func:escape_quotes(@inkscape:label)»')");
    26     }
    26     }
    27     |     },
    27     |     },
    28     |     on_op_click: function(opstr) {
    28     |     on_op_click: function(opstr) {
    29     |         let orig = this.indexes[0];
    29     |         let new_val = change_hmi_value(this.get_idx(0), opstr);
    30     |         let idx = this.offset ? orig - this.offset : orig;
       
    31     |         let new_val = change_hmi_value(idx, opstr);
       
    32     //     if "$have_value"{
    30     //     if "$have_value"{
    33     // |         this.value_elt.textContent = String(new_val);
    31     // |         this.value_elt.textContent = String(new_val);
    34     //           /* TODO gray out value until refreshed */
    32     //           /* TODO gray out value until refreshed */
    35     //     }
    33     //     }
    36     |     },
    34     |     },
    37     |     on_edit_click: function(opstr) {
    35     |     on_edit_click: function(opstr) {
    38     |         edit_value("«path/@value»", "«path/@type»", this, this.last_val);
    36     |         edit_value("«path/@value»", "«path/@type»", this, this.last_val);
    39     |     },
    37     |     },
    40 
    38 
    41     |     edit_callback: function(new_val) {
    39     |     edit_callback: function(new_val) {
    42     |         let orig = this.indexes[0];
    40     |         apply_hmi_value(this.get_idx(0), new_val);
    43     |         let idx = this.offset ? orig - this.offset : orig;
       
    44     |         apply_hmi_value(idx, new_val);
       
    45     //     if "$have_value"{
    41     //     if "$have_value"{
    46     // |         this.value_elt.textContent = String(new_val);
    42     // |         this.value_elt.textContent = String(new_val);
    47     //           /* TODO gray out value until refreshed */
    43     //           /* TODO gray out value until refreshed */
    48     //     }
    44     //     }
    49     |     },
    45     |     },