Permalink
Browse files

added mousewheel to ModestMapsSample, fixed a small issue in TilePainter

git-svn-id: https://modestmaps.googlecode.com/svn/trunk/as3@823 a23cadb0-8de1-11de-82e5-a1837a67dc72
  • Loading branch information...
tom
tom committed Aug 21, 2009
1 parent 6946835 commit 41c42ac7eab15bdb9ac5b71fc0c0f6e2bb91e122
@@ -340,10 +340,12 @@ package com.modestmaps.core.painter
openRequests.splice(i,1);
delete layersNeeded[loader.name];
var tile:Tile = loaderTiles[loader] as Tile;
tile.paintError(provider.tileWidth, provider.tileHeight);
tileGrid.tilePainted(tile);
loaderTiles[loader] = null;
delete loaderTiles[loader];
if (tile) {
tile.paintError(provider.tileWidth, provider.tileHeight);
tileGrid.tilePainted(tile);
loaderTiles[loader] = null;
delete loaderTiles[loader];
}
}
}
}
@@ -1 +1 @@
package { import com.modestmaps.mapproviders.IMapProvider; import flash.display.Sprite; import flash.events.MouseEvent; import flash.filters.DropShadowFilter; import flash.geom.ColorTransform; import flash.text.TextField; import flash.text.TextFormat; /** * Button for use in ModestMaps Sample * * @author David Knape */ public class MapProviderButton extends Sprite { private var label:TextField; public var mapProvider:IMapProvider; private var overTransform:ColorTransform = new ColorTransform(1,1,1); private var outTransform:ColorTransform = new ColorTransform(1,.9,.6); private var normalFormat:TextFormat = new TextFormat( 'Verdana', 10, 0x000000, false); private var selectedFormat:TextFormat = new TextFormat( 'Verdana', 10, 0x000000, true); private var _selected:Boolean = false; public function MapProviderButton( label_text:String, map_provider:IMapProvider, selected:Boolean=false ) { useHandCursor = true; mouseChildren = false; buttonMode = true; addEventListener(MouseEvent.MOUSE_OVER, onMouseOver); addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); mapProvider = map_provider; filters = [ new DropShadowFilter(1,45,0,1,3,3,.7,2) ]; transform.colorTransform = outTransform; // create label label = new TextField(); label.selectable = false; label.defaultTextFormat = normalFormat; label.text = label_text; label.width = label.textWidth + 8; label.height = 18; label.x = label.y=1; addChild( label ); this.selected = selected; // create background graphics.clear(); graphics.beginFill(0xdddddd); graphics.drawRoundRect(0, 0, 110, 18, 9, 9); graphics.beginFill(0xffffff); graphics.drawRoundRect(0, 0, 108, 16, 9, 9); graphics.beginFill(0xbbbbbb); graphics.drawRoundRect(2, 2, 108, 16, 9, 9); graphics.beginFill(0xdddddd); graphics.drawRoundRect(1, 1, 108, 16, 9, 9); } public function onMouseOver(event:MouseEvent=null):void { transform.colorTransform = overTransform; } public function onMouseOut(event:MouseEvent=null):void { transform.colorTransform = outTransform; } public function set selected(s:Boolean):void { _selected = s; label.setTextFormat(s ? selectedFormat : normalFormat); } public function get selected():Boolean { return _selected; } }}
package { import com.modestmaps.mapproviders.IMapProvider; import flash.display.Sprite; import flash.events.MouseEvent; import flash.filters.DropShadowFilter; import flash.geom.ColorTransform; import flash.text.TextField; import flash.text.TextFormat; /** * Button for use in ModestMaps Sample * * @author David Knape */ public class MapProviderButton extends Sprite { private var label:TextField; public var mapProvider:IMapProvider; private var overTransform:ColorTransform = new ColorTransform(1,1,1); private var outTransform:ColorTransform = new ColorTransform(1,.9,.6); private var normalFormat:TextFormat = new TextFormat( 'Verdana', 10, 0x000000, false); private var selectedFormat:TextFormat = new TextFormat( 'Verdana', 10, 0x000000, true); private var _selected:Boolean = false; public function MapProviderButton( label_text:String, map_provider:IMapProvider, selected:Boolean=false ) { useHandCursor = true; mouseChildren = false; buttonMode = true; addEventListener(MouseEvent.MOUSE_OVER, onMouseOver); addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); mapProvider = map_provider; filters = [ new DropShadowFilter(1,45,0,1,3,3,.7,2) ]; transform.colorTransform = outTransform; // create label label = new TextField(); label.selectable = false; label.defaultTextFormat = normalFormat; label.text = label_text; label.width = label.textWidth + 8; label.height = 18; label.x = label.y = 1; addChild(label); this.selected = selected; // create background graphics.clear(); graphics.beginFill(0xdddddd); graphics.drawRoundRect(0, 0, label.width+2, 18, 9, 9); graphics.beginFill(0xffffff); graphics.drawRoundRect(0, 0, label.width, 16, 9, 9); graphics.beginFill(0xbbbbbb); graphics.drawRoundRect(2, 2, label.width, 16, 9, 9); graphics.beginFill(0xdddddd); graphics.drawRoundRect(1, 1, label.width, 16, 9, 9); } public function onMouseOver(event:MouseEvent=null):void { transform.colorTransform = overTransform; } public function onMouseOut(event:MouseEvent=null):void { transform.colorTransform = outTransform; } public function set selected(s:Boolean):void { _selected = s; label.setTextFormat(s ? selectedFormat : normalFormat); } public function get selected():Boolean { return _selected; } }}
Oops, something went wrong.

0 comments on commit 41c42ac

Please sign in to comment.