OpenLayers OpenLayers

Changeset 3893

Show
Ignore:
Timestamp:
08/11/07 11:26:40 (1 year ago)
Author:
tschaub
Message:

store evt on handler

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/tschaub/wfsv/lib/OpenLayers/Control/BoundsBox.js

    r3881 r3893  
    4848     * Parameters: 
    4949     * position - {<OpenLayers.Bounds>} or {<OpenLayers.Pixel>} 
    50      * evt - {Event} The browser event that finished the box. 
    5150     */ 
    52     returnBounds: function(position, evt) { 
     51    returnBounds: function(position) { 
    5352        var bounds; 
    5453        if(position instanceof OpenLayers.Bounds) { 
     
    6665                                           center.lon, center.lat); 
    6766        } 
    68         this.callback.apply(this.target, [bounds, evt]); 
     67        this.callback.apply(this.target, [bounds]); 
    6968    }, 
    7069 
  • sandbox/tschaub/wfsv/lib/OpenLayers/Control/FeatureEditor.js

    r3890 r3893  
    176176     * Parameters: 
    177177     * bounds - {<OpenLayers.Bounds>} 
    178      * evt - {Event} 
    179      */ 
    180     prepareRequest: function(bounds, evt) { 
     178     */ 
     179    prepareRequest: function(bounds) { 
    181180        var params = { 
    182181            service: "WFS", 
     
    190189        var url = this.url + "?" + OpenLayers.Util.getParameterString(params); 
    191190         
    192         // evt passed along for modifiers - find a better solution 
    193         this.requestFeatures(url, evt); 
     191        this.requestFeatures(url); 
    194192    }, 
    195193     
     
    200198     * Parameters: 
    201199     * url - {String} 
    202      * evt - {Event} 
    203      */ 
    204     requestFeatures: function(url, evt) { 
     200     */ 
     201    requestFeatures: function(url) { 
    205202        var callback; 
     203        var evt = this.featuresControl.handler.evt; 
    206204        if(evt.shiftKey) { 
    207205            callback = this.addFeatures; 
  • sandbox/tschaub/wfsv/lib/OpenLayers/Handler.js

    r3839 r3893  
    199199    register: function (name, method) { 
    200200        // TODO: deal with registerPriority in 3.0 
    201         this.map.events.registerPriority(name, this, method);    
     201        this.map.events.registerPriority(name, this, method); 
     202        this.map.events.registerPriority(name, this, this.setEvent); 
    202203    }, 
    203204 
     
    208209    unregister: function (name, method) { 
    209210        this.map.events.unregister(name, this, method);    
     211        this.map.events.unregister(name, this, this.setEvent); 
     212    }, 
     213     
     214    /** 
     215     * Method: setEvent 
     216     * With each registered browser event, the handler sets its own evt 
     217     *     property.  This property can be accessed by controls if needed 
     218     *     to get more information about the event that the handler is 
     219     *     processing. 
     220     * 
     221     * This allows modifier keys on the event to be checked (alt, shift, 
     222     *     and ctrl cannot be checked with the keyboard handler).  For a 
     223     *     control to determine which modifier keys are associated with the 
     224     *     event that a handler is currently processing, it should access 
     225     *     (code)handler.evt.altKey || handler.evt.shiftKey || 
     226     *     handler.evt.ctrlKey(end). 
     227     * 
     228     * Parameters: 
     229     * evt - {Event} The browser event. 
     230     */ 
     231    setEvent: function(evt) { 
     232        this.evt = evt; 
     233        return true; 
    210234    }, 
    211235 
  • sandbox/tschaub/wfsv/lib/OpenLayers/Handler/Box.js

    r3879 r3893  
    9898    * Method: endBox 
    9999    */ 
    100     endBox: function(end, evt) { 
     100    endBox: function(end) { 
    101101        var result; 
    102102        if (Math.abs(this.dragHandler.start.x - end.x) > 5 ||     
     
    116116        this.map.div.style.cursor = ""; 
    117117 
    118         this.callback("done", [result, evt]); 
     118        this.callback("done", [result]); 
    119119    }, 
    120120 
  • sandbox/tschaub/wfsv/lib/OpenLayers/Handler/Drag.js

    r3879 r3893  
    9494            // TBD replace with CSS classes 
    9595            this.map.div.style.cursor = "move"; 
    96             this.callback("down", [evt.xy, evt]); 
     96            this.callback("down", [evt.xy]); 
    9797            OpenLayers.Event.stop(evt); 
    9898            return false; 
     
    114114        if (this.started) { 
    115115            this.dragging = true; 
    116             this.callback("move", [evt.xy, evt]); 
     116            this.callback("move", [evt.xy]); 
    117117            if(!this.oldOnselectstart) { 
    118118                this.oldOnselectstart = document.onselectstart; 
     
    138138            // TBD replace with CSS classes 
    139139            this.map.div.style.cursor = ""; 
    140             this.callback("up", [evt.xy, evt]); 
    141             this.callback("done", [evt.xy, evt]); 
     140            this.callback("up", [evt.xy]); 
     141            this.callback("done", [evt.xy]); 
    142142            document.onselectstart = this.oldOnselectstart; 
    143143        } 
     
    161161            // TBD replace with CSS classes 
    162162            this.map.div.style.cursor = ""; 
    163             this.callback("out", [evt]); 
     163            this.callback("out", []); 
    164164            if(document.onselectstart) { 
    165165                document.onselectstart = this.oldOnselectstart; 
    166166            } 
    167             this.callback("done", [evt.xy, evt]) 
     167            this.callback("done", [evt.xy]) 
    168168        } 
    169169        return true;