其他代码和 FLEX- MDI窗口开发实例一样。
in MDITest1.mxml
1
<?
xml version="1.0" encoding="utf-8"
?>
2 < ChildWindow xmlns ="ext.containers.windows.mdi.*" xmlns:mx ="http://www.adobe.com/2006/mxml"
3 width ="340" height ="214" xmlns:flexlib ="flexlib.containers.*"
4 title ="child window" layout ="absolute"
5 minButtonVisible ="{cbMin.selected}"
6 maxButtonVisible ="{cbMax.selected}"
7 closeButtonVisible ="{cbClose.selected}"
8 >
9
10 < mx:CheckBox id ="cbMin" x ="45" y ="49" label ="Min Button" selected ="true" />
11 < mx:CheckBox id ="cbMax" x ="181" y ="49" label ="Max Button" selected ="true" />
12 < mx:CheckBox id ="cbClose" x ="124" y ="106" label ="Close Button" selected ="true" />
13
14
15 </ ChildWindow >
16
细心一些朋友会发现5-6行是以前没有的属性,用来控制按键是否显示。
2 < ChildWindow xmlns ="ext.containers.windows.mdi.*" xmlns:mx ="http://www.adobe.com/2006/mxml"
3 width ="340" height ="214" xmlns:flexlib ="flexlib.containers.*"
4 title ="child window" layout ="absolute"
5 minButtonVisible ="{cbMin.selected}"
6 maxButtonVisible ="{cbMax.selected}"
7 closeButtonVisible ="{cbClose.selected}"
8 >
9
10 < mx:CheckBox id ="cbMin" x ="45" y ="49" label ="Min Button" selected ="true" />
11 < mx:CheckBox id ="cbMax" x ="181" y ="49" label ="Max Button" selected ="true" />
12 < mx:CheckBox id ="cbClose" x ="124" y ="106" label ="Close Button" selected ="true" />
13
14
15 </ ChildWindow >
16
另增强了自定制加入按钮的方法,这样就可以派生window或childWindow重载
1
protected
function addToolButtons(buttonArray:Array):
void
2 {
3 // create buttons and add to buttonArray
4 }
2 {
3 // create buttons and add to buttonArray
4 }
程序会按照先后顺序来排列按钮。