Index: lams_central/src/flash/org/lamsfoundation/lams/authoring/tb/ToolbarView.as =================================================================== diff -u -rb3be294808667a4c67858b7ac07e0f2bb19f0baf -r97ba514663676e3cd1699114608967144cbb9889 --- lams_central/src/flash/org/lamsfoundation/lams/authoring/tb/ToolbarView.as (.../ToolbarView.as) (revision b3be294808667a4c67858b7ac07e0f2bb19f0baf) +++ lams_central/src/flash/org/lamsfoundation/lams/authoring/tb/ToolbarView.as (.../ToolbarView.as) (revision 97ba514663676e3cd1699114608967144cbb9889) @@ -2,6 +2,7 @@ import org.lamsfoundation.lams.authoring.tb.* import org.lamsfoundation.lams.common.mvc.* import org.lamsfoundation.lams.common.style.* +import org.lamsfoundation.lams.common.dict.* import mx.managers.* import mx.controls.* /* @@ -21,8 +22,8 @@ private var optional_btn:Button; private var gate_btn:Button; private var preview_btn:Button; + private var _dictionary:Dictionary; - //Defined so compiler can 'see' events added at runtime by EventDispatcher private var dispatchEvent:Function; public var addEventListener:Function; @@ -35,9 +36,12 @@ * Constructor */ public function ToolbarView (){ - //Set up to use Flash Event Delegation model + //Set up to use Flash Event Delegation model + mx.events.EventDispatcher.initialize(this); _tm = ThemeManager.getInstance(); + _dictionary = Dictionary.getInstance(); + _dictionary.addEventListener('init',Proxy.create(this,setupLabels)); } /** @@ -46,6 +50,8 @@ public function init(m:Observable, c:Controller) { //Invoke superconstructor, which sets up MVC relationships. super (m, c); + + //In one frame call createToolbar this gives components one frame to setup etc. MovieClipUtils.doLater(Proxy.create(this,createToolbar)); } @@ -64,7 +70,9 @@ //Add the button handlers, essentially this is handing on clicked event to controller. var controller = getController(); - + + + _toolbar_mc.new_btn.addEventListener("click",controller); _toolbar_mc.open_btn.addEventListener("click",controller); _toolbar_mc.save_btn.addEventListener("click",controller); @@ -82,7 +90,20 @@ //Now that view is setup dispatch loaded event dispatchEvent({type:'load',target:this}); } - + public function setupLabels(){ + + _toolbar_mc.new_btn.label = Dictionary.getValue('new_btn'); + _toolbar_mc.open_btn.label = Dictionary.getValue('open_btn'); + _toolbar_mc.save_btn.label = Dictionary.getValue('save_btn'); + _toolbar_mc.copy_btn.label = Dictionary.getValue('copy_btn'); + _toolbar_mc.paste_btn.label = Dictionary.getValue('paste_btn'); + _toolbar_mc.trans_btn.label = Dictionary.getValue('trans_btn'); + _toolbar_mc.optional_btn.label = Dictionary.getValue('optional_btn'); + _toolbar_mc.gate_btn.label = Dictionary.getValue('gate_btn'); + _toolbar_mc.group_btn.label = Dictionary.getValue('group_btn'); + _toolbar_mc.preview_btn.label = Dictionary.getValue('preview_btn'); + + } /* * Updates state of the Toolbar, called by Toolbar Model *