<?xml version="1.0" encoding="utf-8"?>
<mx:VBox
xmlns:mx="http://www.adobe.com/2006/mxml"
- xmlns:halcyon="net.systemeD.halcyon.*">
+ xmlns:halcyon="net.systemeD.halcyon.*"
+ backgroundColor="white" borderStyle="inset">
<mx:HBox horizontalGap="0">
<mx:ToggleButtonBar height="100%" dataProvider="{categoryStack}" direction="vertical"/>
</mx:HBox>
<flexlib:SuperTabNavigator id="editorStack" width="100%" height="100%" paddingLeft="2" paddingRight="2"
allowTabSqueezing="false" minTabWidth="10" closePolicy="close_never"
- scrollSpeed="20"/>
+ scrollSpeed="20" change="ensureEditorsPopulated(IndexChangedEvent(event).relatedObject as VBox)"/>
</mx:VBox>
<mx:VBox width="100%" height="100%" label="Advanced" initialize="checkAdvanced()" verticalGap="1">
helpLabel.visible = false;
}
+ private var tabComponents:Object = {};
+
private function initialiseEditors():void {
editorStack.removeAllChildren();
if ( selectedEntity == null || feature == null )
editorStack.addChild(editorBox);
var tabs:Object = {};
+ tabComponents = {};
for each (var factory:EditorFactory in feature.editors) {
if ( factory.presence.isEditorPresent(factory, selectedEntity, null) ) {
tab.label = category;
editorStack.addChild(tab);
tabs[category] = tab;
+ tabComponents[tab] = [];
}
var catEditor:DisplayObject = factory.createEditorInstance(selectedEntity);
if ( catEditor != null )
- tab.addChild(catEditor);
+ tabComponents[tab].push(catEditor);
+ // tab.addChild(catEditor);
}
}
return box;
}
+ private function ensureEditorsPopulated(tab:VBox):void {
+ var components:Array = tabComponents[tab];
+ if ( components == null || tab == null || tab.numChildren >= components.length )
+ return;
+ for each (var component:DisplayObject in components ) {
+ tab.addChild(component);
+ }
+ }
+
private function checkAdvanced():void {
if ( selectedEntity != null )
setupAdvanced(selectedEntity);