filerenderer.mxml
来自「a flex project similar a "window eplorer」· MXML 代码 · 共 34 行
MXML
34 行
<mx:HBox backgroundAlpha="0" horizontalGap="0" verticalAlign="middle" width="100%" xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Script>
// Provide file icon for all items that are files
// Might potentially expands to recognize specific file types
[Embed( "images/file.gif" )]
private var imgFile:String = null;
// Provide folder icon for all items that are folders (directories)
[Embed( "images/folder.gif" )]
private var imgFolder:String = null;
// Implement setValue method to handle row specific display
public function setValue( str:String, item:Object, sel:Boolean ):Void {
// Manage the icon in the renderer to represent item type
if( !item.file ) {
imgIcon.source = imgFolder;
} else {
imgIcon.source = imgFile;
}
// Set the name of the item
lblName.text = item.name;
}
</mx:Script>
<!-- Spacer used for more fine-grained control versus margins -->
<mx:Spacer width="3" />
<!-- Display icon and name for item being rendered -->
<mx:Image id="imgIcon" />
<mx:Label id="lblName" width="100%" />
</mx:HBox>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?