VDividedBox layout container
VDividedBox Layout Container is similar to VBox Layout Container. The difference is, it adds a divider between its child components which can be used to resize the area of container for the child components using mouse pointer. Hold the divider with left button of the mouse and move it, you will see the resized areas of the containers associated with the divider.
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center" verticalAlign="middle" width="400" height="300"> <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.controls.Alert; [Bindable] private var gridData:ArrayCollection; private function initGridData():void { gridData = new ArrayCollection(); gridData.addItem({Text: "Open source framework."}); gridData.addItem({Text: "Real time rich user-experience."}); } private function addNew():void { gridData.addItem({Text: addContent.text}); addContent.text=""; } ]]> </mx:Script> <mx:VDividedBox width="100%" height="100%"> <mx:DataGrid height="70%" width="100%" rowCount="6" dataProvider="{gridData}" creationComplete="{initGridData()}"/> <mx:VBox height="30%" width="100%" backgroundColor="white" paddingLeft="10" paddingRight="10"> <mx:Label text="Enter text:" fontWeight="bold"/> <mx:TextInput id="addContent" width="100%"/> </mx:VBox> </mx:VDividedBox> <mx:Button label="Add" click="addNew()"/> </mx:Application> 0 |
Output:
Watch in action: 1