<?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/02/19/setting-a-variable-row-height-on-an-mx-menubar-control-in-flex/ --> <mx:Application name="MenuBar_menuShow_menu_variableRowHeight_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" backgroundColor="white"> <mx:Script> <![CDATA[ import mx.events.MenuEvent; protected function mBar_menuShowHandler(evt:MenuEvent):void { evt.menu.variableRowHeight = ch.selected; evt.menu.invalidateSize(); } ]]> </mx:Script> <mx:ApplicationControlBar dock="true"> <mx:CheckBox id="ch" label="variableRowHeight" /> </mx:ApplicationControlBar> <mx:MenuBar id="mBar" labelField="@label" menuShow="mBar_menuShowHandler(event);"> <mx:dataProvider> <mx:XMLListCollection> <mx:XMLList xmlns=""> <menu label="File..."> <item label="New" /> <item label="Open" /> <item label="Save" /> <item label="Save As" /> <fake type="separator" /> <item label="Exit" /> </menu> <menu label="Edit..."> <item label="Cut" /> <item label="Copy" /> <item label="Paste" /> <fake type="separator" /> <item label="Undo" /> <item label="Redo" /> <fake type="separator" /> <item label="radio button" type="radio" toggled="true" /> <item label="check box" type="check" toggled="true" /> </menu> </mx:XMLList> </mx:XMLListCollection> </mx:dataProvider> </mx:MenuBar> </mx:Application>
댓글 없음:
댓글 쓰기