소스 검색

Added virtual GetFileTypeIcon method to FileBrowser.

Mark Sibly 8 년 전
부모
커밋
8bf3a9b753
1개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 12 1
      modules/mojox/filebrowser.monkey2

+ 12 - 1
modules/mojox/filebrowser.monkey2

@@ -178,7 +178,7 @@ Class FileBrowser Extends TreeView
 			child.Text=f
 			child.Text=f
 			child._path=fpath
 			child._path=fpath
 			
 			
-			Local icon:=_fileTypeIcons[ExtractExt( f ).ToLower()]
+			Local icon:=GetFileTypeIcon( fpath )
 			
 			
 			If i<dirs.Length
 			If i<dirs.Length
 				If Not icon icon=_dirIcon
 				If Not icon icon=_dirIcon
@@ -231,6 +231,17 @@ Class FileBrowser Extends TreeView
 		Return _fileTypeIcons
 		Return _fileTypeIcons
 	End
 	End
 	
 	
+	Protected
+	
+	Method GetFileTypeIcon:Image( path:String ) Virtual
+	
+		Local ext:=ExtractExt( path )
+		If Not ext Return Null
+		
+		Return GetFileTypeIcons()[ ext.ToLower() ]
+	End
+	
+	
 	Private
 	Private
 	
 	
 	Global _fileTypeIcons:StringMap<Image>
 	Global _fileTypeIcons:StringMap<Image>