Index: lams_flex/LamsAuthor/src/LamsAuthor.mxml
===================================================================
RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/LamsAuthor.mxml,v
diff -u -r1.6 -r1.7
--- lams_flex/LamsAuthor/src/LamsAuthor.mxml 20 Jan 2010 00:16:04 -0000 1.6
+++ lams_flex/LamsAuthor/src/LamsAuthor.mxml 20 Jan 2010 02:35:33 -0000 1.7
@@ -58,12 +58,6 @@
[Embed("assets/icons/transition.png")]
public var transitionCursor:Class;
-
- [Embed("assets/icons/zoom_in.png")]
- public var zoomInCursor:Class;
-
- [Embed("assets/icons/zoom_out.png")]
- public var zoomOutCursor:Class;
public function changeCursorState(state:int):void{
cursorState = state;
@@ -74,12 +68,6 @@
case Constants.CURSOR_STATE_TRANSITION:
CursorManager.setCursor(transitionCursor);
break;
- case Constants.CURSOR_STATE_ZOOM_IN:
- CursorManager.setCursor(zoomInCursor);
- break;
- case Constants.CURSOR_STATE_ZOOM_OUT:
- CursorManager.setCursor(zoomOutCursor);
- break;
}
Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/CanvasBox.mxml
===================================================================
RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/CanvasBox.mxml,v
diff -u -r1.5 -r1.6
--- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/CanvasBox.mxml 20 Jan 2010 00:16:04 -0000 1.5
+++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/CanvasBox.mxml 20 Jan 2010 02:35:33 -0000 1.6
@@ -78,29 +78,8 @@
// Return cursor state to normal
Application.application.changeCursorState(Constants.CURSOR_STATE_NORMAL);
}
-
-
-
-
-
-
- /* private function doZoom(component:UIComponent,val:Number):void
- {
- component.scaleX = val;
- component.scaleY = val;
-
- if(component is Container)
- {
- var children:Array = Container(component).getChildren();
- for(var i:int = 0; i < children.length; i++)
- {
- doZoom(children[i], val);
- }
- }
- } */
-
- private function doZoom(event:MouseEvent):void
+ public function doZoom(isOut:Boolean):void
{
var zoom:Zoom = new Zoom();
@@ -111,13 +90,13 @@
zoom.zoomHeightFrom = currentZoom;
zoom.zoomWidthFrom = currentZoom;
- if (Application.application.cursorState == Constants.CURSOR_STATE_ZOOM_IN && currentZoom < MAX_ZOOM) {
+ if (!isOut && currentZoom < MAX_ZOOM) {
zoom.zoomHeightTo = currentZoom + ZOOM_LEVEL;
zoom.zoomWidthTo = currentZoom + ZOOM_LEVEL;
currentZoom += 0.2;
currentZoom = Math.round(currentZoom * 10)/10;
zoom.play([this], false);
- } else if (Application.application.cursorState == Constants.CURSOR_STATE_ZOOM_OUT && currentZoom > MIN_ZOOM) {
+ } else if (isOut && currentZoom > MIN_ZOOM) {
zoom.zoomHeightTo = currentZoom - ZOOM_LEVEL;
zoom.zoomWidthTo = currentZoom - ZOOM_LEVEL;
currentZoom -= 0.2;
Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/ToolBar.mxml
===================================================================
RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/Attic/ToolBar.mxml,v
diff -u -r1.3 -r1.4
--- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/ToolBar.mxml 20 Jan 2010 00:16:04 -0000 1.3
+++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/ToolBar.mxml 20 Jan 2010 02:35:33 -0000 1.4
@@ -32,6 +32,14 @@
}
+ public function doZoom(isOut:Boolean):void {
+ var canvasBox:CanvasBox = Application.application.canvasArea.canvasBox;
+
+ canvasBox.doZoom(isOut);
+
+ zoomInButton.enabled = canvasBox.currentZoom < canvasBox.MAX_ZOOM;
+ zoomOutButton.enabled = canvasBox.currentZoom > canvasBox.MIN_ZOOM;
+ }
]]>
@@ -64,8 +72,8 @@
-
-
+
+
Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/util/Constants.as
===================================================================
RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/util/Constants.as,v
diff -u -r1.4 -r1.5
--- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/util/Constants.as 20 Jan 2010 00:16:04 -0000 1.4
+++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/util/Constants.as 20 Jan 2010 02:35:33 -0000 1.5
@@ -17,8 +17,6 @@
public static const CURSOR_STATE_TRANSITION:int = 2;
public static const CURSOR_STATE_DATAFLOW:int = 3;
public static const CURSOR_STATE_HELP:int = 4;
- public static const CURSOR_STATE_ZOOM_IN:int = 5;
- public static const CURSOR_STATE_ZOOM_OUT:int = 6;
public static const UI_STATE_NORMAL:int = 1;
public static const UI_STATE_DRAWING:int = 2;