| OLD | NEW |
| 1 /* | 1 /* |
| 2 Scripts to create interactive comboboxes in SVG using ECMA script | 2 Scripts to create interactive comboboxes in SVG using ECMA script |
| 3 Copyright (C) <2006> <Andreas Neumann> | 3 Copyright (C) <2006> <Andreas Neumann> |
| 4 Version 1.2.1, 2006-10-03 | 4 Version 1.2.1, 2006-10-03 |
| 5 neumann@karto.baug.ethz.ch | 5 neumann@karto.baug.ethz.ch |
| 6 http://www.carto.net/ | 6 http://www.carto.net/ |
| 7 http://www.carto.net/neumann/ | 7 http://www.carto.net/neumann/ |
| 8 | 8 |
| 9 Credits: | 9 Credits: |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 this.triangleFourth = Math.round(this.cellHeight / 4); //this is only us
ed internally | 111 this.triangleFourth = Math.round(this.cellHeight / 4); //this is only us
ed internally |
| 112 this.textPadding = textPadding; //this is relative to the left of the ce
ll | 112 this.textPadding = textPadding; //this is relative to the left of the ce
ll |
| 113 this.textPaddingVertical = this.cellHeight - (this.cellHeight - this.tex
tStyles["font-size"]) * 0.7; //this is relative to the top of the cell | 113 this.textPaddingVertical = this.cellHeight - (this.cellHeight - this.tex
tStyles["font-size"]) * 0.7; //this is relative to the top of the cell |
| 114 this.scrollerMinHeight = this.cellHeight * 0.5; //minimal height of the
scroller rect | 114 this.scrollerMinHeight = this.cellHeight * 0.5; //minimal height of the
scroller rect |
| 115 | 115 |
| 116 //status variables | 116 //status variables |
| 117 this.scrollStep = 0; //y-value to go for one element | 117 this.scrollStep = 0; //y-value to go for one element |
| 118 this.scrollerHeight = 0; //height of dragable scroller bar | 118 this.scrollerHeight = 0; //height of dragable scroller bar |
| 119 this.scrollActive = false; //determines if scrolling per up/down button
is active | 119 this.scrollActive = false; //determines if scrolling per up/down button
is active |
| 120 this.panY = false; //stores the y value of event | 120 this.panY = false; //stores the y value of event |
| 121 this.scrollCumulus = 0; //if value is less then a scrollstep we need to
accumulate scroll values | 121 this.scrollCumulus = 0; //if value is less than a scrollstep we need to
accumulate scroll values |
| 122 this.scrollDir = ""; //later holds "up" and "down" | 122 this.scrollDir = ""; //later holds "up" and "down" |
| 123 this.exists = true; //true means it exists, gets value false if method "
removeSelectionList" is called | 123 this.exists = true; //true means it exists, gets value false if method "
removeSelectionList" is called |
| 124 this.mouseDownStatus = false; //status that specifies if mouse is down o
r up on individual elements | 124 this.mouseDownStatus = false; //status that specifies if mouse is down o
r up on individual elements |
| 125 this.pressedKeys = ""; //stores key events (pressed char values) | 125 this.pressedKeys = ""; //stores key events (pressed char values) |
| 126 this.keyTimer = undefined; | 126 this.keyTimer = undefined; |
| 127 this.svgRootHasEventListener = false; //status variable to define if svg
root has key and mouseover listener or not | 127 this.svgRootHasEventListener = false; //status variable to define if svg
root has key and mouseover listener or not |
| 128 } | 128 } |
| 129 else { | 129 else { |
| 130 createCombobox = false; | 130 createCombobox = false; |
| 131 alert("Error ("+id+"): wrong nr of arguments! You have to pass over "+nr
Arguments+" parameters."); | 131 alert("Error ("+id+"): wrong nr of arguments! You have to pass over "+nr
Arguments+" parameters."); |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 return selectedArrayIndizes; | 1169 return selectedArrayIndizes; |
| 1170 } | 1170 } |
| 1171 | 1171 |
| 1172 combobox.prototype.removeCombobox = function() { | 1172 combobox.prototype.removeCombobox = function() { |
| 1173 //remove all Elements of combobox | 1173 //remove all Elements of combobox |
| 1174 this.exists = false; | 1174 this.exists = false; |
| 1175 while (this.parentGroup.hasChildNodes()) { | 1175 while (this.parentGroup.hasChildNodes()) { |
| 1176 this.parentGroup.removeChild(this.parentGroup.firstChild); | 1176 this.parentGroup.removeChild(this.parentGroup.firstChild); |
| 1177 } | 1177 } |
| 1178 } | 1178 } |
| OLD | NEW |