- don't show toolbar when presentation is hidden or minimized

This commit is contained in:
Richard Alam 2012-12-28 17:19:10 +00:00
parent b6c7568778
commit 67860910a6

View File

@ -25,7 +25,7 @@
xmlns:view="org.bigbluebutton.modules.whiteboard.views.*"
xmlns:wbBtns="org.bigbluebutton.modules.whiteboard.views.buttons.*"
xmlns:mate="http://mate.asfusion.com/" creationComplete="onCreationComplete()"
visible="true" styleName="whiteboardToolbarStyle">
visible="{showWhiteboardToolbar}" styleName="whiteboardToolbarStyle">
<mate:Listener type="{MadePresenterEvent.SWITCH_TO_PRESENTER_MODE}" method="presenterMode" />
<mate:Listener type="{MadePresenterEvent.SWITCH_TO_VIEWER_MODE}" method="viewerMode" />
@ -100,6 +100,8 @@
[Bindable] private var select_icon:Class = images.select_icon;
[Bindable] private var grid_icon:Class = images.grid_icon;
[Bindable] private var showWhiteboardToolbar:Boolean = true;
public var canvas:WhiteboardCanvas;
private var presentationWindow:PresentationWindow;
@ -207,35 +209,43 @@
sendUndoCommand();
}
private function showToolbar(e:PresentationEvent):void {
this.visible = true;
}
private function sendUndoCommand():void {
if (!canvas.isPageEmpty())
dispatchEvent(new WhiteboardDrawEvent(WhiteboardDrawEvent.UNDO));
}
public function positionToolbar(window:PresentationWindow):void {
trace("Positioning whiteboard toolbar");
presentationWindow = window;
presentationWindow.addEventListener(MoveEvent.MOVE, setPositionAndDepth);
presentationWindow.addEventListener(ResizeEvent.RESIZE, setPositionAndDepth);
presentationWindow.addEventListener(MouseEvent.CLICK, setPositionAndDepth);
this.x = presentationWindow.x + presentationWindow.width + 3;
this.y = presentationWindow.y + 30;
hideOrDisplayToolbar();
parent.setChildIndex(this, parent.numChildren - 1);
}
private function setPositionAndDepth(e:Event = null):void {
this.x = presentationWindow.x + presentationWindow.width + 3;
this.y = presentationWindow.y + 30;
hideOrDisplayToolbar();
parent.setChildIndex(this, parent.numChildren - 1);
}
private function closeToolbar(e:StopWhiteboardModuleEvent):void {
parent.removeChild(this);
}
private function hideOrDisplayToolbar():void {
if (presentationWindow != null && presentationWindow.visible && ! presentationWindow.minimized) {
trace("Positioning whiteboard toolbar: showing");
showWhiteboardToolbar = true;
} else {
trace("Positioning whiteboard toolbar: not showing");
showWhiteboardToolbar = false;
}
}
private function graphicObjSelected(event:GraphicObjectFocusEvent):void {
var gobj:GraphicObject = event.data;
@ -254,20 +264,20 @@
that identifies the "category" of the tool (ex. shape vs text), and the other specifies the
tool itself (ex. line tool vs triangle tool, even though both are "shapes")
-->
<wbBtns:PanZoomButton id="panzoomBtn"/>
<mx:Spacer height="10"/>
<wbBtns:ScribbleButton id="scribbleBtn"/>
<wbBtns:RectangleButton id="rectangleBtn"/>
<wbBtns:CircleButton id="circleBtn"/>
<wbBtns:TriangleButton id="triangleBtn"/>
<wbBtns:LineButton id="lineBtn"/>
<wbBtns:TextButton id="textBtn"/>
<wbBtns:PanZoomButton id="panzoomBtn" visible="{showWhiteboardToolbar}"/>
<mx:Spacer height="10" visible="{showWhiteboardToolbar}"/>
<wbBtns:ScribbleButton id="scribbleBtn" visible="{showWhiteboardToolbar}"/>
<wbBtns:RectangleButton id="rectangleBtn" visible="{showWhiteboardToolbar}"/>
<wbBtns:CircleButton id="circleBtn" visible="{showWhiteboardToolbar}"/>
<wbBtns:TriangleButton id="triangleBtn" visible="{showWhiteboardToolbar}"/>
<wbBtns:LineButton id="lineBtn" visible="{showWhiteboardToolbar}"/>
<wbBtns:TextButton id="textBtn" visible="{showWhiteboardToolbar}"/>
<mx:Spacer height="5"/>
<wbBtns:ClearButton id="clearBtn"/>
<wbBtns:UndoButton id="undoBtn"/>
<mx:Spacer height="5" visible="{showWhiteboardToolbar}"/>
<wbBtns:ClearButton id="clearBtn" visible="{showWhiteboardToolbar}"/>
<wbBtns:UndoButton id="undoBtn" visible="{showWhiteboardToolbar}" />
<mx:Spacer height="5"/>
<mx:Spacer height="5" visible="{showWhiteboardToolbar}"/>
<!--
Properties that were removed from original color picker:
@ -280,14 +290,16 @@
of ColorPickers, one for the "line" color for the outlines of shapes, and the other for
the "fill" color that is used only if "fill" is enabled in WhiteboardCanvasModel
-->
<mx:ColorPicker change="changeColor(event)" id="cpik" selectedColor="0x000000" toolTip="{ResourceUtil.getInstance().getString('bbb.highlighter.toolbar.color')}"/>
<mx:ColorPicker change="changeColor(event)" id="cpik" visible="{showWhiteboardToolbar}"
selectedColor="0x000000"
toolTip="{ResourceUtil.getInstance().getString('bbb.highlighter.toolbar.color')}"/>
<mx:Spacer height="3" />
<mx:Image source="{thick_icon}" horizontalAlign="center" width="20"/>
<mx:VSlider height="50" id="sld" change="changeThickness(event)"
<mx:Spacer height="3" visible="{showWhiteboardToolbar}"/>
<mx:Image source="{thick_icon}" horizontalAlign="center" width="20" visible="{showWhiteboardToolbar}"/>
<mx:VSlider height="50" id="sld" change="changeThickness(event)" visible="{showWhiteboardToolbar}"
toolTip="{ResourceUtil.getInstance().getString('bbb.highlighter.toolbar.thickness')}"
minimum="2" maximum="20"
useHandCursor="true" value="2" showDataTip="true" snapInterval="1" dataTipOffset="0" labelOffset="0" />
<mx:Image source="{thin_icon}" horizontalAlign="center" width="20" />
<mx:Image source="{thin_icon}" horizontalAlign="center" width="20" visible="{showWhiteboardToolbar}"/>
</mx:VBox>