OLD | NEW |
1 /* | 1 /* |
2 Scripts to create interactive selectionLists/Dropdown boxes in SVG using ECMA sc
ript | 2 Scripts to create interactive selectionLists/Dropdown boxes in SVG using ECMA sc
ript |
3 Copyright (C) <2006> <Andreas Neumann> | 3 Copyright (C) <2006> <Andreas Neumann> |
4 Version 1.4, 2006-07-18 | 4 Version 1.4, 2006-07-18 |
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 * Initial code was taken from Michel Hirtzler --> pilat.free.fr (thanks!) | 10 * Initial code was taken from Michel Hirtzler --> pilat.free.fr (thanks!) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 this.scrollBar = undefined; //later a reference to the scrollbar rectang
le | 141 this.scrollBar = undefined; //later a reference to the scrollbar rectang
le |
142 | 142 |
143 //status variables | 143 //status variables |
144 this.activeSelection = this.preSelect; //holds currently selected index
value | 144 this.activeSelection = this.preSelect; //holds currently selected index
value |
145 this.listOpen = false; //status folded=false, open=true - previously bee
n sLselectionVisible | 145 this.listOpen = false; //status folded=false, open=true - previously bee
n sLselectionVisible |
146 this.curLowerIndex = this.preSelect; //this value is adapted if the user
moves scrollbar | 146 this.curLowerIndex = this.preSelect; //this value is adapted if the user
moves scrollbar |
147 this.scrollStep = 0; //y-value to go for one element | 147 this.scrollStep = 0; //y-value to go for one element |
148 this.scrollerHeight = 0; //height of dragable scroller bar | 148 this.scrollerHeight = 0; //height of dragable scroller bar |
149 this.scrollActive = false; //determines if scrolling per up/down button
is active | 149 this.scrollActive = false; //determines if scrolling per up/down button
is active |
150 this.panY = false; //stores the y value of event | 150 this.panY = false; //stores the y value of event |
151 this.scrollCumulus = 0; //if value is less then a scrollstep we need to
accumulate scroll values | 151 this.scrollCumulus = 0; //if value is less than a scrollstep we need to
accumulate scroll values |
152 this.scrollDir = ""; //later holds "up" and "down" | 152 this.scrollDir = ""; //later holds "up" and "down" |
153 this.exists = true; //true means it exists, gets value false if method "
removeSelectionList" is called | 153 this.exists = true; //true means it exists, gets value false if method "
removeSelectionList" is called |
154 this.pressedKeys = ""; //stores key events (pressed char values) | 154 this.pressedKeys = ""; //stores key events (pressed char values) |
155 this.keyTimer = undefined; //timer for resetting character strings after
a given time period | 155 this.keyTimer = undefined; //timer for resetting character strings after
a given time period |
156 } | 156 } |
157 else { | 157 else { |
158 createSelbox = false; | 158 createSelbox = false; |
159 alert("Error ("+id+"): wrong nr of arguments! You have to pass over "+nr
Arguments+" parameters."); | 159 alert("Error ("+id+"): wrong nr of arguments! You have to pass over "+nr
Arguments+" parameters."); |
160 } | 160 } |
161 if (createSelbox) { | 161 if (createSelbox) { |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 var smallRectRight = document.getElementById("selPulldown_"+this.id); | 1056 var smallRectRight = document.getElementById("selPulldown_"+this.id); |
1057 smallRectRight.setAttributeNS(null,"x",this.xOffset + this.width - this.cell
Height); | 1057 smallRectRight.setAttributeNS(null,"x",this.xOffset + this.width - this.cell
Height); |
1058 //reposition triangle | 1058 //reposition triangle |
1059 var triangle = document.getElementById("selTriangle_"+this.id); | 1059 var triangle = document.getElementById("selTriangle_"+this.id); |
1060 var myTrianglePath = "M"+(this.xOffset + this.width - 3 * this.triangleFourt
h)+" "+(this.yOffset + this.triangleFourth)+" L"+(this.xOffset + this.width - th
is.triangleFourth)+" "+(this.yOffset + this.triangleFourth)+" L"+(this.xOffset +
this.width - 2 * this.triangleFourth)+" "+(this.yOffset + 3 * this.triangleFour
th)+" Z"; | 1060 var myTrianglePath = "M"+(this.xOffset + this.width - 3 * this.triangleFourt
h)+" "+(this.yOffset + this.triangleFourth)+" L"+(this.xOffset + this.width - th
is.triangleFourth)+" "+(this.yOffset + this.triangleFourth)+" L"+(this.xOffset +
this.width - 2 * this.triangleFourth)+" "+(this.yOffset + 3 * this.triangleFour
th)+" Z"; |
1061 triangle.setAttributeNS(null,"d",myTrianglePath); | 1061 triangle.setAttributeNS(null,"d",myTrianglePath); |
1062 //change sizes of rectbox below and above | 1062 //change sizes of rectbox below and above |
1063 this.rectBelowBox.setAttributeNS(null,"width",this.width - this.cellHeight); | 1063 this.rectBelowBox.setAttributeNS(null,"width",this.width - this.cellHeight); |
1064 this.rectAboveBox.setAttributeNS(null,"width",this.width - this.cellHeight); | 1064 this.rectAboveBox.setAttributeNS(null,"width",this.width - this.cellHeight); |
1065 } | 1065 } |
OLD | NEW |