New thumbnail selector

git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@3957 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Denis Zgonjanin 2010-03-22 00:23:22 +00:00
parent d2a92aa421
commit fbc37a9c17
3 changed files with 42 additions and 7 deletions

View File

@ -48,6 +48,7 @@
<mx:Script>
<![CDATA[
import mx.events.ListEvent;
import org.bigbluebutton.common.IBbbCanvas;
import mx.events.ResizeEvent;
import flexlib.containers.DockableToolBar;
@ -118,8 +119,7 @@
private var presenterName:String = "";
// The following code block is to deal with a bug in FLexLib
// with MDI windows not responding well to being maximized
// The following code block is to deal with FLexLib MDI windows not being able to be moved when maximized
private var savedWindowWidth:Number;
private var savedWindowHeight:Number;
private var savedX:Number;
@ -193,6 +193,11 @@
private function onCreationComplete():void{
thumbY = this.height - 160;
addEventListener(MDIWindowEvent.RESIZE_END, onResizeEndEvent);
slideView.addEventListener(ListEvent.ITEM_ROLL_OVER, onItemRollOver);
}
private function onItemRollOver(e:ListEvent):void{
this.displaySlideNumber(e.columnIndex + 1);
}
private function onResizeEndEvent(event:MDIWindowEvent):void {
@ -379,7 +384,7 @@
if (e.presentationName == currentPresentation) return;
currentPresentation = e.presentationName;
presentationLoaded = true;
slideView.slides = e.slides.slides;
slideView.setSlides(e.slides.slides);
slideView.visible = true;
if (slideManager != null) slideManager.clear();
@ -401,6 +406,7 @@
forwardButton.visible = show;
zoomSlider.visible = show;
btnResetZoom.visible = show;
slideNumLbl.visible = show;
// toolbarDocker.visible = show;
}
@ -444,14 +450,14 @@
}
private function displaySlideNumber(currentSlide:int):void {
slideNumLbl.text = ResourceUtil.getInstance().getString('bbb.presentation.pages', [currentSlide, slideView.slides.length]);
slideNumLbl.label = ResourceUtil.getInstance().getString('bbb.presentation.pages', [currentSlide, slideView.slides.length]);
}
private function clearPresentation(e:UploadEvent):void{
slideView.visible = false;
slideView.swfSlideLoader.source = null;
slideView.selectedSlide = 0;
slideNumLbl.text = "";
slideNumLbl.label = "";
displaySlideNavigationControls(false);
showUploadPresentationLabel(false);
@ -489,6 +495,10 @@
return val;
}
private function showThumbnails():void{
slideView.thumbnailView.visible = true;
}
private function addOverlayCanvas(e:AddOverlayCanvasEvent):void{
slideView.acceptOverlayCanvas(e.canvas);
e.canvas.acceptOverlayCanvas(slideView);
@ -525,7 +535,7 @@
<mx:Spacer width="50%" id="spacer1"/>
<mx:Button id="backButton" icon="{backwardIcon}" visible="false" width="30" height="20"
toolTip="Previous slide." click="gotoPreviousSlide()"/>
<mx:Label id="slideNumLbl" text=""/>
<mx:Button id="slideNumLbl" visible="false" label="" click="showThumbnails()"/>
<mx:Button id="forwardButton" icon="{forwardIcon}" visible="false" width="30" height="20"
toolTip="Next slide" click="gotoNextSlide()"/>
<mx:Spacer width="10%" id="spacer2"/>

View File

@ -116,6 +116,20 @@
overlayChildrenHolder.x = 0;
overlayChildrenHolder.y = 0;
}
public function setSlides(slides:ArrayCollection):void{
this.slides = slides;
thumbnailView.dataProvider = this.slides.toArray();
}
public function changeSlide():void{
dispatchEvent(new PresenterCommands(PresenterCommands.GOTO_SLIDE, thumbnailView.selectedIndex));
thumbnailView.visible = false;
}
private function changeIndex(e:ListEvent):void{
dispatchEvent(e);
}
private function onMouseDown(e:MouseEvent):void{
canvasMouseXOnMouseDown = canvasMouseX();
@ -539,10 +553,14 @@
moveCanvas(loaderX(), loaderY());
if (overlayCanvas != null) overlayCanvas.zoomCanvas(width, height);
}
]]>
</mx:Script>
<mx:SWFLoader id="swfSlideLoader" width="100%" height="100%" creationComplete="listenForSlideLoadedCompleteEvent()"
scaleContent="false" maintainAspectRatio="true" showBusyCursor="true" completeEffect="Fade"/>
scaleContent="false" maintainAspectRatio="true" showBusyCursor="true" completeEffect="Fade"/>
<mx:HorizontalList id="thumbnailView" itemRenderer="org.bigbluebutton.modules.present.views.Thumbnail" itemRollOver="changeIndex(event)"
visible="false" width="100%" height="100" y="{this.height - 100}" change="changeSlide()" />
</mx:Canvas>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalAlign="center"
verticalGap="0" borderStyle="none" backgroundAlpha="0" >
<mx:Image id="image" width="100" height="100" source="{data.thumb}"/>
</mx:VBox>